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
FieldsModifier and TypeFieldDescriptionprotected final com.google.gwt.user.client.Timerprotected HighlightTool.RemoveHandlerprotected intprotected intprotected booleanprotected final NotificationEventBusprotected final com.google.gwt.user.client.ui.HTMLstatic final Stringstatic final Stringprotected Stringprotected final com.google.gwt.user.client.ui.HTMLprotected final PageViewprotected final com.google.gwt.user.client.ui.LayoutPanelprotected booleanprotected booleanprotected final com.google.gwt.user.client.ui.TextBoxprotected List<com.levigo.jadice.web.shared.service.internal.textsearch.SearchResult> protected final RolloutSearchStyleprotected booleanto only show the warning one time in the consoleprotected final com.google.gwt.user.client.ui.FlowPanelFields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionRolloutSearch(PageView pageView) RolloutSearch(PageView pageView, AbstractBar dynamicToolbar) -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()protected voidaddResult(com.levigo.jadice.web.shared.service.internal.textsearch.SearchResult r) protected voidprotected voidprotected voidfinish()Returns the text that was searched before.Returns the text of the search-fieldbooleanbooleanReturns the flag that indicates if a search is preserved if the document is changedprotected voidvoidonSearchAbort(Throwable caught) voidonSearchFinish(com.levigo.jadice.web.shared.service.internal.textsearch.TextSearchAnswer result) voidonSearchResult(com.levigo.jadice.web.shared.service.internal.textsearch.TextSearchAnswer result, int searchIndex, Document document) protected voidprotected voidreset(AbstractBar dynamicToolbar) protected booleansearch()voidintprotected voidsetCurrent(int current) voidsetEnabled(boolean enabled) voidsetLastSearch(String lastSearch) Sets the text that was searched before.voidsetPreserveSearch(boolean preserveSearch) Sets the flag that controls if the search is preserved if the document is changedvoidsetSearchFieldText(String searchFieldText) Sets the text for the search-fieldvoidprotected voidupdate()Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidgetMethods 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, unsinkEventsMethods 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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.levigo.jadice.web.client.search.internal.GeneralSearch
performSearch
-
Field Details
-
KEY_ALL
- See Also:
-
KEY_CURRENT
- See Also:
-
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
-
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
-
currentSearchIndex
protected int currentSearchIndex -
searchBegan
protected boolean searchBegan -
lastSearch
-
enabled
protected boolean enabled -
currentHighlighted
-
warnShown
protected boolean warnShownto only show the warning one time in the console -
autoEnterTimer
protected final com.google.gwt.user.client.Timer autoEnterTimer -
eventBus
-
preserveSearch
protected boolean preserveSearch
-
-
Constructor Details
-
RolloutSearch
-
RolloutSearch
-
-
Method Details
-
reset
-
startSearch
public void startSearch() -
search
-
search
protected boolean search() -
finish
protected void finish() -
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
Sets the text for the search-field- Parameters:
searchFieldText- the text for the search-field
-
setLastSearch
Sets the text that was searched before.- Parameters:
lastSearch- the text that was searched before
-
getSearchField
Returns the text of the search-field- Returns:
- the text of the search-field
-
getLastSearch
Returns the text that was searched before.- Returns:
- the text that was searched before.
-
onSearchAbort
- Specified by:
onSearchAbortin interfacecom.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
-