public interface PanelManager
WorkbenchLayout
.
Application code should not invoke any of the methods of this class directly. Doing so will corrupt the state
of the PlaceManager, ActivityManager, and potentially other stateful framework components. Applications should always
initiate Workbench actions through the public methods on PlaceManager
.
Modifier and Type | Method and Description |
---|---|
CustomPanelDefinition |
addCustomPanel(com.google.gwt.user.client.ui.HasWidgets container,
String panelType)
Creates an UberFire panel and installs its view in the given widget container.
|
CustomPanelDefinition |
addCustomPanel(org.jboss.errai.common.client.dom.HTMLElement container,
String panelType)
Creates an UberFire panel and installs its view in the given html element container.
|
CustomPanelDefinition |
addCustomPanel(elemental2.dom.HTMLElement container,
String panelType)
Creates an UberFire panel and installs its view in the given html element container.
|
PanelDefinition |
addWorkbenchPanel(PanelDefinition targetPanel,
PanelDefinition childPanel,
Position position)
Adds the given child panel to the given target panel at the given position within the target.
|
PanelDefinition |
addWorkbenchPanel(PanelDefinition targetPanel,
Position position,
Integer height,
Integer width,
Integer minHeight,
Integer minWidth)
Adds an empty child panel of the target panel's default child type at the given position within the target panel.
|
void |
addWorkbenchPart(PlaceRequest place,
PartDefinition part,
PanelDefinition panel,
Menus menus,
UIPart uiPart,
String contextId,
Integer minInitialWidth,
Integer minInitialHeight)
Adds the given part to the given panel, which must already be part of the visible workbench layout.
|
void |
closePart(PartDefinition part)
Closes the given part.
|
PartDefinition |
getFocusedPart() |
PanelDefinition |
getPanelForPlace(PlaceRequest place)
Returns the first PanelDefinition whose place matches the given one.
|
PanelDefinition |
getRoot()
Returns the description of the entire panel + part tree that makes up the UI in its current state.
|
void |
onPanelFocus(PanelDefinition panel)
Gives focus to the given panel, if it is known to this PanelManager.
|
void |
onPartFocus(PartDefinition part) |
void |
onPartHidden(PartDefinition part) |
void |
onPartLostFocus() |
void |
onPartMaximized(PartDefinition part) |
void |
onPartMinimized(PartDefinition part) |
boolean |
removePartForPlace(PlaceRequest toRemove)
Removes the part associated with the given PlaceRequest from the panel that contains it.
|
void |
removeWorkbenchPanel(PanelDefinition toRemove)
Removes the panel associated with the given definition, removing the panel's presenter and view from the
workbench, and freeing any resources associated with them.
|
void |
setRoot(PerspectiveActivity activity,
PanelDefinition root)
Clears all existing panel structure from the user interface, then installs a new root panel according to the
specifications in the given
PanelDefinition . |
PanelDefinition getRoot()
void addWorkbenchPart(PlaceRequest place, PartDefinition part, PanelDefinition panel, Menus menus, UIPart uiPart, String contextId, Integer minInitialWidth, Integer minInitialHeight)
SelectPlaceEvent
with the given PlaceRequest
once the part has been added.place
- The PlaceRequest that the part was resolved from. Not null.part
- The description of the part to add. Not null.panel
- definition of the panel to add the part to (must describe a panel that is already present in the
layout). Not null.menus
- The menus to display for the given part. Null means no menus.uiPart
- The part's title and physical view. Not null.contextId
- part of a removed framework feature (TODO: remove this?)minInitialWidth
- minimum pixel width of the part's activity, or null if there is no known minimum width. The target
panel will expand to the this width if the panel is not already at least as wide, and only if it
supports resizing on the horizontal axis.minInitialHeight
- minimum pixel height of the part's activity, or null if there is no known minimum height. The target
panel will expand to this height if the panel is not already at least as tall, and only if it supports
resizing on the vertical axis.PanelDefinition addWorkbenchPanel(PanelDefinition targetPanel, Position position, Integer height, Integer width, Integer minHeight, Integer minWidth)
TODO: the usefulness of this method to callers is questionable (versus creating a new child panel definition and
calling addWorkbenchPanel(PanelDefinition, PanelDefinition, Position)
). candidate for deletion.
PanelDefinition addWorkbenchPanel(PanelDefinition targetPanel, PanelDefinition childPanel, Position position)
PanelDefinition
,
WorkbenchPanelPresenter
, and WorkbenchPanelView
and those of its new parent will be updated to
reflect the new relationship. Note that the given target panel will not necessarily be the new parent: panel
implementations may choose to avoid collisions (more than one child panel in the same position) by redirecting
requests to add children.IllegalStateException
- if targetPanel
already has a child at position
and it doesn't have any special
collision avoidance logicUnsupportedOperationException
- if targetPanel
doesn't support child panels.IllegalArgumentException
- if targetPanel
doesn't understand the given position
value.CustomPanelDefinition addCustomPanel(com.google.gwt.user.client.ui.HasWidgets container, String panelType)
Custom panels can be disposed like any other panel: by calling removeWorkbenchPanel(PanelDefinition)
.
Additionally, custom panels are monitored for DOM detachment. When a custom panel's view is removed from the DOM
(whether directly removed from its parent or some ancestor is removed,) all the panel's parts are closed and then
the associated panel is disposed.
container
- the widget container to install the new panel in. The new panel will fill the container.panelType
;
its parent will be null; isRoot()
will return false.CustomPanelDefinition addCustomPanel(org.jboss.errai.common.client.dom.HTMLElement container, String panelType)
Custom panels can be disposed like any other panel: by calling removeWorkbenchPanel(PanelDefinition)
.
Additionally, custom panels are monitored for DOM detachment. When a custom panel's view is removed from the DOM
(whether directly removed from its parent or some ancestor is removed,) all the panel's parts are closed and then
the associated panel is disposed.
container
- the html element container to install the new panel in. The new panel will fill the container.panelType
;
its parent will be null; isRoot()
will return false.CustomPanelDefinition addCustomPanel(elemental2.dom.HTMLElement container, String panelType)
Custom panels can be disposed like any other panel: by calling removeWorkbenchPanel(PanelDefinition)
.
Additionally, custom panels are monitored for DOM detachment. When a custom panel's view is removed from the DOM
(whether directly removed from its parent or some ancestor is removed,) all the panel's parts are closed and then
the associated panel is disposed.
container
- the html element container to install the new panel in. The new panel will fill the container.panelType
;
its parent will be null; isRoot()
will return false.void removeWorkbenchPanel(PanelDefinition toRemove) throws IllegalStateException
toRemove
- the panel to remove from the workbench layout. Must not be null.IllegalStateException
- if the panel contains parts or child panelsIllegalArgumentException
- if no panel presenter is currently associated with the given definitionboolean removePartForPlace(PlaceRequest toRemove)
toRemove
- the place that is closing. Must not be null.void onPartFocus(PartDefinition part)
void onPartLostFocus()
void onPanelFocus(PanelDefinition panel)
panel
- the panel to give focus to. May be null, in which case all panels will lose focus.void closePart(PartDefinition part)
part
- the part to close (remove from the GUI). Must not be null.void setRoot(PerspectiveActivity activity, PanelDefinition root)
PanelDefinition
. Only installs the root panel; does not build the child
panel/part structure recursively.root
- description of the new root panel to install. Must not be null.PanelDefinition getPanelForPlace(PlaceRequest place)
void onPartHidden(PartDefinition part)
part
- that has been hiddenvoid onPartMaximized(PartDefinition part)
part
- the part that has been maximizedvoid onPartMinimized(PartDefinition part)
part
- the part that has been minimizedPartDefinition getFocusedPart()
PartDefinition
Copyright © 2012–2020 JBoss by Red Hat. All rights reserved.