com.vaadin.client.ui.combobox.
Class ComboBoxConnector
- java.lang.Object
-
- com.vaadin.client.ui.AbstractConnector
-
- com.vaadin.client.ui.AbstractComponentConnector
-
- com.vaadin.client.ui.AbstractFieldConnector
-
- com.vaadin.client.connectors.AbstractListingConnector
-
- com.vaadin.client.ui.combobox.ComboBoxConnector
-
All Implemented Interfaces:
com.google.gwt.event.shared.EventHandler
,StateChangeEvent.StateChangeHandler
,ComponentConnector
,HasDataSource
,HasWidget
,ServerConnector
,HasErrorIndicator
,HasRequiredIndicator
,ManagedLayout
,SimpleManagedLayout
,Connector
,Serializable
public class ComboBoxConnector extends AbstractListingConnector implements SimpleManagedLayout
A connector class for the ComboBox component.
Author:
Vaadin Ltd
See Also:
-
-
Field Summary
-
Fields inherited from class com.vaadin.client.ui.AbstractComponentConnector
SIGNIFICANT_MOVE_THRESHOLD
-
-
Constructor Summary
Constructors Constructor Description ComboBoxConnector()
-
Method Summary
All Methods Modifier and Type Method Description void
clearNewItemHandlingIfMatch(String value)
Clears the new item handling variables if the given value matches the pending value.
ComboBoxState
getState()
Returns the shared state object for this connector.
VComboBox
getWidget()
Returns the widget associated with this paintable.
protected void
init()
Called when the connector has been initialized.
boolean
isRequiredIndicatorVisible()
Checks if a required indicator should be shown for the given connector.
void
layout()
void
onStateChanged(StateChangeEvent stateChangeEvent)
Notifies the event handler that the state has changed.
void
onUnregister()
Event called when connector has been unregistered.
void
requestPage(int page, String filter)
Send a message to the server to request a page of items with the current filter.
void
sendBlurEvent()
Notify the server that the combo box lost focus.
void
sendFocusEvent()
Notify the server that the combo box received focus.
void
sendNewItem(String itemValue)
Send a message about a newly created item to the server.
void
sendSelection(String selectionKey)
Send a message to the server updating the current selection.
void
setDataSource(DataSource<elemental.json.JsonObject> dataSource)
Sets the data source for this Connector.
protected void
setFilter(String filter)
Send a message to the server set the current filter.
void
setWidgetEnabled(boolean widgetEnabled)
Sets the enabled state of the widget associated to this connector.
-
Methods inherited from class com.vaadin.client.connectors.AbstractListingConnector
getDataSource, getRowData, getRowKey, isRowSelected
-
Methods inherited from class com.vaadin.client.ui.AbstractFieldConnector
isReadOnly, updateWidgetStyleNames
-
Methods inherited from class com.vaadin.client.ui.AbstractComponentConnector
createWidget, delegateCaptionHandling, flush, getIcon, getIconUri, getLayoutManager, getTooltipInfo, hasTooltip, isErrorIndicatorVisible, isRealUpdate, isRelativeHeight, isRelativeWidth, isUndefinedHeight, isUndefinedWidth, onDragSourceAttached, onDragSourceDetached, onDropTargetAttached, onDropTargetDetached, registerTouchHandlers, sendContextClickEvent, setWidgetStyleName, setWidgetStyleNameWithPrefix, shouldHandleLongTap, unregisterTouchHandlers, updateComponentSize, updateComponentSize, updateEnabledState, updateWidgetSize
-
Methods inherited from class com.vaadin.client.ui.AbstractConnector
addStateChangeHandler, addStateChangeHandler, createState, doInit, ensureHandlerManager, fireEvent, forceStateChange, getChildren, getConnection, getConnectorId, getParent, getResourceUrl, getRpcImplementations, getRpcProxy, getStateType, getTag, hasEventListener, isEnabled, registerRpc, removeStateChangeHandler, removeStateChangeHandler, setChildren, setParent, setTag, unregisterRpc
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.client.ComponentConnector
delegateCaptionHandling, flush, getLayoutManager, getTooltipInfo, hasTooltip, isRelativeHeight, isRelativeWidth, isUndefinedHeight, isUndefinedWidth
-
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
-
Methods inherited from interface com.vaadin.client.ServerConnector
addStateChangeHandler, addStateChangeHandler, doInit, fireEvent, getChildren, getConnection, getParent, getRpcImplementations, getTag, hasEventListener, isEnabled, removeStateChangeHandler, removeStateChangeHandler, setChildren, setParent, setTag, updateEnabledState
-
-
-
-
Method Detail
-
init
protected void init()
Description copied from class:
AbstractConnector
Called when the connector has been initialized. Override this method to perform initialization of the connector.
Overrides:
init
in classAbstractConnector
-
onStateChanged
public void onStateChanged(StateChangeEvent stateChangeEvent)
Description copied from interface:
StateChangeEvent.StateChangeHandler
Notifies the event handler that the state has changed.
Specified by:
onStateChanged
in interfaceStateChangeEvent.StateChangeHandler
Overrides:
onStateChanged
in classAbstractComponentConnector
Parameters:
stateChangeEvent
- the state change event with details about the change
-
getWidget
public VComboBox getWidget()
Description copied from class:
AbstractComponentConnector
Returns the widget associated with this paintable. The widget returned by this method must not changed during the life time of the paintable.
Specified by:
getWidget
in interfaceHasWidget
Overrides:
getWidget
in classAbstractComponentConnector
Returns:
The widget associated with this paintable
-
getState
public ComboBoxState getState()
Description copied from class:
AbstractConnector
Returns the shared state object for this connector. Override this method to define the shared state type for your connector.
Specified by:
getState
in interfaceComponentConnector
Specified by:
getState
in interfaceServerConnector
Overrides:
getState
in classAbstractListingConnector
Returns:
the current shared state (never null)
-
layout
public void layout()
Specified by:
layout
in interfaceSimpleManagedLayout
-
setWidgetEnabled
public void setWidgetEnabled(boolean widgetEnabled)
Description copied from interface:
ComponentConnector
Sets the enabled state of the widget associated to this connector.
Specified by:
setWidgetEnabled
in interfaceComponentConnector
Overrides:
setWidgetEnabled
in classAbstractComponentConnector
Parameters:
widgetEnabled
- true if the widget should be enabled, false otherwise
-
sendNewItem
public void sendNewItem(String itemValue)
Send a message about a newly created item to the server. This method is for internal use only and may be removed in future versions.
Parameters:
itemValue
- user entered string value for the new itemSince:
8.0
-
setFilter
protected void setFilter(String filter)
Send a message to the server set the current filter. This method is for internal use only and may be removed in future versions.
Parameters:
filter
- the current filter stringSince:
8.0
-
requestPage
public void requestPage(int page, String filter)
Send a message to the server to request a page of items with the current filter. This method is for internal use only and may be removed in future versions.
Parameters:
page
- the page number to get or -1 to let the server/connector decide based on current selection (possibly loading more data from the server)filter
- the filter to apply, nevernull
Since:
8.0
-
sendSelection
public void sendSelection(String selectionKey)
Send a message to the server updating the current selection. This method is for internal use only and may be removed in future versions.
Parameters:
selectionKey
- the current selected item keySince:
8.0
-
sendFocusEvent
public void sendFocusEvent()
Notify the server that the combo box received focus. For timing reasons, ConnectorFocusAndBlurHandler is not used at the moment. This method is for internal use only and may be removed in future versions.
Since:
8.0
-
sendBlurEvent
public void sendBlurEvent()
Notify the server that the combo box lost focus. For timing reasons, ConnectorFocusAndBlurHandler is not used at the moment. This method is for internal use only and may be removed in future versions.
Since:
8.0
-
setDataSource
public void setDataSource(DataSource<elemental.json.JsonObject> dataSource)
Description copied from interface:
HasDataSource
Sets the data source for this Connector.
Specified by:
setDataSource
in interfaceHasDataSource
Overrides:
setDataSource
in classAbstractListingConnector
Parameters:
dataSource
- the new data source, not null
-
onUnregister
public void onUnregister()
Description copied from interface:
ServerConnector
Event called when connector has been unregistered.
Specified by:
onUnregister
in interfaceServerConnector
Overrides:
onUnregister
in classAbstractComponentConnector
-
isRequiredIndicatorVisible
public boolean isRequiredIndicatorVisible()
Description copied from interface:
HasRequiredIndicator
Checks if a required indicator should be shown for the given connector.
Specified by:
isRequiredIndicatorVisible
in interfaceHasRequiredIndicator
Overrides:
isRequiredIndicatorVisible
in classAbstractFieldConnector
Returns:
true
to show an indicator,false
otherwise
-
clearNewItemHandlingIfMatch
public void clearNewItemHandlingIfMatch(String value)
Clears the new item handling variables if the given value matches the pending value. This method is for internal use only and may be removed in future versions.
Parameters:
value
- already handled value
-
-