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
,Field
public class VListSelect extends com.google.gwt.user.client.ui.Composite implements Field, Focusable, com.google.gwt.user.client.ui.HasEnabled, AbstractMultiSelectConnector.MultiSelectWidget
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 Modifier and Type Method Description Registration
addSelectionChangeListener(BiConsumer<Set<String>,Set<String>> listener)
Adds a selection change listener the select.
void
focus()
Sets focus to this widget.
int
getRows()
Returns the number of visible items for the list select.
protected FastStringSet
getSelectedItems()
Gets the currently selected item values.
int
getTabIndex()
Gets the tab index.
boolean
isEnabled()
boolean
isReadOnly()
Returns
true
if this select is in read only mode,false
if not.void
setEnabled(boolean enabled)
void
setHeight(String height)
void
setItems(List<elemental.json.JsonObject> items)
Sets the given items to the select.
void
setReadOnly(boolean readOnly)
Sets this select as read only, meaning selection cannot be changed.
void
setRows(int rows)
Sets the number of visible items for the list select.
void
setStylePrimaryName(String style)
void
setTabIndex(int tabIndex)
Sets the tab index.
void
setWidth(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:
setStylePrimaryName
in 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 showSee 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.MultiSelectWidget
Adds a selection change listener the select.
Specified by:
addSelectionChangeListener
in 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.MultiSelectWidget
Sets the given items to the select.
Specified by:
setItems
in 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:
setHeight
in classcom.google.gwt.user.client.ui.UIObject
-
setWidth
public void setWidth(String width)
Overrides:
setWidth
in 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
-true
for read only,false
for not read only
-
isReadOnly
public boolean isReadOnly()
Returns
true
if this select is in read only mode,false
if not.Returns:
true
for read only,false
for not read only
-
setEnabled
public void setEnabled(boolean enabled)
Specified by:
setEnabled
in interfacecom.google.gwt.user.client.ui.HasEnabled
-
isEnabled
public boolean isEnabled()
Specified by:
isEnabled
in interfacecom.google.gwt.user.client.ui.HasEnabled
-
-