Class AbstractDockingWorkbenchPanelView<P extends WorkbenchPanelPresenter>
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Composite
-
- com.google.gwt.user.client.ui.ResizeComposite
-
- org.uberfire.client.workbench.panels.impl.AbstractWorkbenchPanelView<P>
-
- org.uberfire.client.workbench.panels.impl.AbstractDockingWorkbenchPanelView<P>
-
- Type Parameters:
P- the presenter type this view binds to
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers,com.google.gwt.event.shared.HasHandlers,com.google.gwt.user.client.EventListener,com.google.gwt.user.client.ui.HasVisibility,com.google.gwt.user.client.ui.IsRenderable,com.google.gwt.user.client.ui.IsWidget,com.google.gwt.user.client.ui.RequiresResize,org.uberfire.client.mvp.HasPresenter<P>,org.uberfire.client.mvp.UberView<P>,DockingWorkbenchPanelView<P>,WorkbenchPanelView<P>
- Direct Known Subclasses:
AbstractMultiPartWorkbenchPanelView,AbstractSimpleWorkbenchPanelView
public abstract class AbstractDockingWorkbenchPanelView<P extends WorkbenchPanelPresenter> extends AbstractWorkbenchPanelView<P> implements DockingWorkbenchPanelView<P>
Implements the view behaviour required by all docking panel views: adding and removing child panels in the NORTH, SOUTH, EAST, and WEST compass positions.Information for subclassers
The top-level widget of anAbstractDockingWorkbenchPanelViewis alwaystopLevelWidget, a container for child panels, even if this panel doesn't currently have any child panels. This is done so child panels can be inserted and removed without making any assumptions about the parent panel this view is located in (if any!).This means you must always put your part view UI into the widget returned from
getPartViewContainer(). The contents of this container will never be inspected or modified, but the container itself will be reparented as necessary to accommodate child panels being inserted and removed around it. Put another way, do not insert your part view UI directly into the top-level widget of this view! It will get wiped out!This also means you must not call
ResizeComposite.initWidget(Widget). That will always be done by this superclass.
-
-
Field Summary
Fields Modifier and Type Field Description protected WorkbenchDragAndDropManagerdndManagerprotected BeanFactoryfactory-
Fields inherited from class org.uberfire.client.workbench.panels.impl.AbstractWorkbenchPanelView
layoutSelection, panelManager, presenter
-
-
Constructor Summary
Constructors Constructor Description AbstractDockingWorkbenchPanelView()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPanel(org.uberfire.workbench.model.PanelDefinition childPanelDef, WorkbenchPanelView<?> childPanelView, org.uberfire.workbench.model.Position childPosition)ThrowsUnsupportedOperationExceptionwhen called.com.google.gwt.user.client.ui.WidgetgetPartDropRegion()Returns the partViewContainer, which appears to be the "real" on-screen boundary of this widget.protected ResizeFlowPanelgetPartViewContainer()Returns the panel that subclasses should put the part view UI into.com.google.gwt.user.client.ui.WidgetgetWidget()Overridden to ensure subclasses don't return the partViewContainer by mistake (this would interfere with nested docking panels).voidmaximize()Overridden to maximize the widget returned bygetPartViewContainer().booleanremovePanel(WorkbenchPanelView<?> childView)ThrowsUnsupportedOperationExceptionwhen called.booleansetChildSize(WorkbenchPanelView<?> childPanel, int size)Sets the size (width for EAST or WEST children; height for NORTH and SOUTH children) allocated to the specified child by moving its splitter bar on the screen.voidsetElementId(String elementId)Overridden to attach the ID to the part container rather than the top-level widget, which may contain sub-panels and be larger and further up the DOM tree than desired.voidunmaximize()Overridden to matchmaximize().-
Methods inherited from class org.uberfire.client.workbench.panels.impl.AbstractWorkbenchPanelView
addOnFocusHandler, addSelectionHandler, getPresenter, toString
-
Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, initializeClaimedElement, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent
-
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.WorkbenchPanelView
addPart, changeTitle, getParts, getPresenter, removePart, selectPart, setFocus
-
-
-
-
Field Detail
-
dndManager
@Inject protected WorkbenchDragAndDropManager dndManager
-
factory
@Inject protected BeanFactory factory
-
-
Method Detail
-
getWidget
public final com.google.gwt.user.client.ui.Widget getWidget()
Overridden to ensure subclasses don't return the partViewContainer by mistake (this would interfere with nested docking panels).- Overrides:
getWidgetin classcom.google.gwt.user.client.ui.Composite
-
getPartViewContainer
protected ResizeFlowPanel getPartViewContainer()
Returns the panel that subclasses should put the part view UI into.
-
getPartDropRegion
public com.google.gwt.user.client.ui.Widget getPartDropRegion()
Returns the partViewContainer, which appears to be the "real" on-screen boundary of this widget.- Specified by:
getPartDropRegionin interfaceWorkbenchPanelView<P extends WorkbenchPanelPresenter>- Overrides:
getPartDropRegionin classAbstractWorkbenchPanelView<P extends WorkbenchPanelPresenter>- 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.
-
setElementId
public void setElementId(String elementId)
Overridden to attach the ID to the part container rather than the top-level widget, which may contain sub-panels and be larger and further up the DOM tree than desired.- Specified by:
setElementIdin interfaceWorkbenchPanelView<P extends WorkbenchPanelPresenter>- Overrides:
setElementIdin classAbstractWorkbenchPanelView<P extends WorkbenchPanelPresenter>- Parameters:
elementId- the element ID to set. If null, the ID value will be cleared.
-
addPanel
public void addPanel(org.uberfire.workbench.model.PanelDefinition childPanelDef, WorkbenchPanelView<?> childPanelView, org.uberfire.workbench.model.Position childPosition)Description copied from class:AbstractWorkbenchPanelViewThrowsUnsupportedOperationExceptionwhen called. Subclasses that wish to support child panels should override this andAbstractWorkbenchPanelView.removePanel(WorkbenchPanelView).- Specified by:
addPanelin interfaceWorkbenchPanelView<P extends WorkbenchPanelPresenter>- Overrides:
addPanelin classAbstractWorkbenchPanelView<P extends WorkbenchPanelPresenter>- Parameters:
childPanelDef- specifies the size that should be imposed on the nested view. Must not be null. FIXME: is this sensible/correct?childPanelView- the panel to nest inside this one. Must not be null.childPosition- specifies which edge of this panel will be shared with the nested panel. Must not be null.
-
removePanel
public boolean removePanel(WorkbenchPanelView<?> childView)
Description copied from class:AbstractWorkbenchPanelViewThrowsUnsupportedOperationExceptionwhen called. Subclasses that wish to support child panels should override this andAbstractWorkbenchPanelView.addPanel(PanelDefinition, WorkbenchPanelView, Position).- Specified by:
removePanelin interfaceWorkbenchPanelView<P extends WorkbenchPanelPresenter>- Overrides:
removePanelin classAbstractWorkbenchPanelView<P extends WorkbenchPanelPresenter>
-
setChildSize
public boolean setChildSize(WorkbenchPanelView<?> childPanel, int size)
Description copied from interface:DockingWorkbenchPanelViewSets the size (width for EAST or WEST children; height for NORTH and SOUTH children) allocated to the specified child by moving its splitter bar on the screen. 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 interfaceDockingWorkbenchPanelView<P extends WorkbenchPanelPresenter>- Parameters:
childPanel- the panel whose size to change- Returns:
- true if the child was found and its size was adjusted (even if the requested amount was out of range); false if the given child was not found as a child of this panel.
-
maximize
public void maximize()
Overridden to maximize the widget returned bygetPartViewContainer().- Specified by:
maximizein interfaceWorkbenchPanelView<P extends WorkbenchPanelPresenter>- Overrides:
maximizein classAbstractWorkbenchPanelView<P extends WorkbenchPanelPresenter>
-
unmaximize
public void unmaximize()
Overridden to matchmaximize().- Specified by:
unmaximizein interfaceWorkbenchPanelView<P extends WorkbenchPanelPresenter>- Overrides:
unmaximizein classAbstractWorkbenchPanelView<P extends WorkbenchPanelPresenter>
-
-