Class AbstractWorkbenchPanelPresenter<P extends AbstractWorkbenchPanelPresenter<P>>

    • Method Detail

      • asPresenterType

        protected abstract P asPresenterType()
        Returns a reference to this. Helps superclass code work around generic type checking problems.
      • setParent

        public void setParent​(WorkbenchPanelPresenter parent)
        Description copied from interface: WorkbenchPanelPresenter
        Sets the current parent of this panel presenter. This method should only be called by another WorkbenchPanelPresenter when adding or removing this panel as a child.
        Specified by:
        setParent in interface WorkbenchPanelPresenter
        Parameters:
        parent - the new parent of this panel. If this panel is being removed, the parent should be set to null.
      • setDefinition

        public void setDefinition​(org.uberfire.workbench.model.PanelDefinition definition)
        Description copied from interface: WorkbenchPanelPresenter
        Called by the framework when the panel instance is first created. Application code should not call this method directly.
        Specified by:
        setDefinition in interface WorkbenchPanelPresenter
        Parameters:
        definition - description of the state this panel should put itself in. This panel is also responsible for keeping the definition up to date with the panel's current state.
      • getDefaultChildType

        public String getDefaultChildType()
        Most panel types are their own default child type, so this implementation returns getClass().getName(). Subclasses can override if they prefer a different child type.
        Specified by:
        getDefaultChildType in interface WorkbenchPanelPresenter
        Returns:
        the fully-qualified class name of a WorkbenchPanelPresenter implementation. Returns null if this panel presenter does not allow child panels.
      • addPanel

        public void addPanel​(WorkbenchPanelPresenter child,
                             org.uberfire.workbench.model.Position position)
        This base implementation should be sufficient for most panels. It modifies the panel definition and adds the child view to this panel's view. In case the requested position is already in use for this panel, this method will throw an IllegalStateException. Subclasses may override and implement some other collision avoidance strategy.
        Specified by:
        addPanel in interface WorkbenchPanelPresenter
        Parameters:
        child - the panel to add. The presenter, its view, and its definition must not belong to any parent. As a side effect of this call (if the call is successful), the given presenter, its view, and its definition will get attached to their new parents.
        position - the position to add the child at. Different panel implementations support different position types.
      • removePanel

        public boolean removePanel​(WorkbenchPanelPresenter child)
        Description copied from interface: WorkbenchPanelPresenter
        Removes the given panel presenter and its view from this panel, freeing all resources associated with them.
        Specified by:
        removePanel in interface WorkbenchPanelPresenter
        Parameters:
        child - The child panel to remove. Must be a direct child of this panel, and must be empty (contain no parts or child panels). Null is not permitted.
        Returns:
        true if the child was found and removed from this panel; false if the child panel could not be found.
      • getPanels

        public Map<org.uberfire.workbench.model.Position,​WorkbenchPanelPresenter> getPanels()
        Description copied from interface: WorkbenchPanelPresenter
        Returns the immediate child panels of this panel. Note that panels and parts are not the same thing; this method only returns the panels.
        Specified by:
        getPanels in interface WorkbenchPanelPresenter
        Returns:
        an unmodifiable snapshot of the immediate child panels nested within this one. Never null, and will not update to reflect subsequent changes to this panel's children. Safe to iterate over when adding or removing child panels.
      • changeTitle

        public void changeTitle​(org.uberfire.workbench.model.PartDefinition part,
                                String title,
                                com.google.gwt.user.client.ui.IsWidget titleDecorator)
        Specified by:
        changeTitle in interface WorkbenchPanelPresenter