@ApplicationScoped public class PanelManagerImpl extends Object implements PanelManager
PanelManager
.Modifier and Type | Field and Description |
---|---|
protected PartDefinition |
activePart |
protected Map<PanelDefinition,com.google.gwt.user.client.ui.HasWidgets> |
customPanels
Remembers which HasWidgets contains each existing custom panel.
|
protected Map<PanelDefinition,org.jboss.errai.common.client.dom.HTMLElement> |
customPanelsInsideHTMLElements
Remembers which HTMLElements contain each existing custom panel.
|
protected org.jboss.errai.ioc.client.container.SyncBeanManager |
iocManager |
protected Map<PanelDefinition,WorkbenchPanelPresenter> |
mapPanelDefinitionToPresenter |
protected Map<PartDefinition,WorkbenchPartPresenter> |
mapPartDefinitionToPresenter |
protected javax.enterprise.event.Event<PanelFocusEvent> |
panelFocusEvent |
protected javax.enterprise.event.Event<PlaceGainFocusEvent> |
placeGainFocusEvent |
protected javax.enterprise.event.Event<PlaceHiddenEvent> |
placeHiddenEvent |
protected javax.enterprise.event.Event<PlaceLostFocusEvent> |
placeLostFocusEvent |
protected javax.enterprise.inject.Instance<PlaceManager> |
placeManager |
protected javax.enterprise.event.Event<PlaceMaximizedEvent> |
placeMaximizedEvent |
protected javax.enterprise.event.Event<PlaceMinimizedEvent> |
placeMinimizedEvent |
protected PanelDefinition |
rootPanelDef
Description that the current root panel was created from.
|
protected javax.enterprise.event.Event<SelectPlaceEvent> |
selectPlaceEvent |
Constructor and Description |
---|
PanelManagerImpl(javax.enterprise.event.Event<PlaceGainFocusEvent> placeGainFocusEvent,
javax.enterprise.event.Event<PlaceLostFocusEvent> placeLostFocusEvent,
javax.enterprise.event.Event<PanelFocusEvent> panelFocusEvent,
javax.enterprise.event.Event<SelectPlaceEvent> selectPlaceEvent,
javax.enterprise.event.Event<PlaceMaximizedEvent> placeMaximizedEvent,
javax.enterprise.event.Event<PlaceMinimizedEvent> placeMinimizedEventEvent,
javax.enterprise.event.Event<PlaceHiddenEvent> placeHiddenEvent,
org.jboss.errai.ioc.client.container.SyncBeanManager iocManager,
javax.enterprise.inject.Instance<PlaceManager> placeManager,
LayoutSelection layoutSelection,
BeanFactory beanFactory) |
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.
|
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 partDef,
PanelDefinition panelDef,
Menus menus,
UIPart uiPart,
String contextId,
Integer preferredWidth,
Integer preferredHeight)
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.
|
protected BeanFactory |
getBeanFactory() |
PanelDefinition |
getPanelForPlace(PlaceRequest place)
Returns the first PanelDefinition whose place matches the given one.
|
protected PartDefinition |
getPartForPlace(PlaceRequest place)
Returns the first live (associated with an active presenter) PartDefinition 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) |
protected void |
removePart(PartDefinition part)
Destroys the presenter bean associated with the given part and removes the part's presenter from the panel
presenter that contains it (which in turn removes the part definition from the panel definition and the part view
from the panel view).
|
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 . |
protected final Map<PartDefinition,WorkbenchPartPresenter> mapPartDefinitionToPresenter
protected final Map<PanelDefinition,WorkbenchPanelPresenter> mapPanelDefinitionToPresenter
protected final Map<PanelDefinition,com.google.gwt.user.client.ui.HasWidgets> customPanels
protected final Map<PanelDefinition,org.jboss.errai.common.client.dom.HTMLElement> customPanelsInsideHTMLElements
protected javax.enterprise.event.Event<PlaceGainFocusEvent> placeGainFocusEvent
protected javax.enterprise.event.Event<PlaceLostFocusEvent> placeLostFocusEvent
protected javax.enterprise.event.Event<PanelFocusEvent> panelFocusEvent
protected javax.enterprise.event.Event<SelectPlaceEvent> selectPlaceEvent
protected javax.enterprise.event.Event<PlaceMaximizedEvent> placeMaximizedEvent
protected javax.enterprise.event.Event<PlaceMinimizedEvent> placeMinimizedEvent
protected javax.enterprise.event.Event<PlaceHiddenEvent> placeHiddenEvent
protected org.jboss.errai.ioc.client.container.SyncBeanManager iocManager
protected javax.enterprise.inject.Instance<PlaceManager> placeManager
protected PanelDefinition rootPanelDef
protected PartDefinition activePart
@Inject public PanelManagerImpl(javax.enterprise.event.Event<PlaceGainFocusEvent> placeGainFocusEvent, javax.enterprise.event.Event<PlaceLostFocusEvent> placeLostFocusEvent, javax.enterprise.event.Event<PanelFocusEvent> panelFocusEvent, javax.enterprise.event.Event<SelectPlaceEvent> selectPlaceEvent, javax.enterprise.event.Event<PlaceMaximizedEvent> placeMaximizedEvent, javax.enterprise.event.Event<PlaceMinimizedEvent> placeMinimizedEventEvent, javax.enterprise.event.Event<PlaceHiddenEvent> placeHiddenEvent, org.jboss.errai.ioc.client.container.SyncBeanManager iocManager, javax.enterprise.inject.Instance<PlaceManager> placeManager, LayoutSelection layoutSelection, BeanFactory beanFactory)
protected BeanFactory getBeanFactory()
public PanelDefinition getRoot()
PanelManager
getRoot
in interface PanelManager
public void setRoot(PerspectiveActivity activity, PanelDefinition root)
PanelManager
PanelDefinition
. Only installs the root panel; does not build the child
panel/part structure recursively.setRoot
in interface PanelManager
root
- description of the new root panel to install. Must not be null.public void addWorkbenchPart(PlaceRequest place, PartDefinition partDef, PanelDefinition panelDef, Menus menus, UIPart uiPart, String contextId, Integer preferredWidth, Integer preferredHeight)
PanelManager
SelectPlaceEvent
with the given PlaceRequest
once the part has been added.addWorkbenchPart
in interface PanelManager
place
- The PlaceRequest that the part was resolved from. Not null.partDef
- The description of the part to add. Not null.panelDef
- 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?)preferredWidth
- 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.preferredHeight
- 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.public boolean removePartForPlace(PlaceRequest toRemove)
PanelManager
removePartForPlace
in interface PanelManager
toRemove
- the place that is closing. Must not be null.public PanelDefinition addWorkbenchPanel(PanelDefinition targetPanel, Position position, Integer height, Integer width, Integer minHeight, Integer minWidth)
PanelManager
TODO: the usefulness of this method to callers is questionable (versus creating a new child panel definition and
calling PanelManager.addWorkbenchPanel(PanelDefinition, PanelDefinition, Position)
). candidate for deletion.
addWorkbenchPanel
in interface PanelManager
public void removeWorkbenchPanel(PanelDefinition toRemove) throws IllegalStateException
PanelManager
removeWorkbenchPanel
in interface PanelManager
toRemove
- the panel to remove from the workbench layout. Must not be null.IllegalStateException
- if the panel contains parts or child panelspublic void onPartFocus(PartDefinition part)
onPartFocus
in interface PanelManager
public void onPartMaximized(PartDefinition part)
onPartMaximized
in interface PanelManager
part
- the part that has been maximizedpublic void onPartMinimized(PartDefinition part)
onPartMinimized
in interface PanelManager
part
- the part that has been minimizedpublic void onPartHidden(PartDefinition part)
onPartHidden
in interface PanelManager
part
- that has been hiddenpublic void onPartLostFocus()
onPartLostFocus
in interface PanelManager
public void onPanelFocus(PanelDefinition panel)
PanelManager
onPanelFocus
in interface PanelManager
panel
- the panel to give focus to. May be null, in which case all panels will lose focus.public void closePart(PartDefinition part)
PanelManager
closePart
in interface PanelManager
part
- the part to close (remove from the GUI). Must not be null.public PanelDefinition getPanelForPlace(PlaceRequest place)
PanelManager
getPanelForPlace
in interface PanelManager
protected PartDefinition getPartForPlace(PlaceRequest place)
protected void removePart(PartDefinition part)
part
- the definition of the workbench part (screen or editor) to remove from the layout.public PanelDefinition addWorkbenchPanel(PanelDefinition targetPanel, PanelDefinition childPanel, Position position)
PanelManager
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.addWorkbenchPanel
in interface PanelManager
public CustomPanelDefinition addCustomPanel(com.google.gwt.user.client.ui.HasWidgets container, String panelType)
PanelManager
Custom panels can be disposed like any other panel: by calling PanelManager.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.
addCustomPanel
in interface PanelManager
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.public CustomPanelDefinition addCustomPanel(org.jboss.errai.common.client.dom.HTMLElement container, String panelType)
PanelManager
Custom panels can be disposed like any other panel: by calling PanelManager.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.
addCustomPanel
in interface PanelManager
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.Copyright © 2012–2019 JBoss by Red Hat. All rights reserved.