Interface WorkbenchPanelPresenter

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addPanel​(WorkbenchPanelPresenter child, org.uberfire.workbench.model.Position position)
      Adds the given panel as a subpanel of this one in the given position.
      void addPart​(WorkbenchPartPresenter part)
      Adds the given part to this panel's content area, updating this panel's definition and the part's definition to reflect the new part ownership.
      void addPart​(WorkbenchPartPresenter part, String contextId)
      Adds the given part to this panel with the given context ID, updating this panel's definition and the part's definition to reflect the new part ownership.
      void changeTitle​(org.uberfire.workbench.model.PartDefinition part, String title, com.google.gwt.user.client.ui.IsWidget titleDecoration)  
      String getDefaultChildType()
      Returns the panel type that should be used when adding child panels of type PanelDefinition.PARENT_CHOOSES_TYPE.
      org.uberfire.workbench.model.PanelDefinition getDefinition()
      Returns a @Portable description of the current state of this panel.
      Map<org.uberfire.workbench.model.Position,​WorkbenchPanelPresenter> getPanels()
      Returns the immediate child panels of this panel.
      WorkbenchPanelView getPanelView()
      Returns the view that was given to this panel when it was first created.
      WorkbenchPanelPresenter getParent()
      Returns the current parent of this panel presenter.
      Class<? extends WorkbenchPartPresenter> getPartType()
      Returns the type of new parts.
      void maximize()
      Makes this panel's view take up most of the space on the workbench.
      void onResize​(int width, int height)  
      boolean removePanel​(WorkbenchPanelPresenter child)
      Removes the given panel presenter and its view from this panel, freeing all resources associated with them.
      boolean removePart​(org.uberfire.workbench.model.PartDefinition part)
      Removes the given part from this panel, updating this panel's definition and the part's definition to reflect that the part no longer belongs to this panel.
      boolean selectPart​(org.uberfire.workbench.model.PartDefinition part)  
      void setDefinition​(org.uberfire.workbench.model.PanelDefinition definition)
      Called by the framework when the panel instance is first created.
      void setFocus​(boolean hasFocus)  
      void setParent​(WorkbenchPanelPresenter parent)
      Sets the current parent of this panel presenter.
      void unmaximize()
      Restores this panel's view to its original unmaximized size and position.
    • Method Detail

      • getParent

        WorkbenchPanelPresenter getParent()
        Returns the current parent of this panel presenter.
        Returns:
        the parent panel presenter. If this panel is the root, or it is not attached to a parent, the return value is null.
      • setParent

        void setParent​(WorkbenchPanelPresenter parent)
        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.
        Parameters:
        parent - the new parent of this panel. If this panel is being removed, the parent should be set to null.
      • getDefinition

        org.uberfire.workbench.model.PanelDefinition getDefinition()
        Returns a @Portable description of the current state of this panel.
      • setDefinition

        void setDefinition​(org.uberfire.workbench.model.PanelDefinition definition)
        Called by the framework when the panel instance is first created. Application code should not call this method directly.
        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.
      • addPart

        void addPart​(WorkbenchPartPresenter part)
        Adds the given part to this panel's content area, updating this panel's definition and the part's definition to reflect the new part ownership.

        Panels each implement their own policy and user interface for part management. Some panels do not support parts at all; others allow only a single part; still others can hold multiple parts at a time. Either way, panels that do display parts typically display them one at a time. Those that support multiple parts include UI widgets (eg. tabs or a dropdown list) that let the user select which one to display.

        After the panel's border decorations, part switcher UI, title bar, and subpanel space has been accounted for, the part's view typically occupies all remaining space within its parent panel.

        Parameters:
        part - the part to add. Must not be null, and must not currently belong to any panel.
        Throws:
        UnsupportedOperationException - if this panel does not support parts
      • addPart

        void addPart​(WorkbenchPartPresenter part,
                     String contextId)
        Adds the given part to this panel with the given context ID, updating this panel's definition and the part's definition to reflect the new part ownership.
        Parameters:
        part - the part to add. Must not be null, and must not currently belong to any panel.
        Throws:
        UnsupportedOperationException - if this panel does not support parts
        See Also:
        addPart(WorkbenchPartPresenter)
      • removePart

        boolean removePart​(org.uberfire.workbench.model.PartDefinition part)
        Removes the given part from this panel, updating this panel's definition and the part's definition to reflect that the part no longer belongs to this panel.
        Returns:
        true if the given part was found and removed; false if this call had no effect
        See Also:
        addPart(WorkbenchPartPresenter)
      • addPanel

        void addPanel​(WorkbenchPanelPresenter child,
                      org.uberfire.workbench.model.Position position)
        Adds the given panel as a subpanel of this one in the given position. Panels typically only allow one child panel in each position, and may throw an exception or make alternative arrangements (for example, forward the request to a child panel) when you try to add a child panel to an already-occupied slot.

        Subpanels are typically always visible, and take up space within the bounds of their parent panel.

        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

        boolean removePanel​(WorkbenchPanelPresenter child)
        Removes the given panel presenter and its view from this panel, freeing all resources associated with them.
        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

        Map<org.uberfire.workbench.model.Position,​WorkbenchPanelPresenter> getPanels()
        Returns the immediate child panels of this panel. Note that panels and parts are not the same thing; this method only returns the panels.
        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

        void changeTitle​(org.uberfire.workbench.model.PartDefinition part,
                         String title,
                         com.google.gwt.user.client.ui.IsWidget titleDecoration)
      • setFocus

        void setFocus​(boolean hasFocus)
      • selectPart

        boolean selectPart​(org.uberfire.workbench.model.PartDefinition part)
      • maximize

        void maximize()
        Makes this panel's view take up most of the space on the workbench. The exact meaning of "maximize" is left to the implementation of WorkbenchLayout.
      • unmaximize

        void unmaximize()
        Restores this panel's view to its original unmaximized size and position.
      • getPanelView

        WorkbenchPanelView getPanelView()
        Returns the view that was given to this panel when it was first created.
      • onResize

        void onResize​(int width,
                      int height)
      • getDefaultChildType

        String getDefaultChildType()
        Returns the panel type that should be used when adding child panels of type PanelDefinition.PARENT_CHOOSES_TYPE.
        Returns:
        the fully-qualified class name of a WorkbenchPanelPresenter implementation. Returns null if this panel presenter does not allow child panels.