public class StringComboBox extends SimpleComboBox<String>
ComboBox.setForceSelection(boolean)
.
To add user values to the drop down list, set the add user values
property to true using setAddUserValues(boolean)
.
User values that are added to the drop down list can be retrieved with
getUserValues()
and removed with clearUserValues()
.
NOTE: User values are added to the drop down list when the combo box
loses focus.Field.FieldStyles
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
HasDirection.Direction
DEBUG_ID_PREFIX
Constructor and Description |
---|
StringComboBox()
Creates an empty combo box in preparation for values to be added to the
selection list using
SimpleComboBox.add(java.util.List<T>) . |
StringComboBox(List<String> values)
Creates a combo box containing the specified values.
|
StringComboBox(TriggerFieldCell.TriggerFieldAppearance appearance)
Creates an empty combo box with a given appearance - values can be added
to the selection list with
SimpleComboBox.add(java.util.List<T>) . |
Modifier and Type | Method and Description |
---|---|
void |
clearUserValues()
Clears the list of values typed by the user.
|
StringComboBoxCell |
getCell()
Get the
Cell wrapped by this widget. |
List<String> |
getUserValues()
Returns a list containing values typed by the user in the combo box text
field.
|
boolean |
isAddUserValues()
Returns true to indicate that arbitrary values typed by the user will be
added to the drop down list.
|
void |
setAddUserValues(boolean isAddUserValues)
Set to true to add arbitrary values typed by the user to the drop down
list; be sure to also set force selection to false.
|
add, add, getSelectedIndex, remove
addBeforeQueryHandler, addBeforeSelectionHandler, addCollapseHandler, addExpandHandler, addSelectionHandler, clear, collapse, doQuery, expand, getAllQuery, getLabelProvider, getListView, getLoader, getMaxHeight, getMinChars, getMinListWidth, getPageSize, getQueryDelay, getStore, getTriggerAction, getTypeAheadDelay, isExpanded, isForceSelection, isTypeAhead, isUseQueryCache, select, select, setAllQuery, setExpanded, setForceSelection, setLoader, setLoadingHtml, setLoadingText, setMaxHeight, setMinChars, setMinListWidth, setPageSize, setQueryDelay, setStore, setTriggerAction, setTypeAhead, setTypeAheadDelay, setUseQueryCache
addTriggerClickHandler, isEditable, isFinishEditOnEnter, isMonitorTab, setEditable, setFinishEditOnEnter, setHideTrigger, setMonitorTab
addChangeHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addParseErrorHandler, getCurrentValue, getCursorPos, getDirection, getDirectionEstimator, getEmptyText, getPropertyEditor, getSelectedText, getSelectionLength, getText, getValueOrThrow, isAllowBlank, isClearValueOnParseError, isCurrentValid, isCurrentValid, isReadOnly, isSelectOnFocus, select, selectAll, setAllowBlank, setClearValueOnParseError, setCursorPos, setDirection, setDirectionEstimator, setDirectionEstimator, setEmptyText, setId, setPropertyEditor, setReadOnly, setSelectionRange, setSelectOnFocus, setTabIndex, setText, setValue, validateCurrent
addInvalidHandler, addValidator, addValidHandler, addValueChangeHandler, clearInvalid, finishEditing, flush, forceInvalid, getErrors, getErrorSupport, getName, getOriginalValue, getValidateOnBlur, getValidationDelay, getValidators, isAutoValidate, isEditing, isValid, isValid, markInvalid, onBrowserEvent, onPropertyChange, removeValidator, reset, setAutoValidate, setDelegate, setErrorSupport, setName, setOriginalValue, setValidateOnBlur, setValidationDelay, setValue, showErrors, validate, validate
getElement, getKeyProvider, getValue, redraw, setValue
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disable, disableEvents, enable, enableEvents, fireEvent, focus, getData, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getShadowPosition, getStateId, getTabIndex, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setShadowPosition, setSize, setStateful, setStateId, setToolTip, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
fireEvent
getValue
addBlurHandler
public StringComboBox()
SimpleComboBox.add(java.util.List<T>)
.public StringComboBox(TriggerFieldCell.TriggerFieldAppearance appearance)
SimpleComboBox.add(java.util.List<T>)
.appearance
- the appearance to use when drawing the combo boxpublic void clearUserValues()
public StringComboBoxCell getCell()
CellComponent
Cell
wrapped by this widget.public List<String> getUserValues()
public boolean isAddUserValues()
public void setAddUserValues(boolean isAddUserValues)
isAddUserValues
- true to add arbitrary values typed by the user to
the drop down listCopyright © 2015. All rights reserved.