public class SuggestionBox extends ComboBox<SuggestionBoxDataModel>
SuggestionBoxDataModel
class. Otherwise it will work as
a simple combo box.setModel(org.gwt.advanced.client.datamodel.SuggestionBoxDataModel)
.Modifier and Type | Class and Description |
---|---|
protected class |
SuggestionBox.ExpressionFocusHandler
This is a focus listener that starts / cancels the timer.
|
protected class |
SuggestionBox.ExpressionKeyboardHandler
This handler is invoked when a user types any text and sets focus
|
protected class |
SuggestionBox.ExpressionTimer
This is a timer that displays the list of items.
|
ComboBox.ComboBoxKeyboardManager, ComboBox.DelegateHandler
TextButtonPanel.EnterAction
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_REQUEST_TIMEOUT
default request timeout between last expression change and getting data
|
Constructor and Description |
---|
SuggestionBox()
Constructs a new SuggestionBox.
|
SuggestionBox(int expressionLength)
Constructs an instance of this class and allows specifying the minimal length of the expression.
|
Modifier and Type | Method and Description |
---|---|
protected void |
add(ListModelEvent event)
Additionally cleans the list every time when the first item is added.
|
protected void |
addComponentListeners()
This method adds component listeners.
|
void |
addSuggestionBoxListener(SuggestionBoxListener listener)
Adds a new suggestion box listener that will be invoked on expression change.
|
protected void |
cancelTimer()
Immediately cancels the
timer if it's run. |
void |
cleanSelection()
Cleans all the data displayed in the widget.
|
String |
getExpression()
This method returns an expression entered by a user for drop down list selection.
|
SuggestionBox.ExpressionFocusHandler |
getExpressionFocusHandler()
Getter for property 'focusHandler'.
|
protected SuggestionBox.ExpressionKeyboardHandler |
getExpressionKeyboardHandler()
Getter for property 'keyboardHandler'.
|
int |
getExpressionLength()
Getter for property 'expressionLength'.
|
SuggestionBoxDataModel |
getModel()
Getter for property 'model'.
|
int |
getRequestTimeout()
Gets a timeout value between last expression change and getting data.
|
protected List<SuggestionBoxListener> |
getSuggestionBoxListeners()
Getter for property 'suggestionBoxListeners'.
|
protected com.google.gwt.user.client.Timer |
getTimer()
Getter for property 'timer'.
|
void |
onModelEvent(ListModelEvent event)
Additionally listens for events produced by the
SuggestionBoxDataModel . |
void |
refreshList()
Deprecated.
you don't have to invoke this method since the list is updated on data model changes.
|
void |
removeSuggestionBoxListener(SuggestionBoxListener listener)
This method removes the suggestion box listener.
|
void |
setExpression(String expression)
Sets the expression value and displays it in the text box.
|
void |
setExpressionLength(int expressionLength)
Setter for property 'expressionLength'.
|
void |
setModel(SuggestionBoxDataModel model)
Setter for property 'model'.
|
void |
setRequestTimeout(int requestTimeout)
Sets the request timeout value.
|
void |
showList(boolean prepareList)
This method shows the drop down list.
|
addBlurHandler, addChangeHandler, addClickHandler, addCloseHandler, addFocusHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addValueChangeHandler, clean, getDefaultImageName, getDelegateHandler, getDropDownPosition, getHighlightRow, getItem, getItemCount, getItemIndex, getKeyboardManager, getListItemFactory, getListPanel, getSelected, getSelectedId, getSelectedIndex, getSelectedWidget, getStartItemIndex, getText, getValue, getVisibleRows, hideList, isKeyPressed, isLazyRenderingEnabled, isListPanelOpened, moveCursor, prepareSelectedValue, remove, select, select, setDropDownPosition, setFocus, setHighlightRow, setKeyPressed, setLazyRenderingEnabled, setListItemFactory, setListPopupOpened, setSelectedId, setSelectedIndex, setStartItemIndex, setText, setValue, setValue, setVisibleRows
display, getChoiceButton, getChoiceButtonImage, getEnterAction, getHeight, getLayout, getLockingPanel, getMaxLength, getSelectedValue, getWidth, isChoiceButtonVisible, isCustomTextAllowed, isEnabled, isLocked, lock, prepareChoiceButton, setChoiceButtonImage, setChoiceButtonVisible, setCustomTextAllowed, setEnabled, setEnterAction, setHeight, setLocked, setMaxLength, setTabIndex, setWidth, unlock
add, getContainerElement, getWidget, iterator, remove, setWidget, setWidget
add, adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, orphan, remove
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, sinkBitlessEvent, toString, unsinkEvents
public static final int DEFAULT_REQUEST_TIMEOUT
public SuggestionBox()
3
.public SuggestionBox(int expressionLength)
expressionLength
- is an expression length.public int getExpressionLength()
public void setExpressionLength(int expressionLength)
expressionLength
- Value to set for property 'expressionLength'.public int getRequestTimeout()
public void setRequestTimeout(int requestTimeout)
requestTimeout
- is a request timeout value in msc.public void setModel(SuggestionBoxDataModel model)
setModel
in class ComboBox<SuggestionBoxDataModel>
model
- Value to set for property 'model'.public SuggestionBoxDataModel getModel()
getModel
in class ComboBox<SuggestionBoxDataModel>
public void addSuggestionBoxListener(SuggestionBoxListener listener)
listener
- is a listener to be added.public void removeSuggestionBoxListener(SuggestionBoxListener listener)
listener
- a suggestion box listener instance to remove.public String getExpression()
SuggestionBoxDataModel
it retuns
null
.public void setExpression(String expression)
expression
- is an expression to be applied.public void refreshList()
ListCallbackHandler
implementation and values are NOT cached on a
client side.public void cleanSelection()
cleanSelection
in class ComboBox<SuggestionBoxDataModel>
public void onModelEvent(ListModelEvent event)
SuggestionBoxDataModel
.
This method should implement actions which related widgets must do on events.onModelEvent
in interface ListModelListener
onModelEvent
in class ComboBox<SuggestionBoxDataModel>
event
- an event produced by the model.protected void add(ListModelEvent event)
add
in class ComboBox<SuggestionBoxDataModel>
event
- is an event containing data about the added item.protected void addComponentListeners()
addComponentListeners
in class ComboBox<SuggestionBoxDataModel>
protected List<SuggestionBoxListener> getSuggestionBoxListeners()
protected com.google.gwt.user.client.Timer getTimer()
public SuggestionBox.ExpressionFocusHandler getExpressionFocusHandler()
public void showList(boolean prepareList)
showList
in class ComboBox<SuggestionBoxDataModel>
prepareList
- forces the list to be prepared (refreshed) before displaying.protected SuggestionBox.ExpressionKeyboardHandler getExpressionKeyboardHandler()
protected void cancelTimer()
timer
if it's run.Copyright © 2008–2013. All rights reserved.