Class PanelDefinitionImpl

    • Constructor Detail

      • PanelDefinitionImpl

        @JsIgnore
        public PanelDefinitionImpl()
      • PanelDefinitionImpl

        @JsIgnore
        public PanelDefinitionImpl​(String type)
    • Method Detail

      • getElementId

        public String getElementId()
        Description copied from interface: PanelDefinition
        Returns the DOM ID that will be given to a panel created from this definition. If null, no ID attribute will be set on a panel created from this definition.
        Specified by:
        getElementId in interface PanelDefinition
      • setElementId

        public void setElementId​(String id)
        Description copied from interface: PanelDefinition
        Specifies the DOM ID that should be given to the live panel's element. Applications are responsible for ensuring the ID values are unique among all live panels.
        Specified by:
        setElementId in interface PanelDefinition
        Parameters:
        id - the DOM ID to give the panel when it is created. If null, no ID will be set on the panel.
      • addPart

        public void addPart​(PartDefinition part)
        Description copied from interface: PanelDefinition
        Specifies content that should be put in this panel's main display area when it is materialized. The content to add is specified by a PartDefinition, at the core of which is a PlaceRequest that identifies a WorkbenchActivity (either a screen or an editor).

        If the given part already belongs to an existing panel, it will be removed from that panel by a call to removePart(part).

        Specified by:
        addPart in interface PanelDefinition
        Parameters:
        part - The Part to add. Must not be null. The part's place must specify a WorkbenchActivity bean.
      • addPart

        public PartDefinition addPart​(String partSpec)
        Description copied from interface: PanelDefinition
        Specifies content that should be put in this panel's main display area when it is materialized.

        This is a convenience method equivalent to addPart(new PartDefinitionImpl(DefaultPlaceRequest.parse(partSpec))).

        Specified by:
        addPart in interface PanelDefinition
        Parameters:
        partSpec - An PlaceRequest ID with optional parameters, encoded as specified in DefaultPlaceRequest.parse(CharSequence). Must not be null. The place ID must specify a WorkbenchActivity bean (either a screen or an editor).
        Returns:
        the PartDefinition object that was created and added to this panel definition.
      • removePart

        public boolean removePart​(PartDefinition part)
        Description copied from interface: PanelDefinition
        Removes the given part definition from this panel definition.
        Specified by:
        removePart in interface PanelDefinition
        Parameters:
        part - The Part to be removed
        Returns:
        true if the part was found and removed; false if it did not belong to this panel in the first place.
      • getChildren

        @JsIgnore
        public List<PanelDefinition> getChildren()
        Description copied from interface: PanelDefinition
        Returns this panel's immediate child panels.
        Specified by:
        getChildren in interface PanelDefinition
        Returns:
        a snapshot of the current child list. The list is not modifiable, and will not change as panels are added and removed from this panel. The returned list is never null.
      • insertChild

        public void insertChild​(Position position,
                                PanelDefinition panel)
        Description copied from interface: PanelDefinition
        Insert a Panel as an immediate child at the given Position. If this Panel already has a child at the specified position the existing Panel at that position becomes a child of the Panel being added at the same Position.
        Specified by:
        insertChild in interface PanelDefinition
        Parameters:
        position - The Position to add the child
        panel - The child Panel
      • appendChild

        public void appendChild​(Position position,
                                PanelDefinition panel)
        Description copied from interface: PanelDefinition
        Append a Panel at the first empty child position. If this Panel already has a child at the specified position the descendants are followed until an empty position is found.
        Specified by:
        appendChild in interface PanelDefinition
        Parameters:
        position - The Position to add the child
        panel - The child Panel
      • appendChild

        public void appendChild​(PanelDefinition panel)
        Description copied from interface: PanelDefinition
        Append a Panel at the first empty child position. If this Panel already has a child at the specified position the descendants are followed until an empty position is found.
        Specified by:
        appendChild in interface PanelDefinition
        Parameters:
        panel - The child Panel
      • getChild

        public PanelDefinition getChild​(Position position)
        Description copied from interface: PanelDefinition
        Get the Panel's immediate child Panel at the given Position
        Specified by:
        getChild in interface PanelDefinition
        Parameters:
        position - The child Panel's Position
        Returns:
        The child Panel or null, if a child does not exist at the given Position
      • isRoot

        public boolean isRoot()
        Description copied from interface: PanelDefinition
        Is this Panel the root of the Perspective definition
        Specified by:
        isRoot in interface PanelDefinition
        Returns:
        True if the Panel is the root
      • setRoot

        public void setRoot​(boolean isRoot)
      • getPanelType

        public String getPanelType()
        Description copied from interface: PanelDefinition
        Specifies the WorkbenchPanelPresenter implementation that should be used when adding this panel to the UI. Must refer to a Dependent-scoped Errai IOC bean type.
        Specified by:
        getPanelType in interface PanelDefinition
        Returns:
        fully-qualified class name of the WorkbenchPanelPresenter implementation to use. Must not be null, but may be the special value PanelDefinition.PARENT_CHOOSES_TYPE.
      • setPanelType

        public void setPanelType​(String fqcn)
        Description copied from interface: PanelDefinition
        Specifies the WorkbenchPanelPresenter implementation that should be used when adding this panel to the UI. Must refer to a Dependent-scoped Errai IOC bean type.
        Specified by:
        setPanelType in interface PanelDefinition
        Parameters:
        fqcn - fully-qualified class name of the WorkbenchPanelPresenter implementation to use. Must not be null, but may be the special value PanelDefinition.PARENT_CHOOSES_TYPE.
      • getHeight

        @JsIgnore
        public Integer getHeight()
        Description copied from interface: PanelDefinition
        Get the height of the Panel in pixels
        Specified by:
        getHeight in interface PanelDefinition
        Returns:
        The height, or null if not set
      • setHeight

        @JsIgnore
        public void setHeight​(Integer height)
        Description copied from interface: PanelDefinition
        Set the height of this panel in pixels.
        Specified by:
        setHeight in interface PanelDefinition
        Parameters:
        height - The height to set. If null, the existing height value is retained.
      • getWidth

        @JsIgnore
        public Integer getWidth()
        Description copied from interface: PanelDefinition
        Get the width of this panel in pixels.
        Specified by:
        getWidth in interface PanelDefinition
        Returns:
        The width, or null if not set.
      • setWidth

        @JsIgnore
        public void setWidth​(Integer width)
        Description copied from interface: PanelDefinition
        Set the width of this panel in pixels.
        Specified by:
        setWidth in interface PanelDefinition
        Parameters:
        width - The width to set. If null, the existing width value is retained.
      • getMinHeight

        @JsIgnore
        public final Integer getMinHeight()
        Description copied from interface: PanelDefinition
        Get the minimum height of this panel in pixels.
        Specified by:
        getMinHeight in interface PanelDefinition
        Returns:
        The minimum height, or null if not set.
      • setMinHeight

        @JsIgnore
        public final void setMinHeight​(Integer minHeight)
        Description copied from interface: PanelDefinition
        Set the minimum height of the Panel in pixels
        Specified by:
        setMinHeight in interface PanelDefinition
        Parameters:
        minHeight - The minimum height, or null if not set
      • getMinWidth

        @JsIgnore
        public final Integer getMinWidth()
        Description copied from interface: PanelDefinition
        Get the minimum width of the Panel in pixels
        Specified by:
        getMinWidth in interface PanelDefinition
        Returns:
        The minimum width, or null if not set
      • setMinWidth

        @JsIgnore
        public final void setMinWidth​(Integer minWidth)
        Description copied from interface: PanelDefinition
        Set the minimum width of the Panel in pixels
        Specified by:
        setMinWidth in interface PanelDefinition
        Parameters:
        minWidth - The width, or null if not set
      • getPosition

        public final Position getPosition()
        Description copied from interface: PanelDefinition
        Get the Position of the Panel relate to it's Parent

        TODO remove this. parent panels should track the positions of their children; making it a property of the child is error-prone when moving panels around in the UI.

        Specified by:
        getPosition in interface PanelDefinition
        Returns:
        The Position of the Panel
      • setPosition

        public void setPosition​(Position position)
        Description copied from interface: PanelDefinition
        Set the Position of the Panel relative to it's parent.

        TODO remove this. parent panels should track the positions of their children; making it a property of the child is error-prone when moving panels around in the UI.

        Specified by:
        setPosition in interface PanelDefinition
        Parameters:
        position - The Position of the Panel relative to it's parent
      • isMaximized

        public boolean isMaximized()
        Description copied from interface: PanelDefinition
        Has the Panel been expanded to a maximum size
        Specified by:
        isMaximized in interface PanelDefinition
        Returns:
        true If maximized