public class UIConnector extends AbstractSingleComponentContainerConnector implements Paintable, MayScrollChildren
SIGNIFICANT_MOVE_THRESHOLD| Constructor and Description |
|---|
UIConnector() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activateTheme(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 re-check of every connector's state variables.
|
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.
|
PageState |
getPageState()
Returns the state of the Page associated with the UI.
|
UIState |
getState()
Returns the shared state object for this connector.
|
List<WindowConnector> |
getSubWindows()
Return a list of current sub-windows.
|
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(com.google.gwt.dom.client.Element rootPanelElement,
ApplicationConnection applicationConnection)
Initialize UIConnector and attach UI to the rootPanelElement.
|
void |
init(String rootPanelId,
ApplicationConnection applicationConnection)
Initialize UIConnector and attach UI to RootPanel for rootPanelId
element.
|
boolean |
isMobileHTML5DndEnabled()
Returns whether HTML5 DnD extensions
DragSourceExtensionConnector
and DropTargetExtensionConnector and alike should be enabled for
mobile devices. |
protected void |
onChildSizeChange()
Ensure the position is calculated correctly.
|
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.
|
protected void |
replaceTheme(String oldTheme,
String newTheme,
String oldThemeUrl,
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) |
getContentWidgetaddConnectorHierarchyChangeHandler, getChildComponents, setChildComponentscreateWidget, delegateCaptionHandling, flush, getIcon, getIconUri, getLayoutManager, getTooltipInfo, isErrorIndicatorVisible, isRealUpdate, isRelativeHeight, isRelativeWidth, isUndefinedHeight, isUndefinedWidth, onDragSourceAttached, onDragSourceDetached, onDropTargetAttached, onDropTargetDetached, onUnregister, registerTouchHandlers, sendContextClickEvent, setWidgetEnabled, setWidgetStyleName, setWidgetStyleNameWithPrefix, shouldHandleLongTap, unregisterTouchHandlers, updateComponentSize, updateComponentSize, updateEnabledState, updateWidgetSize, updateWidgetStyleNamesaddStateChangeHandler, addStateChangeHandler, createState, doInit, ensureHandlerManager, fireEvent, forceStateChange, getChildren, getConnection, getConnectorId, getParent, getResourceUrl, getRpcImplementations, getRpcProxy, getStateType, getTag, hasEventListener, isEnabled, registerRpc, removeStateChangeHandler, removeStateChangeHandler, setChildren, setParent, setTag, unregisterRpcclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddConnectorHierarchyChangeHandler, getChildComponents, setChildComponentsaddStateChangeHandler, addStateChangeHandler, doInit, fireEvent, getChildren, getConnection, getParent, getRpcImplementations, getTag, hasEventListener, isEnabled, onUnregister, removeStateChangeHandler, removeStateChangeHandler, setChildren, setParent, setTag, updateEnabledStategetConnectorIdprotected void init()
AbstractConnectorinit in class AbstractConnectorpublic void updateFromUIDL(UIDL uidl, ApplicationConnection client)
updateFromUIDL in interface Paintablepublic void init(com.google.gwt.dom.client.Element rootPanelElement,
ApplicationConnection applicationConnection)
rootPanelElement - element to attach ui intoapplicationConnection - application connectionpublic void init(String rootPanelId, ApplicationConnection applicationConnection)
rootPanelId - root panel element idapplicationConnection - application connectionpublic void updateCaption(ComponentConnector component)
HasComponentsConnectorEach 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.
updateCaption in interface HasComponentsConnectorcomponent - Child component for which service is requested.public VUI getWidget()
AbstractComponentConnectorgetWidget in interface HasWidgetgetWidget in class AbstractComponentConnectorprotected ComponentConnector getContent()
AbstractSingleComponentContainerConnectorgetContent in class AbstractSingleComponentContainerConnectorprotected void onChildSizeChange()
@Deprecated public boolean hasSubWindow(WindowConnector wc)
wc - the connector of the sub-windowtrue if the connector is found among the sub-windows,
false otherwisepublic List<WindowConnector> getSubWindows()
public UIState getState()
AbstractConnectorgetState in interface ComponentConnectorgetState in interface ServerConnectorgetState in class AbstractComponentConnectorpublic PageState getPageState()
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.
public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event)
ConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandler
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.
onConnectorHierarchyChange in interface ConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandlerevent - the event with information about the hierarchy changepublic boolean hasTooltip()
ComponentConnectorComponentConnector.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.
hasTooltip in interface ComponentConnectorhasTooltip in class AbstractComponentConnectortrue if some part of the component might have a
tooltip, otherwise falsepublic void scrollIntoView(ComponentConnector componentConnector)
componentConnector - The connector which should be visiblepublic void onStateChanged(StateChangeEvent stateChangeEvent)
StateChangeEvent.StateChangeHandleronStateChanged in interface StateChangeEvent.StateChangeHandleronStateChanged in class AbstractComponentConnectorstateChangeEvent - the state change event with details about the changepublic void analyzeLayouts()
public void showServerDebugInfo(ServerConnector serverConnector)
serverConnector - the connector to locatepublic void showServerDesign(ServerConnector connector)
connector - the component connector to output a declarative design forprotected void replaceTheme(String oldTheme, String newTheme, String oldThemeUrl, String newThemeUrl)
oldTheme - The name of the old themenewTheme - The name of the new themeoldThemeUrl - The url of the old themenewThemeUrl - The url of the new themeprotected void activateTheme(String newTheme)
newTheme - The name of the new themeprotected static void forceStateChangeRecursively(AbstractConnector connector)
connector - the connector which should get recursive forced state changeAbstractConnector.forceStateChange()public String getActiveTheme()
public boolean isMobileHTML5DndEnabled()
DragSourceExtensionConnector
and DropTargetExtensionConnector and alike should be enabled for
mobile devices.
By default, it is disabled.
true if enabled, false if notCopyright © 2023 Vaadin Ltd. All rights reserved.