Class CustomFieldConnector
- java.lang.Object
-
- com.vaadin.client.ui.AbstractConnector
-
- com.vaadin.client.ui.AbstractComponentConnector
-
- com.vaadin.client.ui.AbstractFieldConnector
-
- com.vaadin.client.ui.customfield.CustomFieldConnector
-
- All Implemented Interfaces:
com.google.gwt.event.shared.EventHandler
,StateChangeEvent.StateChangeHandler
,ComponentConnector
,ConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandler
,HasComponentsConnector
,ServerConnector
,Connector
,Serializable
public class CustomFieldConnector extends AbstractFieldConnector implements HasComponentsConnector, ConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandler
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.vaadin.client.ui.AbstractComponentConnector
SIGNIFICANT_MOVE_THRESHOLD
-
-
Constructor Summary
Constructors Constructor Description CustomFieldConnector()
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.gwt.event.shared.HandlerRegistration
addConnectorHierarchyChangeHandler(ConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandler handler)
Adds a handler that is called whenever the child hierarchy of this connector has been updated by the server.List<ComponentConnector>
getChildComponents()
Returns the child components for this connector.protected ComponentConnector
getContent()
Returns the content (only/first child) of the container.protected com.google.gwt.user.client.ui.Widget
getContentWidget()
Returns the widget (if any) of the content of the container.VCustomField
getWidget()
Returns the widget associated with this paintable.void
onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event)
Called by the framework when the list of child components of the connector implementing this interface has changed.void
onStateChanged(StateChangeEvent stateChangeEvent)
Notifies the event handler that the state has changed.void
setChildComponents(List<ComponentConnector> childComponents)
Sets the children for this connector.void
updateCaption(ComponentConnector connector)
Update child components caption, description and error message.-
Methods inherited from class com.vaadin.client.ui.AbstractFieldConnector
getState, isModified, isReadOnly, isRequired, updateWidgetStyleNames
-
Methods inherited from class com.vaadin.client.ui.AbstractComponentConnector
createWidget, delegateCaptionHandling, flush, getIcon, getIconUri, getLayoutManager, getTooltipInfo, hasTooltip, isRealUpdate, isRelativeHeight, isRelativeWidth, isUndefinedHeight, isUndefinedWidth, onUnregister, registerTouchHandlers, sendContextClickEvent, setWidgetEnabled, 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, hasEventListener, init, isEnabled, registerRpc, removeStateChangeHandler, removeStateChangeHandler, setChildren, setParent, 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.shared.Connector
getConnectorId
-
Methods inherited from interface com.vaadin.client.ServerConnector
addStateChangeHandler, addStateChangeHandler, doInit, fireEvent, getChildren, getConnection, getParent, getRpcImplementations, hasEventListener, isEnabled, onUnregister, removeStateChangeHandler, removeStateChangeHandler, setChildren, setParent, updateEnabledState
-
-
-
-
Method Detail
-
getWidget
public VCustomField 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 interfaceComponentConnector
- Overrides:
getWidget
in classAbstractComponentConnector
- Returns:
- The widget associated with this paintable
-
updateCaption
public void updateCaption(ComponentConnector connector)
Description copied from interface:HasComponentsConnector
Update child components caption, description and error message.Each component is responsible for maintaining its caption, description and error message. In most cases components doesn't want to do that and those elements reside outside of the component. Because of this layouts must provide service for it's childen to show those elements for them.
- Specified by:
updateCaption
in interfaceHasComponentsConnector
- Parameters:
connector
- Child component for which service is requested.
-
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
-
onConnectorHierarchyChange
public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event)
Description copied from interface:ConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandler
Called by the framework when the list of child components of the connector implementing this interface has changed. The implementation is responsible for attaching the widgets of any new children and detaching the widgets of any removed children. Implementations should typically also make sure that the child widgets are attached according to the ordering of the child components.This method is called after the shared state and hierarchy data (i.e.
AbstractHasComponentsConnector.setChildComponents(List)
) been updated for all affected connectors, but before updating captions, firing state change events, invoking updateFromUIDL for legacy connectors, invoking RPC and starting the layout phase.Please note that hierarchy change events are fired in a non-deterministic order when a message from the server causes multiple parts of the hierarchy to change. This means that the old parent connector might not yet have detached a child widget and that the widget of a removed child might already have been attached by its new parent.
- Specified by:
onConnectorHierarchyChange
in interfaceConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandler
- Parameters:
event
- the event with information about the hierarchy change
-
getChildComponents
public List<ComponentConnector> getChildComponents()
Description copied from interface:HasComponentsConnector
Returns the child components for this connector.The children for this connector are defined as all
HasComponents
s whose parent is thisHasComponentsConnector
.Note that the method
ServerConnector.getChildren()
can return a larger list of children including both the child components and any extensions registered for the connector.- Specified by:
getChildComponents
in interfaceHasComponentsConnector
- Returns:
- A collection of child components for this connector. An empty collection if there are no children. Never returns null.
-
setChildComponents
public void setChildComponents(List<ComponentConnector> childComponents)
Description copied from interface:HasComponentsConnector
Sets the children for this connector. This method should only be called by the framework to ensure that the connector hierarchy on the client side and the server side are in sync.Note that calling this method does not call
ConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandler.onConnectorHierarchyChange(ConnectorHierarchyChangeEvent)
. The event method is called only when the hierarchy has been updated for all connectors.Note that this method is separate from
ServerConnector.setChildren(List)
and contains only child components. Both methods are called separately by the framework if the connector implementsHasComponentsConnector
.- Specified by:
setChildComponents
in interfaceHasComponentsConnector
- Parameters:
childComponents
- The new child connectors (components only)
-
addConnectorHierarchyChangeHandler
public com.google.gwt.event.shared.HandlerRegistration addConnectorHierarchyChangeHandler(ConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandler handler)
Description copied from interface:HasComponentsConnector
Adds a handler that is called whenever the child hierarchy of this connector has been updated by the server.- Specified by:
addConnectorHierarchyChangeHandler
in interfaceHasComponentsConnector
- Parameters:
handler
- The handler that should be added.- Returns:
- A handler registration reference that can be used to unregister the handler
-
getContent
protected ComponentConnector getContent()
Returns the content (only/first child) of the container.- Returns:
- child connector or null if none (e.g. invisible or not set on server)
-
getContentWidget
protected com.google.gwt.user.client.ui.Widget getContentWidget()
Returns the widget (if any) of the content of the container.- Returns:
- widget of the only/first connector of the container, null if no content or if there is no widget for the connector
-
-