Class StubComponent

    • Constructor Detail

      • StubComponent

        public StubComponent()
    • Method Detail

      • getId

        public java.lang.String getId​(java.lang.String uuid)
        Returns ID of the given UUID, or null if not found or no ID assigned. It assumes the given UUID belonged to one of the component being merged into this component.

        Notice that it searches all descendants of this component.

      • replace

        public void replace​(Component comp,
                            boolean bFellow,
                            boolean bListener,
                            boolean bChildren)
        Replace the specified component with this component in the component tree. In other words, the parent of the given component will become the parent of this components, so are siblings and children. Furthermore, comp will be detached at the end.

        Notice that the replacement won't change anything at the client. A stub component assumes there is a full-functional widget running at the client to handle everything.

        Overrides:
        replace in class AbstractComponent
        Parameters:
        comp - the component. In this implementation it supports only derived classes of AbstractComponent.
        bFellow - whether to add this component to the map of fellows if it is assigned with an ID. If false, the component (comp) cannot be retrieved back even with an ID.
        bListener - whether to retain the event listeners and handlers. If true, the event listeners and handlers, if any, will be registered to this stub component. In other words, the event will be processed. However, it is a stub component, rather than the original one. I means the event is the most generic format: an instance of Event (rather than MouseEvent or others).
        bChildren - whether to have the children of the given component.
        If false, this component won't have any children, and all UUID of children reference back to this component.
        If true, the given component's children will belong to this component.
        Throws:
        java.lang.IllegalStateException - if this component has a parent, sibling or child.