public class StringComboBoxCell extends ComboBoxCell<String>
A combo box cell for use with strings, providing optional support for entering arbitrary text and adding that text to the drop down.
To enable the user to enter arbitrary text in the combo box text field, set
the force selection property to true using ComboBoxCell.setForceSelection(boolean)
.
To add user entered text to the combo box drop down, set the add user
values property to true using setAddUserValues(boolean)
.
ComboBoxCell.QueryMode, ComboBoxCell.TriggerAction
TriggerFieldCell.TriggerFieldAppearance
ValueBaseInputCell.ValueBaseFieldAppearance
FieldCell.FieldAppearance, FieldCell.FieldAppearanceOptions, FieldCell.FieldViewData
lastQuery, loader, navKeyDelay, navKeyTask, pageSize, pagingToolBar, store
finishEditOnEnter, focusedCell, mimicking
allowBlank, finishEditOnBlur, impl, name, propertyEditor
bypassClearContext, focusContext, height, lastContext, lastParent, lastValue, lastValueUpdater, width
Constructor and Description |
---|
StringComboBoxCell(ListStore<String> store,
LabelProvider<? super String> labelProvider)
Creates a combo box cell for use with strings.
|
StringComboBoxCell(ListStore<String> store,
LabelProvider<? super String> labelProvider,
TriggerFieldCell.TriggerFieldAppearance appearance)
Creates a combo box cell for use with strings with a specified appearance rather than the default.
|
Modifier and Type | Method and Description |
---|---|
void |
clearUserValues()
Clears the list of values typed by the user.
|
protected String |
getByValue(String value) |
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.
|
addBeforeSelectionHandler, addSelectionHandler, bindStore, collapse, collapseIf, collapseIf, createPagingToolBar, doForce, doQuery, expand, finishEditing, getAllQuery, getLabelProvider, getListView, getLoader, getMaxHeight, getMinChars, getMinListWidth, getMode, getPageSize, getPagingToolBar, getParams, getQueryDelay, getStore, getTriggerAction, getTypeAheadDelay, handleFocusManagerExecute, init, initView, isExpanded, isFocusedWithTarget, isForceSelection, isTypeAhead, isUseQueryCache, itemMatchesQuery, onBlur, onBrowserEvent, onEmptyResults, onEnterKeyDown, onKeyUp, onNavigationKey, onResultsLoad, onSelect, onStoreUpdate, onTriggerClick, onTypeAhead, onViewClick, render, restrict, select, select, selectByValue, selectNext, selectPrev, setAllQuery, setForceSelection, setLoader, setLoadingIndicator, setMaxHeight, setMinChars, setMinListWidth, setMode, setPageSize, setQueryDelay, setStore, setTriggerAction, setTypeAhead, setTypeAheadDelay, setUseQueryCache, triggerBlur
clearContext, getAppearance, isEditable, isFinishEditOnEnter, isHideTrigger, isMonitorTab, onClick, onFocus, onKeyDown, onMouseDown, onMouseOut, onMouseOver, onTap, saveContext, setEditable, setFinishEditOnEnter, setHideTrigger, setMonitorTab, setSize, validateBlur
addParseErrorHandler, applyEmptyText, disable, enable, getCursorPos, getEmptyText, getFocusElement, getInputElement, getName, getPropertyEditor, getText, isAllowBlank, isClearValueOnParseError, isSelectOnFocus, onClick, onEmpty, removeEmptyText, resetFocus, select, selectAll, setAllowBlank, setClearValueOnParseError, setCursorPos, setEmptyText, setName, setPropertyEditor, setSelectOnFocus, setText
checkViewData, ensureViewData, getHeight, getWidth, handlesSelection, hasFocus, isDisabled, isReadOnly, onKeyPress, onMouseUp, onValid, redrawOnResize, setHeight, setReadOnly, setSize, setWidth
addCellGestureAdapter, addHandler, createHandlerManager, fireCancellableEvent, fireCancellableEvent, fireEvent, fireEvent, getCellGestureAdapter, getCellGestureAdapterCount, getConsumedEvents, isDisableEvents, onTouch, removeCellGestureAdapter, setDisableEvents
public StringComboBoxCell(ListStore<String> store, LabelProvider<? super String> labelProvider)
Creates a combo box cell for use with strings.
A simple store for strings can be created using:
new ListStore<String>(new ModelKeyProvider<String>() { @Override public String getKey(String item) { return item.toString(); } })
A simple label provider for use with strings can be created using:
new LabelProvider<String>() { @Override public String getLabel(String item) { return item; } }
store
- the store to contain the stringslabelProvider
- returns a label for a given stringpublic StringComboBoxCell(ListStore<String> store, LabelProvider<? super String> labelProvider, TriggerFieldCell.TriggerFieldAppearance appearance)
store
- the store to contain the stringslabelProvider
- returns a label for a given stringappearance
- the appearance to use when rendering this cellpublic void clearUserValues()
public List<String> getUserValues()
public boolean isAddUserValues()
public 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.
This value is false by default (i.e. user values are not added to the drop down list).
isAddUserValues
- true to add arbitrary values typed by the user to
the drop down listprotected String getByValue(String value)
getByValue
in class ComboBoxCell<String>
Copyright © 2018. All rights reserved.