public interface WorkbenchPanelView<P extends WorkbenchPanelPresenter> extends UberView<P>, com.google.gwt.user.client.ui.RequiresResize
WorkbenchPanelPresenter
.
UberFire Panel Views are Dependent-scoped beans managed by the Errai IOC container. Views are always created by injection into their presenter, which ties their bean lifecycle to that of the presenter: they are created when the presenter is created, and they are destroyed when the presenter is destroyed.
This is the lifecycle of a WorkbenchPanelView:
@PostConstruct
method (if it has one) is invoked by Errai IOC. Safe to access injected members.
HasPresenter.init(Object)
method is invoked by the presenter. The argument is a reference to the presenter itself.
IsWidget.asWidget()
) is added to the parent panel's widget.
@PreDestroy
method is invoked by Errai IOC.
Modifier and Type | Method and Description |
---|---|
void |
addPanel(PanelDefinition panel,
WorkbenchPanelView<?> view,
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(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<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(PartDefinition part)
Removes the given part from this view, if it belonged to this view.
|
boolean |
selectPart(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) . |
init
P getPresenter()
HasPresenter.init(Object)
; afterward, the return value is never null.void addPart(WorkbenchPartPresenter.View view)
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.view
- the view to add as long as it is not a duplicate. Must not be null.void addPanel(PanelDefinition panel, WorkbenchPanelView<?> view, Position position)
Position
types. Implementations should document whether or not they
support child panels, and if so, what types of Positions they understand.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.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.boolean removePanel(WorkbenchPanelView<?> child)
void changeTitle(PartDefinition part, String title, com.google.gwt.user.client.ui.IsWidget titleDecoration)
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.boolean selectPart(PartDefinition part)
part
- the part to reveal and give focus to.boolean removePart(PartDefinition part)
part
- the part to remove.void setFocus(boolean hasFocus)
hasFocus
- if true, this panel now has focus. If false, this panel does not have focus.void setElementId(String elementId)
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.elementId
- the element ID to set. If null, the ID value will be cleared.com.google.gwt.user.client.ui.Widget getPartDropRegion()
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.
void maximize()
WorkbenchLayout.maximize(Widget)
.void unmaximize()
WorkbenchLayout.unmaximize(Widget)
.Collection<PartDefinition> getParts()
Copyright © 2012–2020 JBoss by Red Hat. All rights reserved.