Class AbstractDockingWorkbenchPanelPresenter<P extends AbstractWorkbenchPanelPresenter<P>>
- java.lang.Object
-
- org.uberfire.client.workbench.panels.impl.AbstractWorkbenchPanelPresenter<P>
-
- org.uberfire.client.workbench.panels.impl.AbstractDockingWorkbenchPanelPresenter<P>
-
- All Implemented Interfaces:
DockingWorkbenchPanelPresenter,WorkbenchPanelPresenter
- Direct Known Subclasses:
AbstractMultiPartWorkbenchPanelPresenter,AdaptiveWorkbenchPanelPresenter,ClosableSimpleWorkbenchPanelPresenter,SimpleDnDWorkbenchPanelPresenter,SimpleNoExpandWorkbenchPanelPresenter,SimpleWorkbenchPanelPresenter
public abstract class AbstractDockingWorkbenchPanelPresenter<P extends AbstractWorkbenchPanelPresenter<P>> extends AbstractWorkbenchPanelPresenter<P> implements DockingWorkbenchPanelPresenter
Implements the behaviour for panel presenters that support adding child panels inCompassPositionpositions.
-
-
Field Summary
-
Fields inherited from class org.uberfire.client.workbench.panels.impl.AbstractWorkbenchPanelPresenter
childPanels, perspectiveManager
-
-
Constructor Summary
Constructors Constructor Description AbstractDockingWorkbenchPanelPresenter(WorkbenchPanelView<P> view, PerspectiveManager perspectiveManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPanel(WorkbenchPanelPresenter newChild, org.uberfire.workbench.model.Position position)Forwards requests to existing child panels in case there is already a child panel in the requested position.DockingWorkbenchPanelView<P>getPanelView()Returns the view that was given to this panel when it was first created.booleanremovePanel(WorkbenchPanelPresenter child)Checks for existing child panels of the panel to be removed, and reparents them to this panel in the position of the child panel.booleanremovePart(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.booleansetChildSize(WorkbenchPanelPresenter child, Integer pixelWidth, Integer pixelHeight)Sets the width or height of the given child panel to the given dimension, leaving room for the existing space taken up by (recursively) nested panels in the NORTH, SOUTH, EAST, and WEST child positions.-
Methods inherited from class org.uberfire.client.workbench.panels.impl.AbstractWorkbenchPanelPresenter
addPart, addPart, asPresenterType, changeTitle, getDefaultChildType, getDefinition, getPanels, getParent, getPartType, maximize, onResize, positionOf, selectPart, setDefinition, setFocus, setParent, toString, unmaximize
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.uberfire.client.workbench.panels.WorkbenchPanelPresenter
addPart, addPart, changeTitle, getDefaultChildType, getDefinition, getPanels, getParent, getPartType, maximize, onResize, selectPart, setDefinition, setFocus, setParent, unmaximize
-
-
-
-
Constructor Detail
-
AbstractDockingWorkbenchPanelPresenter
public AbstractDockingWorkbenchPanelPresenter(WorkbenchPanelView<P> view, PerspectiveManager perspectiveManager)
-
-
Method Detail
-
addPanel
public void addPanel(WorkbenchPanelPresenter newChild, org.uberfire.workbench.model.Position position)
Forwards requests to existing child panels in case there is already a child panel in the requested position. Otherwise behaves exactly like the superclass.- Specified by:
addPanelin interfaceWorkbenchPanelPresenter- Overrides:
addPanelin classAbstractWorkbenchPanelPresenter<P extends AbstractWorkbenchPanelPresenter<P>>- Parameters:
newChild- 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)
Checks for existing child panels of the panel to be removed, and reparents them to this panel in the position of the child panel. Once the child panels are safely out of the way, the actual panel removal is done by a call to super.removePanel().- Specified by:
removePanelin interfaceWorkbenchPanelPresenter- Overrides:
removePanelin classAbstractWorkbenchPanelPresenter<P extends AbstractWorkbenchPanelPresenter<P>>- 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.
-
setChildSize
public boolean setChildSize(WorkbenchPanelPresenter child, Integer pixelWidth, Integer pixelHeight)
Description copied from interface:DockingWorkbenchPanelPresenterSets the width or height of the given child panel to the given dimension, leaving room for the existing space taken up by (recursively) nested panels in the NORTH, SOUTH, EAST, and WEST child positions. Width is applied to EAST or WEST children; height is applied to NORTH and SOUTH children. If the requested space isn't available (for instance because it is larger than the browser window, or it would make the central panel of this view smaller than its minimum size) then the largest possible amount will be given to the requested child. Similarly, if the requested size is less than the child's minimum width or height (as appropriate) then the child will be set to its minimum.- Specified by:
setChildSizein interfaceDockingWorkbenchPanelPresenter- Parameters:
child- the child panel whose size to changepixelWidth- the new width for the child panel, if it supports horizontal resizing. If null, the width will not be changed.pixelHeight- the new height for the child panel, if it supports vertical resizing. If null, the height will not be changed.- Returns:
- true if the given child was in fact part of this panel; false if the child was not found. The return value is not affected by whether or not the requested size was null.
-
removePart
public boolean removePart(org.uberfire.workbench.model.PartDefinition part)
Description copied from interface:WorkbenchPanelPresenterRemoves 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.- Specified by:
removePartin interfaceWorkbenchPanelPresenter- Overrides:
removePartin classAbstractWorkbenchPanelPresenter<P extends AbstractWorkbenchPanelPresenter<P>>- Returns:
- true if the given part was found and removed; false if this call had no effect
- See Also:
WorkbenchPanelPresenter.addPart(WorkbenchPartPresenter)
-
getPanelView
public DockingWorkbenchPanelView<P> getPanelView()
Description copied from interface:WorkbenchPanelPresenterReturns the view that was given to this panel when it was first created.- Specified by:
getPanelViewin interfaceWorkbenchPanelPresenter- Overrides:
getPanelViewin classAbstractWorkbenchPanelPresenter<P extends AbstractWorkbenchPanelPresenter<P>>
-
-