Package 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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.vaadin.client.ui.AbstractComponentConnector
SIGNIFICANT_MOVE_THRESHOLD
-
-
Constructor Summary
Constructors Constructor Description ComboBoxConnector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearNewItemHandlingIfMatch(String value)Clears the new item handling variables if the given value matches the pending value.ComboBoxStategetState()Returns the shared state object for this connector.VComboBoxgetWidget()Returns the widget associated with this paintable.protected voidinit()Called when the connector has been initialized.booleanisRequiredIndicatorVisible()Checks if a required indicator should be shown for the given connector.voidlayout()voidonStateChanged(StateChangeEvent stateChangeEvent)Notifies the event handler that the state has changed.voidonUnregister()Event called when connector has been unregistered.voidrequestPage(int page, String filter)Send a message to the server to request a page of items with the current filter.voidsendBlurEvent()Notify the server that the combo box lost focus.voidsendFocusEvent()Notify the server that the combo box received focus.voidsendNewItem(String itemValue)Send a message about a newly created item to the server.voidsendSelection(String selectionKey)Send a message to the server updating the current selection.voidsetDataSource(DataSource<elemental.json.JsonObject> dataSource)Sets the data source for this Connector.protected voidsetFilter(String filter)Send a message to the server set the current filter.voidsetWidgetEnabled(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:AbstractConnectorCalled when the connector has been initialized. Override this method to perform initialization of the connector.- Overrides:
initin classAbstractConnector
-
onStateChanged
public void onStateChanged(StateChangeEvent stateChangeEvent)
Description copied from interface:StateChangeEvent.StateChangeHandlerNotifies the event handler that the state has changed.- Specified by:
onStateChangedin interfaceStateChangeEvent.StateChangeHandler- Overrides:
onStateChangedin classAbstractComponentConnector- Parameters:
stateChangeEvent- the state change event with details about the change
-
getWidget
public VComboBox getWidget()
Description copied from class:AbstractComponentConnectorReturns the widget associated with this paintable. The widget returned by this method must not changed during the life time of the paintable.- Specified by:
getWidgetin interfaceHasWidget- Overrides:
getWidgetin classAbstractComponentConnector- Returns:
- The widget associated with this paintable
-
getState
public ComboBoxState getState()
Description copied from class:AbstractConnectorReturns the shared state object for this connector. Override this method to define the shared state type for your connector.- Specified by:
getStatein interfaceComponentConnector- Specified by:
getStatein interfaceServerConnector- Overrides:
getStatein classAbstractListingConnector- Returns:
- the current shared state (never null)
-
layout
public void layout()
- Specified by:
layoutin interfaceSimpleManagedLayout
-
setWidgetEnabled
public void setWidgetEnabled(boolean widgetEnabled)
Description copied from interface:ComponentConnectorSets the enabled state of the widget associated to this connector.- Specified by:
setWidgetEnabledin interfaceComponentConnector- Overrides:
setWidgetEnabledin 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 item- Since:
- 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 string- Since:
- 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 key- Since:
- 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:HasDataSourceSets the data source for this Connector.- Specified by:
setDataSourcein interfaceHasDataSource- Overrides:
setDataSourcein classAbstractListingConnector- Parameters:
dataSource- the new data source, not null
-
onUnregister
public void onUnregister()
Description copied from interface:ServerConnectorEvent called when connector has been unregistered.- Specified by:
onUnregisterin interfaceServerConnector- Overrides:
onUnregisterin classAbstractComponentConnector
-
isRequiredIndicatorVisible
public boolean isRequiredIndicatorVisible()
Description copied from interface:HasRequiredIndicatorChecks if a required indicator should be shown for the given connector.- Specified by:
isRequiredIndicatorVisiblein interfaceHasRequiredIndicator- Overrides:
isRequiredIndicatorVisiblein classAbstractFieldConnector- Returns:
trueto show an indicator,falseotherwise
-
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
-
-