com.vaadin.client.ui.ui
Class UIConnector

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

public class UIConnector
extends AbstractSingleComponentContainerConnector
implements Paintable, MayScrollChildren

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.vaadin.client.ui.AbstractComponentConnector
SIGNIFICANT_MOVE_THRESHOLD
 
Constructor Summary
UIConnector()
           
 
Method Summary
protected  void activateTheme(java.lang.String newTheme)
          Activates the new theme.
 void analyzeLayouts()
          Invokes the layout analyzer on the server
protected static void forceStateChangeRecursively(AbstractConnector connector)
          Force a full recursive recheck of every connector's state variables.
 java.lang.String getActiveTheme()
          Returns the name of the theme currently in used by the UI
protected  ComponentConnector getContent()
          Returns the content (only/first child) of the container.
 com.vaadin.shared.ui.ui.PageState getPageState()
          Returns the state of the Page associated with the UI.
 com.vaadin.shared.ui.ui.UIState getState()
          Returns the shared state object for this connector.
 java.util.List<WindowConnector> getSubWindows()
          Return an iterator for current subwindows.
 VUI getWidget()
          Returns the widget associated with this paintable.
 boolean hasSubWindow(WindowConnector wc)
          Deprecated. Should be replaced by a more generic mechanism for getting non-ComponentConnector children
 boolean hasTooltip()
          Check whether there might be a tooltip for this component.
protected  void init()
          Called when the connector has been initialized.
 void init(java.lang.String rootPanelId, ApplicationConnection applicationConnection)
           
protected  void onChildSizeChange()
           
 void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event)
           
 void onStateChanged(StateChangeEvent stateChangeEvent)
          Notifies the event handler that the state has changed.
protected  void replaceTheme(java.lang.String oldTheme, java.lang.String newTheme, java.lang.String oldThemeUrl, java.lang.String newThemeUrl)
          Loads the new theme and removes references to the old theme
 void scrollIntoView(ComponentConnector componentConnector)
          Tries to scroll the viewport so that the given connector is in view.
 void showServerDebugInfo(ServerConnector serverConnector)
          Sends a request to the server to print details to console that will help the developer to locate the corresponding server-side connector in the source code.
 void showServerDesign(ServerConnector connector)
          Sends a request to the server to print a design to the console for the given component.
 void updateCaption(ComponentConnector component)
          Update child components caption, description and error message.
 void updateFromUIDL(UIDL uidl, ApplicationConnection client)
           
 
Methods inherited from class com.vaadin.client.ui.AbstractSingleComponentContainerConnector
getContentWidget
 
Methods inherited from class com.vaadin.client.ui.AbstractHasComponentsConnector
addConnectorHierarchyChangeHandler, getChildComponents, setChildComponents
 
Methods inherited from class com.vaadin.client.ui.AbstractComponentConnector
createWidget, delegateCaptionHandling, flush, getIcon, getIconUri, getLayoutManager, getTooltipInfo, isReadOnly, isRealUpdate, isRelativeHeight, isRelativeWidth, isUndefinedHeight, isUndefinedWidth, onUnregister, registerTouchHandlers, sendContextClickEvent, setWidgetEnabled, setWidgetStyleName, setWidgetStyleNameWithPrefix, shouldHandleLongTap, unregisterTouchHandlers, updateComponentSize, updateComponentSize, updateEnabledState, updateWidgetSize, updateWidgetStyleNames
 
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, 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.HasComponentsConnector
addConnectorHierarchyChangeHandler, getChildComponents, setChildComponents
 
Methods inherited from interface com.vaadin.client.ServerConnector
addStateChangeHandler, addStateChangeHandler, doInit, fireEvent, getChildren, getConnection, getParent, getRpcImplementations, hasEventListener, isEnabled, onUnregister, removeStateChangeHandler, removeStateChangeHandler, setChildren, setParent, updateEnabledState
 
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
 

Constructor Detail

UIConnector

public UIConnector()
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 class AbstractConnector

updateFromUIDL

public void updateFromUIDL(UIDL uidl,
                           ApplicationConnection client)
Specified by:
updateFromUIDL in interface Paintable

init

