Class UIConnector

    • 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
      • init

        public void init​(com.google.gwt.dom.client.Element rootPanelElement,
                         ApplicationConnection applicationConnection)
        Initialize UIConnector and attach UI to the rootPanelElement.
        Parameters:
        rootPanelElement - element to attach ui into
        applicationConnection - application connection
        Since:
        8.4
      • init

        public void init​(String rootPanelId,
                         ApplicationConnection applicationConnection)
        Initialize UIConnector and attach UI to RootPanel for rootPanelId element.
        Parameters:
        rootPanelId - root panel element id
        applicationConnection - application connection
      • 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.
      • onChildSizeChange

        protected void onChildSizeChange()
        Ensure the position is calculated correctly. This method should be called whenever the content's height changes for any reason, in case the change has been between a relative and non-relative height to either direction.
      • 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 - the connector of the sub-window
        Returns:
        true if the connector is found among the sub-windows, false otherwise
      • getSubWindows

        public List<WindowConnector> getSubWindows()
        Return a list of current sub-windows. This method is meant for testing purposes only.
        Returns:
        a list of sub-windows
      • getPageState

        public 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)
        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 interface ConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandler
        Parameters:
        event - the event with information about the hierarchy change
      • 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
      • 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​(String oldTheme,
                                    String newTheme,
                                    String oldThemeUrl,
                                    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​(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 re-check of every connector's state variables.
        Parameters:
        connector - the connector which should get recursive forced state change
        Since:
        7.3
        See Also:
        AbstractConnector.forceStateChange()
      • getActiveTheme

        public 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
      • isMobileHTML5DndEnabled

        public boolean isMobileHTML5DndEnabled()
        Returns whether HTML5 DnD extensions DragSourceExtensionConnector and DropTargetExtensionConnector and alike should be enabled for mobile devices.

        By default, it is disabled.

        Returns:
        true if enabled, false if not
        Since:
        8.1