public class ComboBoxCell<T> extends TriggerFieldCell<T> implements HasBeforeSelectionHandlers<T>, HasSelectionHandlers<T>
Modifier and Type | Class and Description |
---|---|
static class |
ComboBoxCell.QueryMode |
static class |
ComboBoxCell.TriggerAction
TriggerAction enum.
|
TriggerFieldCell.TriggerFieldAppearance
ValueBaseInputCell.ValueBaseFieldAppearance
FieldCell.FieldAppearance, FieldCell.FieldAppearanceOptions, FieldCell.FieldViewData
Cell.Context
Constructor and Description |
---|
ComboBoxCell(ListStore<T> store,
LabelProvider<? super T> labelProvider)
Creates a combo box cell that renders all items with the given label provider.
|
ComboBoxCell(ListStore<T> store,
LabelProvider<? super T> labelProvider,
ListView<T,?> view)
Creates a combo box cell that renders the input value with the label provider.
|
ComboBoxCell(ListStore<T> store,
LabelProvider<? super T> labelProvider,
ListView<T,?> view,
TriggerFieldCell.TriggerFieldAppearance appearance)
Creates a combo box cell that renders the input value with the label provider.
|
ComboBoxCell(ListStore<T> store,
LabelProvider<? super T> labelProvider,
SafeHtmlRenderer<T> renderer)
Creates a combo box cell that renders the input value with the label provider and the drop down values with the
renderer.
|
ComboBoxCell(ListStore<T> store,
LabelProvider<? super T> labelProvider,
SafeHtmlRenderer<T> renderer,
TriggerFieldCell.TriggerFieldAppearance appearance)
Creates a combo box cell that renders the input value with the label provider and the drop down values with the
renderer.
|
ComboBoxCell(ListStore<T> store,
LabelProvider<? super T> labelProvider,
TriggerFieldCell.TriggerFieldAppearance appearance)
Creates a combo box cell that renders both the input value and drop down values with the given label provider.
|
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addBeforeSelectionHandler(BeforeSelectionHandler<T> handler)
Adds a
BeforeSelectionEvent handler. |
HandlerRegistration |
addSelectionHandler(SelectionHandler<T> handler)
Adds a
SelectionEvent handler. |
void |
collapse(Cell.Context context,
XElement parent) |
void |
doQuery(Cell.Context context,
XElement parent,
ValueUpdater<T> updater,
T value,
String query,
boolean force) |
void |
expand(Cell.Context context,
XElement parent,
ValueUpdater<T> updater,
T value) |
void |
finishEditing(Element parent,
T value,
Object key,
ValueUpdater<T> valueUpdater) |
String |
getAllQuery()
Returns the all query.
|
LabelProvider<? super T> |
getLabelProvider()
Returns the label provider.
|
ListView<T,?> |
getListView()
Returns the list view.
|
Loader<?,?> |
getLoader() |
int |
getMaxHeight()
Returns the dropdown list's max height.
|
int |
getMinChars()
Returns the min characters used for autocompete and typeahead.
|
int |
getMinListWidth()
Returns the dropdown list's min width.
|
ComboBoxCell.QueryMode |
getMode() |
int |
getPageSize()
Returns the page size.
|
PagingToolBar |
getPagingToolBar()
Returns the combo's paging tool bar.
|
int |
getQueryDelay()
Returns the length of time in milliseconds to delay between the start of typing and sending the query to filter the
dropdown list.
|
ListStore<T> |
getStore()
Returns the combo's list store.
|
ComboBoxCell.TriggerAction |
getTriggerAction()
Returns the trigger action.
|
int |
getTypeAheadDelay()
Returns the type ahead delay in milliseconds.
|
boolean |
isExpanded()
Returns
true if the dropdown is expanded. |
boolean |
isForceSelection()
Returns true if the field's value is forced to one of the value in the list.
|
static boolean |
isIE11() |
boolean |
isTypeAhead()
Returns true if type ahead is enabled.
|
boolean |
isUseQueryCache()
Returns the state if the query cache is used or not.
|
void |
onBrowserEvent(Cell.Context context,
Element parent,
T value,
NativeEvent event,
ValueUpdater<T> valueUpdater) |
void |
render(Cell.Context context,
T value,
SafeHtmlBuilder sb) |
void |
select(int index)
Select an item in the dropdown list by its numeric index in the list.
|
void |
select(T item)
Select an item in the dropdown list.
|
void |
setAllQuery(String allQuery)
The text query to send to the server to return all records for the list with no filtering (defaults to '').
|
void |
setForceSelection(boolean forceSelection)
Sets whether the combo's value is restricted to one of the values in the list, false to allow the user to set
arbitrary text into the field (defaults to false).
|
void |
setLoader(Loader<?,?> loader)
Sets the loader for use with remote queries.
|
void |
setLoadingHtml(SafeHtml loadingHtml)
Sets the html loading text to be displayed during a load request.
|
void |
setLoadingText(String loadingText)
Sets the text loading text to be displayed during a load request.
|
void |
setMaxHeight(int maxHeight)
Sets the maximum height in pixels of the dropdown list before scrollbars
are shown (defaults to 300).
|
void |
setMinChars(int minChars)
Sets the minimum number of characters the user must type before autocomplete and typeahead active (defaults to 4 if
remote, or 0 if local).
|
void |
setMinListWidth(int minListWidth)
Sets the minimum width of the dropdown list in pixels (defaults to 70, will be ignored if listWidth has a higher
value).
|
void |
setPageSize(int pageSize)
Sets the page size.
|
void |
setQueryDelay(int queryDelay)
The length of time in milliseconds to delay between the start of typing and sending the query to filter the
dropdown list.
|
void |
setStore(ListStore<T> store)
Sets the combo's store.
|
void |
setTriggerAction(ComboBoxCell.TriggerAction triggerAction) |
void |
setTypeAhead(boolean typeAhead) |
void |
setTypeAheadDelay(int typeAheadDelay) |
void |
setUseQueryCache(boolean useQueryCache)
Set this to false to disable the last query cache (defaults to true).
|
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 ComboBoxCell(ListStore<T> store, LabelProvider<? super T> labelProvider)
store
- the store containing the data that can be selectedlabelProvider
- converts the current model type into a string value to display in the text boxpublic ComboBoxCell(ListStore<T> store, LabelProvider<? super T> labelProvider, ListView<T,?> view)
store
- the store containing the data that can be selectedlabelProvider
- converts the current model type into a string value to display in the text boxview
- the list viewpublic ComboBoxCell(ListStore<T> store, LabelProvider<? super T> labelProvider, ListView<T,?> view, TriggerFieldCell.TriggerFieldAppearance appearance)
store
- the store containing the data that can be selectedlabelProvider
- converts the current model type into a string value to display in the text boxview
- the list viewappearance
- the appearancepublic ComboBoxCell(ListStore<T> store, LabelProvider<? super T> labelProvider, SafeHtmlRenderer<T> renderer)
store
- the store containing the data that can be selectedlabelProvider
- converts the current model type into a string value to display in the text boxrenderer
- draws the current model as html in the drop downpublic ComboBoxCell(ListStore<T> store, LabelProvider<? super T> labelProvider, SafeHtmlRenderer<T> renderer, TriggerFieldCell.TriggerFieldAppearance appearance)
store
- the store containing the data that can be selectedlabelProvider
- converts the current model type into a string value to display in the text boxrenderer
- draws the current model as html in the drop downappearance
- the appearancepublic ComboBoxCell(ListStore<T> store, LabelProvider<? super T> labelProvider, TriggerFieldCell.TriggerFieldAppearance appearance)
store
- the store containing the data that can be selectedlabelProvider
- converts the current model type into a string value to display in the text box and the drop
down valuesappearance
- the appearancepublic HandlerRegistration addBeforeSelectionHandler(BeforeSelectionHandler<T> handler)
BeforeSelectionEvent
handler. The handler will be passed an instance of
CellBeforeSelectionEvent
which can be cast to.addBeforeSelectionHandler
in interface HasBeforeSelectionHandlers<T>
handler
- the handlerpublic HandlerRegistration addSelectionHandler(SelectionHandler<T> handler)
SelectionEvent
handler. The handler will be passed an instance of CellSelectionEvent
which
can be cast to.addSelectionHandler
in interface HasSelectionHandlers<T>
handler
- the handlerpublic void collapse(Cell.Context context, XElement parent)
public void doQuery(Cell.Context context, XElement parent, ValueUpdater<T> updater, T value, String query, boolean force)
public void expand(Cell.Context context, XElement parent, ValueUpdater<T> updater, T value)
public void finishEditing(Element parent, T value, Object key, ValueUpdater<T> valueUpdater)
finishEditing
in class TriggerFieldCell<T>
public String getAllQuery()
public LabelProvider<? super T> getLabelProvider()
public Loader<?,?> getLoader()
public int getMaxHeight()
public int getMinChars()
public int getMinListWidth()
public ComboBoxCell.QueryMode getMode()
public int getPageSize()
public PagingToolBar getPagingToolBar()
public int getQueryDelay()
public ComboBoxCell.TriggerAction getTriggerAction()
public int getTypeAheadDelay()
public boolean isUseQueryCache()
public boolean isExpanded()
true
if the dropdown is expanded.public boolean isForceSelection()
public boolean isTypeAhead()
public void onBrowserEvent(Cell.Context context, Element parent, T value, NativeEvent event, ValueUpdater<T> valueUpdater)
onBrowserEvent
in interface Cell<T>
onBrowserEvent
in class TriggerFieldCell<T>
public void render(Cell.Context context, T value, SafeHtmlBuilder sb)
public void select(int index)
index
- the index of the item to selectpublic void select(T item)
item
- the item to selectpublic void setAllQuery(String allQuery)
allQuery
- the all querypublic void setForceSelection(boolean forceSelection)
forceSelection
- true to force selectionpublic void setLoader(Loader<?,?> loader)
ListView.onBeforeLoad()
.
setLoadingHtml(SafeHtml)
or setLoadingText(String)
are used the list will display the
loading HTML or text while loading in the list.
loader
- the loaderpublic void setLoadingHtml(SafeHtml loadingHtml)
setLoader(Loader)
has to be set for this use.
loadingHtml
- the loading htmlpublic void setLoadingText(String loadingText)
setLoader(Loader)
has to be set for this use.
loadingText
- the loading textpublic void setMaxHeight(int maxHeight)
maxHeight
- the max hieghtpublic void setMinChars(int minChars)
minChars
- minimum number of characters before activating autocomplete and typeaheadpublic void setMinListWidth(int minListWidth)
minListWidth
- the min widthpublic void setPageSize(int pageSize)
pageSize
- the page sizepublic void setQueryDelay(int queryDelay)
queryDelay
- the query delaypublic void setStore(ListStore<T> store)
store
- the storepublic void setTriggerAction(ComboBoxCell.TriggerAction triggerAction)
public void setTypeAhead(boolean typeAhead)
public void setTypeAheadDelay(int typeAheadDelay)
public void setUseQueryCache(boolean useQueryCache)
useQueryCache
- the useQueryCache to setpublic static boolean isIE11()
Copyright © 2015. All rights reserved.