Interface WorkbenchPanelView<P extends WorkbenchPanelPresenter>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addPanel​(org.uberfire.workbench.model.PanelDefinition panel, WorkbenchPanelView<?> view, org.uberfire.workbench.model.Position position)
      Nests the given WorkbenchPanelView inside this one at the given position, which must be unoccupied.
      void addPart​(WorkbenchPartPresenter.View view)
      Adds the given part view to this panel if this panel does not already contain a view that handles the same PlaceRequest as the given one.
      void changeTitle​(org.uberfire.workbench.model.PartDefinition part, String title, com.google.gwt.user.client.ui.IsWidget titleDecoration)
      Assigns the given title to the given part, if the part belongs to this panel.
      com.google.gwt.user.client.ui.Widget getPartDropRegion()
      Returns the widget that defines the boundaries of this panel view for purposes of drag-and-drop.
      Collection<org.uberfire.workbench.model.PartDefinition> getParts()
      Returns the parts currently held by the view.
      P getPresenter()
      Returns this view's presenter.
      void maximize()
      Maximizes this view using WorkbenchLayout.maximize(Widget).
      boolean removePanel​(WorkbenchPanelView<?> child)
      Removes the view widget associated with the given child from this panel, freeing any resources that were allocated by this panel when the child was added.
      boolean removePart​(org.uberfire.workbench.model.PartDefinition part)
      Removes the given part from this view, if it belonged to this view.
      boolean selectPart​(org.uberfire.workbench.model.PartDefinition part)
      Makes the given part visible and focused, if it belongs to this view.
      void setElementId​(String elementId)
      Sets the ID of the physical root element of this view.
      void setFocus​(boolean hasFocus)
      Informs this view that it has gained or lost keyboard focus.
      void unmaximize()
      Restores this view to its original unmaximized size and position using WorkbenchLayout.unmaximize(Widget).
      • Methods inherited from interface org.uberfire.client.mvp.HasPresenter

        init
      • Methods inherited from interface com.google.gwt.user.client.ui.IsWidget

        asWidget
      • Methods inherited from interface com.google.gwt.user.client.ui.RequiresResize

        onResize
    • Method Detail

      • getPresenter

        P getPresenter()
        Returns this view's presenter.
        Returns:
        the presenter that this view is bound to. Will return null if invoked before the presenter calls HasPresenter.init(Object); afterward, the return value is never null.
      • addPart

        void addPart​(WorkbenchPartPresenter.View view)
        Adds the given part view to this panel if this panel does not already contain a view that handles the same PlaceRequest as the given one. If this panel does already contain such a part, the existing one is selected and the given one is not added.
        Parameters:
        view - the view to add as long as it is not a duplicate. Must not be null.
      • addPanel

        void addPanel​(org.uberfire.workbench.model.PanelDefinition panel,
                      WorkbenchPanelView<?> view,
                      org.uberfire.workbench.model.Position position)
        Nests the given WorkbenchPanelView inside this one at the given position, which must be unoccupied. This is an optional feature of WorkbenchPanelView: not all implementations support nested child panels. Additionally, different panels support different Position types. Implementations should document whether or not they support child panels, and if so, what types of Positions they understand.
        Parameters:
        panel - specifies the size that should be imposed on the nested view. Must not be null. FIXME: is this sensible/correct?
        view - the panel to nest inside this one. Must not be null.
        position - specifies which edge of this panel will be shared with the nested panel. Must not be null.
        Throws:
        IllegalStateException - if the given position is already occupied by a child panel.
        IllegalArgumentException - if the given child position is not understood by this type of panel.
        UnsupportedOperationException - if this panel does not support child panels at all.
      • removePanel

        boolean removePanel​(WorkbenchPanelView<?> child)
        Removes the view widget associated with the given child from this panel, freeing any resources that were allocated by this panel when the child was added.
      • changeTitle

        void changeTitle​(org.uberfire.workbench.model.PartDefinition part,
                         String title,
                         com.google.gwt.user.client.ui.IsWidget titleDecoration)
        Assigns the given title to the given part, if the part belongs to this panel.
        Parameters:
        part - the part whose title to change. Must not be null.
        title - the new title. Must not be null.
        titleDecoration - An optional widget to display beside the title. Note that some implementations do not support title decorations, and they will ignore this. Null is permitted, and means no decoration.
      • selectPart

        boolean selectPart​(org.uberfire.workbench.model.PartDefinition part)
        Makes the given part visible and focused, if it belongs to this view.
        Parameters:
        part - the part to reveal and give focus to.
        Returns:
        true if the part was found, made visible, and given focus. False if not.
      • removePart

        boolean removePart​(org.uberfire.workbench.model.PartDefinition part)
        Removes the given part from this view, if it belonged to this view.
        Parameters:
        part - the part to remove.
        Returns:
        true if the part was found and removed. False if not.
      • setFocus

        void setFocus​(boolean hasFocus)
        Informs this view that it has gained or lost keyboard focus. Focused views may respond by updating their style to look more prominent than unfocused views.
        Parameters:
        hasFocus - if true, this panel now has focus. If false, this panel does not have focus.
      • setElementId

        void setElementId​(String elementId)
        Sets the ID of the physical root element of this view. For HTML-based views, this is the id attribute of the view's top-level DOM element. Implementations for other view technologies should map this to whatever the underlying widget/component system uses for unique identifiers.
        Parameters:
        elementId - the element ID to set. If null, the ID value will be cleared.
      • getPartDropRegion

        com.google.gwt.user.client.ui.Widget getPartDropRegion()
        Returns the widget that defines the boundaries of this panel view for purposes of drag-and-drop.
        Returns:
        the widget whose boundaries define the region where workbench parts can be dropped into this panel. For simple panel types that do not support child panels, this will typically be the same widget returned by IsWidget.asWidget(). For fancier panels, this will typically be some child panel within the view's internal structure.

        If the return value is null, parts will not be droppable on this view.

      • getParts

        Collection<org.uberfire.workbench.model.PartDefinition> getParts()
        Returns the parts currently held by the view.