Package com.vaadin.client.ui
Class VNativeSelect
- 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.widgets.FocusableFlowPanelComposite
-
- com.vaadin.client.ui.VNativeSelect
-
- All Implemented Interfaces:
com.google.gwt.event.dom.client.HasAllFocusHandlers,com.google.gwt.event.dom.client.HasBlurHandlers,com.google.gwt.event.dom.client.HasFocusHandlers,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.HasVisibility,com.google.gwt.user.client.ui.IsRenderable,com.google.gwt.user.client.ui.IsWidget,Focusable,HandlesAriaCaption
public class VNativeSelect extends FocusableFlowPanelComposite implements HandlesAriaCaption
The client-side widget for theNativeSelectcomponent.- Author:
- Vaadin Ltd.
-
-
Constructor Summary
Constructors Constructor Description VNativeSelect()Creates a newVNativeSelectinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.com.google.gwt.user.client.ui.ListBoxgetListBox()Gets the underlying ListBox widget that this widget wraps.intgetVisibleItemCount()Gets the number of items that are visible.booleanisEmptySelectionAllowed()Returns true if empty selection is allowed.voidsetEmptySelectionAllowed(boolean emptySelectionAllowed)Sets true if empty selection is allowed.voidsetHeight(String height)voidsetSelectedItem(String value)Sets the selected item by its value.voidsetStylePrimaryName(String style)voidsetTabIndex(int tabIndex)Sets the tab index.voidsetVisibleItemCount(int visibleItemCount)Sets the number of items that are visible.voidsetWidth(String width)-
Methods inherited from class com.vaadin.client.widgets.FocusableFlowPanelComposite
addBlurHandler, addFocusHandler, focus, getWidget
-
Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, 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
-
setSelectedItem
public void setSelectedItem(String value)
Sets the selected item by its value. If givennull, removes selection.- Parameters:
value- the value of the item to select ornullto select nothing
-
setTabIndex
public void setTabIndex(int tabIndex)
Sets the tab index.- Parameters:
tabIndex- the tab index to set
-
getListBox
public com.google.gwt.user.client.ui.ListBox getListBox()
Gets the underlying ListBox widget that this widget wraps.- Returns:
- the ListBox this widget wraps
-
setWidth
public void setWidth(String width)
- Overrides:
setWidthin classcom.google.gwt.user.client.ui.UIObject
-
setHeight
public void setHeight(String height)
- Overrides:
setHeightin classcom.google.gwt.user.client.ui.UIObject
-
setVisibleItemCount
public void setVisibleItemCount(int visibleItemCount)
Sets the number of items that are visible. If only one item is visible, then the box will be displayed as a drop-down list (the default).- Parameters:
visibleItemCount- the visible item count- Since:
- 8.1
-
getVisibleItemCount
public int getVisibleItemCount()
Gets the number of items that are visible. If only one item is visible, then the box will be displayed as a drop-down list.- Returns:
- the visible item count
- Since:
- 8.1
-
isEmptySelectionAllowed
public boolean isEmptySelectionAllowed()
Returns true if empty selection is allowed.- Returns:
- empty selection is allowed
- Since:
- 8.7
-
setEmptySelectionAllowed
public void setEmptySelectionAllowed(boolean emptySelectionAllowed)
Sets true if empty selection is allowed.- Parameters:
emptySelectionAllowed-- Since:
- 8.7
-
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
-
-