Package com.vaadin.client.ui
Class VListSelect
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Composite
-
- com.vaadin.client.ui.VListSelect
-
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers,com.google.gwt.event.shared.HasHandlers,com.google.gwt.user.client.EventListener,com.google.gwt.user.client.ui.HasEnabled,com.google.gwt.user.client.ui.HasVisibility,com.google.gwt.user.client.ui.IsRenderable,com.google.gwt.user.client.ui.IsWidget,AbstractMultiSelectConnector.MultiSelectWidget,Focusable,HandlesAriaCaption,HandlesAriaInvalid,HandlesAriaRequired,Field
public class VListSelect extends com.google.gwt.user.client.ui.Composite implements Field, Focusable, com.google.gwt.user.client.ui.HasEnabled, AbstractMultiSelectConnector.MultiSelectWidget, HandlesAriaCaption, HandlesAriaInvalid, HandlesAriaRequired
A simple list select for selecting multiple items.- Author:
- Vaadin Ltd
-
-
Constructor Summary
Constructors Constructor Description VListSelect()Constructs a simple ListSelect widget in multiselect mode.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RegistrationaddSelectionChangeListener(BiConsumer<Set<String>,Set<String>> listener)Adds a selection change listener the select.voidbindAriaCaption(com.google.gwt.user.client.Element captionElement)Called to bind the provided caption (label in HTML speak) element to the main input element of the Widget.voidfocus()Sets focus to this widget.intgetRows()Returns the number of visible items for the list select.protected FastStringSetgetSelectedItems()Gets the currently selected item values.intgetTabIndex()Gets the tab index.booleanisEnabled()booleanisReadOnly()Returnstrueif this select is in read only mode,falseif not.voidsetAriaInvalid(boolean invalid)Called to set the element, typically an input element, as invalid.voidsetAriaRequired(boolean required)Called to set the element, typically an input element, as required.voidsetEnabled(boolean enabled)voidsetHeight(String height)voidsetItems(List<elemental.json.JsonObject> items)Sets the given items to the select.voidsetReadOnly(boolean readOnly)Sets this select as read only, meaning selection cannot be changed.voidsetRows(int rows)Sets the number of visible items for the list select.voidsetStylePrimaryName(String style)voidsetTabIndex(int tabIndex)Sets the tab index.voidsetWidth(String width)-
Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, setVisible, sinkBitlessEvent, toString
-
-
-
-
Method Detail
-
setStylePrimaryName
public void setStylePrimaryName(String style)
- Overrides:
setStylePrimaryNamein classcom.google.gwt.user.client.ui.UIObject
-
setRows
public void setRows(int rows)
Sets the number of visible items for the list select.- Parameters:
rows- the number of items to show- See Also:
ListBox.setVisibleItemCount(int)
-
getRows
public int getRows()
Returns the number of visible items for the list select.- Returns:
- the number of items to show
- See Also:
ListBox.setVisibleItemCount(int)
-
addSelectionChangeListener
public Registration addSelectionChangeListener(BiConsumer<Set<String>,Set<String>> listener)
Description copied from interface:AbstractMultiSelectConnector.MultiSelectWidgetAdds a selection change listener the select.- Specified by:
addSelectionChangeListenerin interfaceAbstractMultiSelectConnector.MultiSelectWidget- Parameters:
listener- the listener to add, notnull- Returns:
- a registration handle to remove the listener
-
setItems
public void setItems(List<elemental.json.JsonObject> items)
Description copied from interface:AbstractMultiSelectConnector.MultiSelectWidgetSets the given items to the select.- Specified by:
setItemsin interfaceAbstractMultiSelectConnector.MultiSelectWidget- Parameters:
items- the items for the select
-
getSelectedItems
protected FastStringSet getSelectedItems()
Gets the currently selected item values.- Returns:
- the currently selected item keys
-
setHeight
public void setHeight(String height)
- Overrides:
setHeightin classcom.google.gwt.user.client.ui.UIObject
-
setWidth
public void setWidth(String width)
- Overrides:
setWidthin classcom.google.gwt.user.client.ui.UIObject
-
setTabIndex
public void setTabIndex(int tabIndex)
Sets the tab index.- Parameters:
tabIndex- the tab index to set
-
getTabIndex
public int getTabIndex()
Gets the tab index.- Returns:
- the tab index
-
setReadOnly
public void setReadOnly(boolean readOnly)
Sets this select as read only, meaning selection cannot be changed.- Parameters:
readOnly-truefor read only,falsefor not read only
-
isReadOnly
public boolean isReadOnly()
Returnstrueif this select is in read only mode,falseif not.- Returns:
truefor read only,falsefor not read only
-
setEnabled
public void setEnabled(boolean enabled)
- Specified by:
setEnabledin interfacecom.google.gwt.user.client.ui.HasEnabled
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabledin interfacecom.google.gwt.user.client.ui.HasEnabled
-
focus
public void focus()
Description copied from interface:FocusableSets focus to this widget.
-
bindAriaCaption
public void bindAriaCaption(com.google.gwt.user.client.Element captionElement)
Description copied from interface:HandlesAriaCaptionCalled to bind the provided caption (label in HTML speak) element to the main input element of the Widget. Binding should be removed from the main input field when captionElement is null.- Specified by:
bindAriaCaptionin interfaceHandlesAriaCaption- Parameters:
captionElement- Element of the caption
-
setAriaRequired
public void setAriaRequired(boolean required)
Description copied from interface:HandlesAriaRequiredCalled to set the element, typically an input element, as required.- Specified by:
setAriaRequiredin interfaceHandlesAriaRequired- Parameters:
required- boolean true when the element needs to be set as required
-
setAriaInvalid
public void setAriaInvalid(boolean invalid)
Description copied from interface:HandlesAriaInvalidCalled to set the element, typically an input element, as invalid.- Specified by:
setAriaInvalidin interfaceHandlesAriaInvalid- Parameters:
invalid- boolean, true when the element should be marked invalid, false otherwise
-
-