Class LayoutPanelView
- java.lang.Object
-
- org.uberfire.client.workbench.panels.impl.LayoutPanelView
-
- All Implemented Interfaces:
com.google.gwt.user.client.ui.IsWidget,com.google.gwt.user.client.ui.RequiresResize,org.uberfire.client.mvp.HasPresenter<LayoutPanelPresenter>,org.uberfire.client.mvp.UberView<LayoutPanelPresenter>,WorkbenchPanelView<LayoutPanelPresenter>
@Dependent @Named("LayoutPanelView") public class LayoutPanelView extends Object implements WorkbenchPanelView<LayoutPanelPresenter>A simpleLayoutPanelpresenter. Can be used for both perspectives and panels. Does not support drag-and-drop.
-
-
Constructor Summary
Constructors Constructor Description LayoutPanelView()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPanel(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.voidaddPart(WorkbenchPartPresenter.View view)Adds the given part view to this panel if this panel does not already contain a view that handles the samePlaceRequestas the given one.com.google.gwt.user.client.ui.WidgetasWidget()voidchangeTitle(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.WidgetgetPartDropRegion()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.LayoutPanelPresentergetPresenter()Returns this view's presenter.voidinit(LayoutPanelPresenter presenter)voidmaximize()Maximizes this view usingWorkbenchLayout.maximize(Widget).voidonResize()booleanremovePanel(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.booleanremovePart(org.uberfire.workbench.model.PartDefinition part)Removes the given part from this view, if it belonged to this view.booleanselectPart(org.uberfire.workbench.model.PartDefinition part)Makes the given part visible and focused, if it belongs to this view.voidsetElementId(String elementId)Sets the ID of the physical root element of this view.voidsetFocus(boolean hasFocus)Informs this view that it has gained or lost keyboard focus.voidunmaximize()Restores this view to its original unmaximized size and position usingWorkbenchLayout.unmaximize(Widget).
-
-
-
Method Detail
-
addPanel
public void addPanel(org.uberfire.workbench.model.PanelDefinition panel, WorkbenchPanelView view, org.uberfire.workbench.model.Position position)Description copied from interface:WorkbenchPanelViewNests 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 differentPositiontypes. Implementations should document whether or not they support child panels, and if so, what types of Positions they understand.- Specified by:
addPanelin interfaceWorkbenchPanelView<LayoutPanelPresenter>- 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.
-
removePanel
public boolean removePanel(WorkbenchPanelView<?> child)
Description copied from interface:WorkbenchPanelViewRemoves 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.- Specified by:
removePanelin interfaceWorkbenchPanelView<LayoutPanelPresenter>
-
asWidget
public com.google.gwt.user.client.ui.Widget asWidget()
- Specified by:
asWidgetin interfacecom.google.gwt.user.client.ui.IsWidget
-
init
public void init(LayoutPanelPresenter presenter)
- Specified by:
initin interfaceorg.uberfire.client.mvp.HasPresenter<LayoutPanelPresenter>
-
getPresenter
public LayoutPanelPresenter getPresenter()
Description copied from interface:WorkbenchPanelViewReturns this view's presenter.- Specified by:
getPresenterin interfaceWorkbenchPanelView<LayoutPanelPresenter>- 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
public void addPart(WorkbenchPartPresenter.View view)
Description copied from interface:WorkbenchPanelViewAdds the given part view to this panel if this panel does not already contain a view that handles the samePlaceRequestas the given one. If this panel does already contain such a part, the existing one isselectedand the given one is not added.- Specified by:
addPartin interfaceWorkbenchPanelView<LayoutPanelPresenter>- Parameters:
view- the view to add as long as it is not a duplicate. Must not be null.
-
removePart
public boolean removePart(org.uberfire.workbench.model.PartDefinition part)
Description copied from interface:WorkbenchPanelViewRemoves the given part from this view, if it belonged to this view.- Specified by:
removePartin interfaceWorkbenchPanelView<LayoutPanelPresenter>- Parameters:
part- the part to remove.- Returns:
- true if the part was found and removed. False if not.
-
selectPart
public boolean selectPart(org.uberfire.workbench.model.PartDefinition part)
Description copied from interface:WorkbenchPanelViewMakes the given part visible and focused, if it belongs to this view.- Specified by:
selectPartin interfaceWorkbenchPanelView<LayoutPanelPresenter>- 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.
-
getParts
public Collection<org.uberfire.workbench.model.PartDefinition> getParts()
Description copied from interface:WorkbenchPanelViewReturns the parts currently held by the view.- Specified by:
getPartsin interfaceWorkbenchPanelView<LayoutPanelPresenter>
-
getPartDropRegion
public com.google.gwt.user.client.ui.Widget getPartDropRegion()
Description copied from interface:WorkbenchPanelViewReturns the widget that defines the boundaries of this panel view for purposes of drag-and-drop.- Specified by:
getPartDropRegionin interfaceWorkbenchPanelView<LayoutPanelPresenter>- 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.
-
setFocus
public void setFocus(boolean hasFocus)
Description copied from interface:WorkbenchPanelViewInforms 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.- Specified by:
setFocusin interfaceWorkbenchPanelView<LayoutPanelPresenter>- Parameters:
hasFocus- if true, this panel now has focus. If false, this panel does not have focus.
-
onResize
public void onResize()
- Specified by:
onResizein interfacecom.google.gwt.user.client.ui.RequiresResize
-
changeTitle
public void changeTitle(org.uberfire.workbench.model.PartDefinition part, String title, com.google.gwt.user.client.ui.IsWidget titleDecoration)Description copied from interface:WorkbenchPanelViewAssigns the given title to the given part, if the part belongs to this panel.- Specified by:
changeTitlein interfaceWorkbenchPanelView<LayoutPanelPresenter>- 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.
-
setElementId
public void setElementId(String elementId)
Description copied from interface:WorkbenchPanelViewSets the ID of the physical root element of this view. For HTML-based views, this is theidattribute 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.- Specified by:
setElementIdin interfaceWorkbenchPanelView<LayoutPanelPresenter>- Parameters:
elementId- the element ID to set. If null, the ID value will be cleared.
-
maximize
public void maximize()
Description copied from interface:WorkbenchPanelViewMaximizes this view usingWorkbenchLayout.maximize(Widget).- Specified by:
maximizein interfaceWorkbenchPanelView<LayoutPanelPresenter>
-
unmaximize
public void unmaximize()
Description copied from interface:WorkbenchPanelViewRestores this view to its original unmaximized size and position usingWorkbenchLayout.unmaximize(Widget).- Specified by:
unmaximizein interfaceWorkbenchPanelView<LayoutPanelPresenter>
-
-