com.vaadin.client.ui.customfield
Class CustomFieldConnector

java.lang.Object
  extended by com.vaadin.client.ui.AbstractConnector
      extended by com.vaadin.client.ui.AbstractComponentConnector
          extended by com.vaadin.client.ui.AbstractFieldConnector
              extended by com.vaadin.client.ui.customfield.CustomFieldConnector
All Implemented Interfaces:
com.google.gwt.event.shared.EventHandler, StateChangeEvent.StateChangeHandler, ComponentConnector, ConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandler, HasComponentsConnector, ServerConnector, com.vaadin.shared.Connector, java.io.Serializable

public class CustomFieldConnector
extends AbstractFieldConnector
implements HasComponentsConnector, ConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandler

See Also:
Serialized Form

Constructor Summary
CustomFieldConnector()
          Default constructor
 
Method Summary
 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.
 java.util.List<ComponentConnector> getChildComponents()
          Returns the children for this connector.
protected  ComponentConnector getContent()
          Returns the content (only/first child) of the container.
protected  Widget getContentWidget()
          Returns the widget (if any) of the content of the container.
 VCustomComponent getWidget()
          Returns the widget associated with this paintable.
 void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event)
           
 void setChildComponents(java.util.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, onStateChanged, onUnregister, setWidgetEnabled, setWidgetStyleName, setWidgetStyleNameWithPrefix, 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.client.ServerConnector
addStateChangeHandler, addStateChangeHandler, doInit, fireEvent, getChildren, getConnection, getParent, getRpcImplementations, getState, hasEventListener, isEnabled, onUnregister, removeStateChangeHandler, removeStateChangeHandler, setChildren, setParent, updateEnabledState
 
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
 

Constructor Detail

CustomFieldConnector

public CustomFieldConnector()
Default constructor

Method Detail

getWidget

public VCustomComponent 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 interface ComponentConnector
Overrides:
getWidget in class AbstractComponentConnector
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 interface HasComponentsConnector
Parameters:
connector - Child component for which service is requested.

onConnectorHierarchyChange

public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event)
Specified by:
onConnectorHierarchyChange in interface ConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandler

getChildComponents

public java.util.List<ComponentConnector> getChildComponents()
Description copied from interface: HasComponentsConnector
Returns the children for this connector.

The children for this connector are defined as all HasComponentss whose parent is this HasComponentsConnector.

Specified by:
getChildComponents in interface HasComponentsConnector
Returns:
A collection of children for this connector. An empty collection if there are no children. Never returns null.

setChildComponents

public void setChildComponents(java.util.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.

Specified by:
setChildComponents in interface HasComponentsConnector
Parameters:
childComponents - The new child connectors

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 interface HasComponentsConnector
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 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


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.