public class MaterialComboBox<T> extends gwt.material.design.client.base.AbstractValueWidget<List<T>> implements gwt.material.design.client.base.JsLoader, gwt.material.design.client.base.HasPlaceholder, com.google.gwt.event.logical.shared.HasOpenHandlers<T>, com.google.gwt.event.logical.shared.HasCloseHandlers<T>, HasUnselectItemHandler<T>, gwt.material.design.client.base.HasReadOnly
xmlns:ma='urn:import:gwt.material.design.addins.client'
<combobox:MaterialComboBox>
<m:html.Option value="1" text="Sample 1"/>
<m:html.Option value="2" text="Sample 2"/>
<m:html.Option value="3" text="Sample 3"/>
</combobox:MaterialComboBox>
gwt.material.design.client.base.MaterialWidget.Feature
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
com.google.gwt.editor.client.Editor.Ignore, com.google.gwt.editor.client.Editor.Path
Modifier and Type | Field and Description |
---|---|
protected gwt.material.design.client.base.MaterialWidget |
listbox |
protected List<T> |
values |
Constructor and Description |
---|
MaterialComboBox() |
Modifier and Type | Method and Description |
---|---|
void |
add(com.google.gwt.user.client.ui.Widget child) |
com.google.gwt.event.shared.HandlerRegistration |
addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<T> closeHandler) |
void |
addGroup(gwt.material.design.client.ui.html.OptGroup group)
Add OptionGroup directly to combobox component
|
gwt.material.design.client.ui.html.Option |
addItem(String text,
T value)
Add Value directly to combobox component
|
void |
addItem(String text,
T value,
gwt.material.design.client.ui.html.OptGroup optGroup)
Add item directly to combobox component with existing OptGroup
|
gwt.material.design.client.ui.html.Option |
addItem(T value) |
void |
addItems(Collection<T> items) |
com.google.gwt.event.shared.HandlerRegistration |
addOpenHandler(com.google.gwt.event.logical.shared.OpenHandler<T> openHandler) |
com.google.gwt.event.shared.HandlerRegistration |
addRemoveItemHandler(UnselectItemEvent.UnselectComboHandler<T> handler) |
com.google.gwt.event.shared.HandlerRegistration |
addSelectionHandler(SelectItemEvent.SelectComboHandler<T> selectionHandler) |
protected gwt.material.design.client.ui.html.Option |
buildOption(String text,
T value)
Build the Option Element with provided params
|
void |
clear() |
void |
close()
Programmatically close the combobox component
|
gwt.material.design.jquery.client.api.JQueryElement |
getDropdownContainerElement()
Will get the Selection dropdown container rendered
|
gwt.material.design.jquery.client.api.JQueryElement |
getDropdownParent() |
gwt.material.design.jquery.client.api.JQueryElement |
getDropdownResultElement()
Will get the Selection Results ul element containing all the combobox items.
|
protected gwt.material.design.client.base.mixin.EnabledMixin<gwt.material.design.client.base.MaterialWidget> |
getEnabledMixin() |
gwt.material.design.client.ui.MaterialLabel |
getErrorLabel() |
gwt.material.design.client.base.mixin.ErrorMixin<gwt.material.design.client.base.AbstractValueWidget,gwt.material.design.client.ui.MaterialLabel> |
getErrorMixin() |
gwt.material.design.client.ui.html.Label |
getLabel() |
LanguageOptions |
getLanguage() |
int |
getLimit()
Get the maximum number of items to be entered on multiple combobox
|
gwt.material.design.client.base.MaterialWidget |
getListbox() |
String |
getPlaceholder() |
gwt.material.design.client.base.mixin.ReadOnlyMixin<MaterialComboBox,gwt.material.design.client.base.MaterialWidget> |
getReadOnlyMixin() |
int |
getSelectedIndex()
Gets the text for currently selected item.
|
List<T> |
getSelectedValue()
Gets the value for currently selected item.
|
List<T> |
getSelectedValues()
Get the selected vales from multiple combobox
|
T |
getSingleValue()
Only return a single value even if multi support is activate.
|
List<T> |
getValue() |
int |
getValueIndex(T value)
Gets the index of the value pass in this method
|
List<T> |
getValues()
Get all the values sets on combobox
|
protected List<String> |
getValuesKeyIndex() |
boolean |
isAllowClear()
Check if allow clear option is enabled
|
boolean |
isCloseOnSelect()
Check whether the dropdown will be close or not when result is selected
|
boolean |
isHideSearch()
Check whether the search box is enabled on combobox
|
boolean |
isMultiple()
Check whether the multiple option is enabled
|
boolean |
isReadOnly() |
boolean |
isTags() |
boolean |
isToggleReadOnly() |
void |
load() |
protected void |
onLoad() |
protected void |
onUnload() |
void |
open()
Programmatically open the combobox component
|
void |
reload() |
void |
scrollTop(int offset) |
void |
setAcceptableValues(Collection<T> values) |
void |
setAllowClear(boolean allowClear)
Add a clear button on the right side of the combobox
|
void |
setCloseOnSelect(boolean closeOnSelect)
Allow or Prevent the dropdown from closing when a result is selected (Default true)
|
void |
setDropdownParent(String dropdownParent)
Sets the parent element of the dropdown
|
void |
setEnabled(boolean enabled) |
void |
setHideSearch(boolean hideSearch)
Set the option to display the search box inside the combobox component
|
void |
setItems(Collection<T> items) |
void |
setKeyFactory(gwt.material.design.client.base.KeyFactory<T,String> keyFactory)
Use your own key factory for value keys.
|
void |
setLabel(String text)
Set the upper label above the combobox
|
void |
setLanguage(LanguageOptions language)
Will provide a set of text objecs that can be used for i18n language support.
|
void |
setLimit(int limit)
Set the maximum number of items to be entered on multiple combobox
|
void |
setMultiple(boolean multiple)
Sets multi-value select boxes.
|
void |
setPlaceholder(String placeholder) |
void |
setReadOnly(boolean value) |
void |
setSelectedIndex(int selectedIndex)
Sets the currently selected index.
|
void |
setSingleValue(T value)
Set the selected value using a single item, generally used
in single selection mode.
|
void |
setSingleValue(T value,
boolean fireEvents)
Set the selected value using a single item, generally used
in single selection mode.
|
void |
setTags(boolean tags)
Note: Tags will only support String as generic params starting 2.x.
|
void |
setToggleReadOnly(boolean toggle) |
void |
setValue(List<T> value) |
void |
setValue(List<T> values,
boolean fireEvents) |
void |
setValues(List<T> values)
Set directly all the values that will be stored into
combobox and build options into it.
|
void |
setValues(List<T> values,
boolean fireEvents)
Set directly all the values that will be stored into
combobox and build options into it.
|
void |
unload() |
addValidationChangedHandler, addValidator, addValueChangeHandler, clearErrorOrSuccess, createBlankValidator, getErrorHandler, getErrorHandlerMixin, getErrorHandlerType, getValidatorMixin, isAllowBlank, isValidateOnBlur, removeValidator, reset, setAllowBlank, setError, setErrorHandler, setErrorHandlerType, setHelperText, setSuccess, setupBlurValidation, setValidateOnBlur, setValidators, setValue, showErrors, validate, validate
$this, add, addAttachHandler, addBlurHandler, addClickHandler, addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragLeaveHandler, addDragMoveHandler, addDragOverHandler, addDragStartHandler, addDropActivateHandler, addDropDeactivateHandler, addDropHandler, addFocusHandler, addGestureChangeHandler, addGestureEndHandler, addGestureStartHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addOrientationChangeHandler, addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler, body, clearActiveClass, enableFeature, getBackfaceVisibility, getBackgroundColor, getBorder, getBorderBottom, getBorderLeft, getBorderMixin, getBorderRadius, getBorderRight, getBorderTop, getCenterOn, getCenterOnMixin, getChildren, getChildrenList, getCircleMixin, getColorsMixin, getDataAttribute, getDepth, getDimensionMixin, getFlexboxMixin, getFloat, getFloatMixin, getFocusableMixin, getFontSize, getFontSizeMixin, getFontWeight, getFontWeightMixin, getGridMixin, getHandlerRegistry, getHideOn, getHideOnMixin, getHoverableMixin, getId, getIdMixin, getInitialClasses, getLayoutPosition, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpacity, getOrientation, getOrientationMixin, getPerspective, getPerspectiveOrigin, getScrollspy, getScrollspyMixin, getSeparatorMixin, getShadow, getShadowMixin, getShowOn, getShowOnMixin, getTabIndex, getTextAlign, getTextAlignMixin, getTextColor, getTooltip, getTooltipDelayMs, getTooltipHTML, getTooltipMixin, getTooltipPosition, getTransform, getTransformMixin, getTransformOrigin, getTransformStyle, getTruncateMixin, getVerticalAlign, getVerticalAlignMixin, getWaves, getWavesMixin, getWidth, insert, insert, isCircle, isDetectOrientation, isEnabled, isFeatureEnabled, isHoverable, isSeparator, isTruncate, registerHandler, removeHandler, setAccessKey, setBackfaceVisibility, setBackgroundColor, setBorder, setBorderBottom, setBorderLeft, setBorderRadius, setBorderRight, setBorderTop, setBottom, setCenterOn, setCircle, setClass, setDataAttribute, setDepth, setDetectOrientation, setDisplay, setFlex, setFlexAlignContent, setFlexAlignItems, setFlexAlignSelf, setFlexBasis, setFlexDirection, setFlexGrow, setFlexJustifyContent, setFlexOrder, setFlexShrink, setFlexWrap, setFloat, setFocus, setFontSize, setFontSize, setFontWeight, setGrid, setGwtDisplay, setHideOn, setHoverable, setId, setInitialClasses, setLayoutPosition, setLeft, setLineHeight, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOffset, setOpacity, setOrientation, setOverflow, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPerspective, setPerspectiveOrigin, setRight, setScrollspy, setSeparator, setShadow, setShowOn, setStyle, setTabIndex, setTextAlign, setTextColor, setTooltip, setTooltipDelayMs, setTooltipHTML, setTooltipPosition, setTop, setTransform, setTransformOrigin, setTransformStyle, setTransition, setTruncate, setVerticalAlign, setVisibility, setWaves, stopTouchStartEvent, window
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, iterator, remove, remove
add, adopt, doAttachChildren, doDetachChildren, orphan, remove
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected gwt.material.design.client.base.MaterialWidget listbox
public MaterialComboBox()
protected void onLoad()
onLoad
in class gwt.material.design.client.base.MaterialWidget
public void load()
load
in interface gwt.material.design.client.base.JsLoader
protected void onUnload()
onUnload
in class gwt.material.design.client.base.MaterialWidget
public void unload()
unload
in interface gwt.material.design.client.base.JsLoader
public void reload()
reload
in interface gwt.material.design.client.base.HasReload
public void add(com.google.gwt.user.client.ui.Widget child)
add
in interface com.google.gwt.user.client.ui.HasWidgets
add
in class gwt.material.design.client.base.MaterialWidget
public void addGroup(gwt.material.design.client.ui.html.OptGroup group)
group
- - Option Group componentpublic void addItem(String text, T value, gwt.material.design.client.ui.html.OptGroup optGroup)
text
- - The text you want to labeled on the option itemvalue
- - The value you want to pass through in this optionoptGroup
- - Add directly this option into the existing grouppublic gwt.material.design.client.ui.html.Option addItem(String text, T value)
text
- - The text you want to labeled on the option itemvalue
- - The value you want to pass through in this optionpublic void setItems(Collection<T> items)
public void addItems(Collection<T> items)
protected gwt.material.design.client.ui.html.Option buildOption(String text, T value)
public void open()
public void close()
public void clear()
clear
in interface com.google.gwt.user.client.ui.HasWidgets
clear
in class com.google.gwt.user.client.ui.Panel
public void setDropdownParent(String dropdownParent)
public gwt.material.design.jquery.client.api.JQueryElement getDropdownParent()
public gwt.material.design.jquery.client.api.JQueryElement getDropdownResultElement()
public gwt.material.design.jquery.client.api.JQueryElement getDropdownContainerElement()
public String getPlaceholder()
getPlaceholder
in interface gwt.material.design.client.base.HasPlaceholder
public void setPlaceholder(String placeholder)
setPlaceholder
in interface gwt.material.design.client.base.HasPlaceholder
public boolean isAllowClear()
public void setAllowClear(boolean allowClear)
public int getLimit()
public void setLimit(int limit)
public boolean isHideSearch()
public void setHideSearch(boolean hideSearch)
public boolean isMultiple()
public void setMultiple(boolean multiple)
public void setAcceptableValues(Collection<T> values)
public List<T> getSelectedValue()
null
if none is selectedpublic T getSingleValue()
public void setSingleValue(T value)
public void setSingleValue(T value, boolean fireEvents)
public void setValues(List<T> values)
public void setValues(List<T> values, boolean fireEvents)
public int getValueIndex(T value)
value
- - The Object you want to pass as value on comboboxpublic void setSelectedIndex(int selectedIndex)
After calling this method, only the specified item in the list will remain selected. For a ListBox with multiple selection enabled.
selectedIndex
- - the index of the item to be selectedpublic int getSelectedIndex()
null
if none is selectedpublic List<T> getSelectedValues()
protected List<String> getValuesKeyIndex()
public void setKeyFactory(gwt.material.design.client.base.KeyFactory<T,String> keyFactory)
public void setReadOnly(boolean value)
setReadOnly
in interface gwt.material.design.client.base.HasReadOnly
public boolean isReadOnly()
isReadOnly
in interface gwt.material.design.client.base.HasReadOnly
public void setToggleReadOnly(boolean toggle)
setToggleReadOnly
in interface gwt.material.design.client.base.HasReadOnly
public boolean isToggleReadOnly()
isToggleReadOnly
in interface gwt.material.design.client.base.HasReadOnly
public boolean isCloseOnSelect()
public void setCloseOnSelect(boolean closeOnSelect)
public gwt.material.design.client.base.MaterialWidget getListbox()
public gwt.material.design.client.ui.html.Label getLabel()
public gwt.material.design.client.ui.MaterialLabel getErrorLabel()
public boolean isTags()
public void setTags(boolean tags)
public void setLanguage(LanguageOptions language)
public LanguageOptions getLanguage()
public void scrollTop(int offset)
public void setEnabled(boolean enabled)
setEnabled
in interface com.google.gwt.user.client.ui.HasEnabled
setEnabled
in class gwt.material.design.client.base.MaterialWidget
public com.google.gwt.event.shared.HandlerRegistration addSelectionHandler(SelectItemEvent.SelectComboHandler<T> selectionHandler)
public com.google.gwt.event.shared.HandlerRegistration addOpenHandler(com.google.gwt.event.logical.shared.OpenHandler<T> openHandler)
addOpenHandler
in interface com.google.gwt.event.logical.shared.HasOpenHandlers<T>
public com.google.gwt.event.shared.HandlerRegistration addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<T> closeHandler)
addCloseHandler
in interface com.google.gwt.event.logical.shared.HasCloseHandlers<T>
public com.google.gwt.event.shared.HandlerRegistration addRemoveItemHandler(UnselectItemEvent.UnselectComboHandler<T> handler)
addRemoveItemHandler
in interface HasUnselectItemHandler<T>
protected gwt.material.design.client.base.mixin.EnabledMixin<gwt.material.design.client.base.MaterialWidget> getEnabledMixin()
getEnabledMixin
in class gwt.material.design.client.base.MaterialWidget
public gwt.material.design.client.base.mixin.ErrorMixin<gwt.material.design.client.base.AbstractValueWidget,gwt.material.design.client.ui.MaterialLabel> getErrorMixin()
public gwt.material.design.client.base.mixin.ReadOnlyMixin<MaterialComboBox,gwt.material.design.client.base.MaterialWidget> getReadOnlyMixin()
Copyright © 2018. All rights reserved.