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.Timer
protected HighlightTool.RemoveHandler
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 consoleprotected final com.google.gwt.user.client.ui.FlowPanel
Fields 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 TypeMethodDescriptionvoid
activate()
protected void
addResult
(com.levigo.jadice.web.shared.service.internal.textsearch.SearchResult r) protected void
protected void
protected void
finish()
Returns the text that was searched before.Returns the text of the search-fieldboolean
boolean
Returns the flag that indicates if a search is preserved if the document is changedprotected void
void
onSearchAbort
(Throwable caught) 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
search()
void
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 changedvoid
setSearchFieldText
(String searchFieldText) Sets the text for the search-fieldvoid
protected void
update()
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
- 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:
onSearchAbort
in 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
-