public class StringComboBoxCell extends ComboBoxCell<String>
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
Cell.Context
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.
|
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, collapse, doQuery, expand, finishEditing, getAllQuery, getLabelProvider, getListView, getLoader, getMaxHeight, getMinChars, getMinListWidth, getMode, getPageSize, getPagingToolBar, getQueryDelay, getStore, getTriggerAction, getTypeAheadDelay, isExpanded, isForceSelection, isIE11, isTypeAhead, isUseQueryCache, onBrowserEvent, render, select, select, setAllQuery, setForceSelection, setLoader, setLoadingHtml, setLoadingText, setMaxHeight, setMinChars, setMinListWidth, setPageSize, setQueryDelay, setStore, setTriggerAction, setTypeAhead, setTypeAheadDelay, setUseQueryCache
getAppearance, isEditable, isFinishEditOnEnter, isHideTrigger, isMonitorTab, setEditable, setFinishEditOnEnter, setHideTrigger, setMonitorTab, setSize
addParseErrorHandler, disable, enable, getCursorPos, getEmptyText, getFocusElement, getInputElement, getName, getPropertyEditor, getText, isAllowBlank, isClearValueOnParseError, isSelectOnFocus, onEmpty, resetFocus, select, selectAll, setAllowBlank, setClearValueOnParseError, setCursorPos, setEmptyText, setName, setPropertyEditor, setSelectOnFocus, setText
getHeight, getWidth, handlesSelection, isDisabled, isReadOnly, onValid, redrawOnResize, setHeight, setReadOnly, setSize, setWidth
addHandler, fireEvent, isDisableEvents, setDisableEvents
isEditing
clearViewData, getViewData, setViewData
dependsOnSelection, getConsumedEvents, setValue
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fireEvent
public StringComboBoxCell(ListStore<String> store, LabelProvider<? super String> labelProvider)
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)
isAddUserValues
- true to add arbitrary values typed by the user to
the drop down listCopyright © 2015. All rights reserved.