Class RolloutSearch

java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Composite
com.levigo.jadice.web.client.search.RolloutSearch
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.IsRenderable, com.google.gwt.user.client.ui.IsWidget, com.levigo.jadice.web.client.search.internal.GeneralSearch

public class RolloutSearch extends com.google.gwt.user.client.ui.Composite implements com.levigo.jadice.web.client.search.internal.GeneralSearch
This class is responsible for sending the search string to the server and handle the asynchronously received results on the client side. Actions include highlighting the found occurrences, highlighting the currently selected result in a different color compared to the other results or aborting the search if too many results were found.
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject

    com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final com.google.gwt.user.client.Timer
     
     
    protected int
     
    protected int
     
    protected boolean
     
    protected final NotificationEventBus
     
    protected final com.google.gwt.user.client.ui.HTML
     
    static final String
     
    static final String
     
    protected String
     
    protected final com.google.gwt.user.client.ui.HTML
     
    protected final PageView
     
    protected final com.google.gwt.user.client.ui.LayoutPanel
     
    protected boolean
     
    protected boolean
     
    protected final com.google.gwt.user.client.ui.TextBox
     
    protected List<com.levigo.jadice.web.shared.service.internal.textsearch.SearchResult>
     
    protected final RolloutSearchStyle
     
    protected boolean
    to only show the warning one time in the console
    protected final com.google.gwt.user.client.ui.FlowPanel
     

    Fields inherited from class com.google.gwt.user.client.ui.UIObject

    DEBUG_ID_PREFIX
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    RolloutSearch(PageView pageView, AbstractBar dynamicToolbar)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected void
    addResult(com.levigo.jadice.web.shared.service.internal.textsearch.SearchResult r)
     
    protected void
     
    protected void
     
    protected void
     
    Returns the text that was searched before.
    Returns the text of the search-field
    boolean
     
    boolean
    Returns the flag that indicates if a search is preserved if the document is changed
    protected void
     
    void
     
    void
    onSearchFinish(com.levigo.jadice.web.shared.service.internal.textsearch.TextSearchAnswer result)
     
    void
    onSearchResult(com.levigo.jadice.web.shared.service.internal.textsearch.TextSearchAnswer result, int searchIndex, Document document)
     
    protected void
     
    protected void
    reset(AbstractBar dynamicToolbar)
     
    protected boolean
     
    void
    search(String searchString)
     
    int
     
    protected void
    setCurrent(int current)
     
    void
    setEnabled(boolean enabled)
     
    void
    setLastSearch(String lastSearch)
    Sets the text that was searched before.
    void
    setPreserveSearch(boolean preserveSearch)
    Sets the flag that controls if the search is preserved if the document is changed
    void
    setSearchFieldText(String searchFieldText)
    Sets the text for the search-field
    void
     
    protected void
     

    Methods inherited from class com.google.gwt.user.client.ui.Composite

    claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget

    Methods inherited from class com.google.gwt.user.client.ui.Widget

    addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents

    Methods inherited from class com.google.gwt.user.client.ui.UIObject

    addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.levigo.jadice.web.client.search.internal.GeneralSearch

    performSearch
  • Field Details

    • KEY_ALL

      public static final String KEY_ALL
      See Also:
    • KEY_CURRENT

      public static final String KEY_CURRENT
      See Also:
    • searchResults

      protected List<com.levigo.jadice.web.shared.service.internal.textsearch.SearchResult> searchResults
    • curResultIndex

      protected int curResultIndex
    • widget

      protected final com.google.gwt.user.client.ui.FlowPanel widget
    • panel

      protected final com.google.gwt.user.client.ui.LayoutPanel panel
    • style

      protected final RolloutSearchStyle style
    • searchField

      protected final com.google.gwt.user.client.ui.TextBox searchField
    • hitText

      protected final com.google.gwt.user.client.ui.HTML hitText
    • loading

      protected final com.google.gwt.user.client.ui.HTML loading
    • pageView

      protected final PageView pageView
    • currentSearchIndex

      protected int currentSearchIndex
    • searchBegan

      protected boolean searchBegan
    • lastSearch

      protected String lastSearch
    • enabled

      protected boolean enabled
    • currentHighlighted

      protected HighlightTool.RemoveHandler currentHighlighted
    • warnShown

      protected boolean warnShown
      to only show the warning one time in the console
    • autoEnterTimer

      protected final com.google.gwt.user.client.Timer autoEnterTimer
    • eventBus

      protected final NotificationEventBus eventBus
    • preserveSearch

      protected boolean preserveSearch
  • Constructor Details

    • RolloutSearch

      public RolloutSearch(PageView pageView)
    • RolloutSearch

      public RolloutSearch(PageView pageView, AbstractBar dynamicToolbar)
  • Method Details

    • reset

      protected void reset(AbstractBar dynamicToolbar)
    • startSearch

      public void startSearch()
    • search

      public void search(String searchString)
    • search

      protected boolean search()
    • finish

      protected void finish()
    • addResult

      protected void addResult(com.levigo.jadice.web.shared.service.internal.textsearch.SearchResult r)
    • setCurrent

      protected void setCurrent(int current)
    • cleanResults

      protected void cleanResults()
    • update

      protected void update()
    • setEnabled

      public void setEnabled(boolean enabled)
    • isEnabled

      public boolean isEnabled()
    • cancelSearch

      protected void cancelSearch()
    • activate

      public void activate()
    • onUpButton

      protected void onUpButton()
    • onDownButton

      protected void onDownButton()
    • setSearchFieldText

      public void setSearchFieldText(String searchFieldText)
      Sets the text for the search-field
      Parameters:
      searchFieldText - the text for the search-field
    • setLastSearch

      public void setLastSearch(String lastSearch)
      Sets the text that was searched before.
      Parameters:
      lastSearch - the text that was searched before
    • getSearchField

      public String getSearchField()
      Returns the text of the search-field
      Returns:
      the text of the search-field
    • getLastSearch

      public String getLastSearch()
      Returns the text that was searched before.
      Returns:
      the text that was searched before.
    • onSearchAbort

      public void onSearchAbort(Throwable caught)
      Specified by:
      onSearchAbort in interface com.levigo.jadice.web.client.search.internal.GeneralSearch
    • onSearchResult

      public void onSearchResult(com.levigo.jadice.web.shared.service.internal.textsearch.TextSearchAnswer result, int searchIndex, Document document)
      Specified by:
      onSearchResult in interface com.levigo.jadice.web.client.search.internal.GeneralSearch
    • onSearchFinish

      public void onSearchFinish(com.levigo.jadice.web.shared.service.internal.textsearch.TextSearchAnswer result)
      Specified by:
      onSearchFinish in interface com.levigo.jadice.web.client.search.internal.GeneralSearch
    • searchResultCount

      public int searchResultCount()
    • isPreserveSearch

      public boolean isPreserveSearch()
      Returns the flag that indicates if a search is preserved if the document is changed
      Returns:
      flag that indicates if a search is preserved if the document is changed
    • setPreserveSearch

      public void setPreserveSearch(boolean preserveSearch)
      Sets the flag that controls if the search is preserved if the document is changed
      Parameters:
      preserveSearch - flag that controls if the search is preserved if the document is changed