public void init(java.lang.String rootPanelId,
                 ApplicationConnection applicationConnection)

updateCaption

public void updateCaption(ComponentConnector component)
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:
component - Child component for which service is requested.

getWidget

public VUI 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

getContent

protected ComponentConnector getContent()
Description copied from class: AbstractSingleComponentContainerConnector
Returns the content (only/first child) of the container.

Overrides:
getContent in class AbstractSingleComponentContainerConnector
Returns:
child connector or null if none (e.g. invisible or not set on server)

onChildSizeChange

protected void onChildSizeChange()

hasSubWindow

@Deprecated
public boolean hasSubWindow(WindowConnector wc)
Deprecated. Should be replaced by a more generic mechanism for getting non-ComponentConnector children

Checks if the given sub window is a child of this UI Connector

Parameters:
wc -
Returns:

getSubWindows

public java.util.List<WindowConnector> getSubWindows()
Return an iterator for current subwindows. This method is meant for testing purposes only.

Returns:

getState

public com.vaadin.shared.ui.ui.UIState 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 interface ComponentConnector
Specified by:
getState in interface ServerConnector
Overrides:
getState in class AbstractComponentConnector
Returns:
the current shared state (never null)

getPageState

public com.vaadin.shared.ui.ui.PageState getPageState()
Returns the state of the Page associated with the UI.

Note that state is considered an internal part of the connector. You should not rely on the state object outside of the connector who owns it. If you depend on the state of other connectors you should use their public API instead of their state object directly. The page state might not be an independent state object but can be embedded in UI state.

Returns:
state object of the page
Since:
7.1

onConnectorHierarchyChange

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

hasTooltip

public boolean hasTooltip()
Description copied from interface: ComponentConnector
Check whether there might be a tooltip for this component. The framework will only add event listeners for automatically handling tooltips (using ComponentConnector.getTooltipInfo(Element)) if this method returns true.

This is only done to optimize performance, so in cases where the status is not known, it's safer to return true so that there will be a tooltip handler even though it might not be needed in all cases.

Specified by:
hasTooltip in interface ComponentConnector
Overrides:
hasTooltip in class AbstractComponentConnector
Returns:
true if some part of the component might have a tooltip, otherwise false

scrollIntoView

public void scrollIntoView(ComponentConnector componentConnector)
Tries to scroll the viewport so that the given connector is in view.

Parameters:
componentConnector - The connector which should be visible

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 interface StateChangeEvent.StateChangeHandler
Overrides:
onStateChanged in class AbstractComponentConnector
Parameters:
stateChangeEvent - the state change event with details about the change

analyzeLayouts

public void analyzeLayouts()
Invokes the layout analyzer on the server

Since:
7.1

showServerDebugInfo

public void showServerDebugInfo(ServerConnector serverConnector)
Sends a request to the server to print details to console that will help the developer to locate the corresponding server-side connector in the source code.

Parameters:
serverConnector - the connector to locate
Since:
7.1

showServerDesign

public void showServerDesign(ServerConnector connector)
Sends a request to the server to print a design to the console for the given component.

Parameters:
connector - the component connector to output a declarative design for
Since:
7.5

replaceTheme

protected void replaceTheme(java.lang.String oldTheme,
                            java.lang.String newTheme,
                            java.lang.String oldThemeUrl,
                            java.lang.String newThemeUrl)
Loads the new theme and removes references to the old theme

Parameters:
oldTheme - The name of the old theme
newTheme - The name of the new theme
oldThemeUrl - The url of the old theme
newThemeUrl - The url of the new theme
Since:
7.4.3

activateTheme

protected void activateTheme(java.lang.String newTheme)
Activates the new theme. Assumes the theme has been loaded and taken into use in the browser.

Parameters:
newTheme - The name of the new theme
Since:
7.4.3

forceStateChangeRecursively

protected static void forceStateChangeRecursively(AbstractConnector connector)
Force a full recursive recheck of every connector's state variables.

Since:
7.3
See Also:
AbstractConnector.forceStateChange()

getActiveTheme

public java.lang.String getActiveTheme()
Returns the name of the theme currently in used by the UI

Returns:
the theme name used by this UI
Since:
7.3


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