Class PanelDefinitionImpl
- java.lang.Object
-
- org.uberfire.workbench.model.impl.PanelDefinitionImpl
-
- All Implemented Interfaces:
PanelDefinition
- Direct Known Subclasses:
CustomPanelDefinitionImpl
@Portable @JsType public class PanelDefinitionImpl extends Object implements PanelDefinition
Default implementation of PanelDefinition
-
-
Field Summary
-
Fields inherited from interface org.uberfire.workbench.model.PanelDefinition
PARENT_CHOOSES_TYPE
-
-
Constructor Summary
Constructors Constructor Description PanelDefinitionImpl()PanelDefinitionImpl(String type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PartDefinitionaddPart(String partSpec)Specifies content that should be put in this panel's main display area when it is materialized.voidaddPart(PartDefinition part)Specifies content that should be put in this panel's main display area when it is materialized.voidappendChild(PanelDefinition panel)Append a Panel at the first empty child position.voidappendChild(Position position, PanelDefinition panel)Append a Panel at the first empty child position.PanelDefinitiongetChild(Position position)Get the Panel's immediate child Panel at the given PositionList<PanelDefinition>getChildren()Returns this panel's immediate child panels.ContextDefinitiongetContextDefinition()ContextDisplayModegetContextDisplayMode()StringgetElementId()Returns the DOM ID that will be given to a panel created from this definition.IntegergetHeight()Get the height of the Panel in pixelsIntegergetMinHeight()Get the minimum height of this panel in pixels.IntegergetMinWidth()Get the minimum width of the Panel in pixelsStringgetPanelType()Specifies the WorkbenchPanelPresenter implementation that should be used when adding this panel to the UI.PanelDefinitiongetParent()Return the parent panel, or null ifPanelDefinition.isRoot()} returns true.Set<PartDefinition>getParts()Get the Parts contained in the PanelPositiongetPosition()Get the Position of the Panel relate to it's ParentIntegergetWidth()Get the width of this panel in pixels.voidinsertChild(Position position, PanelDefinition panel)Insert a Panel as an immediate child at the given Position.booleanisMaximized()Has the Panel been expanded to a maximum sizebooleanisRoot()Is this Panel the root of the Perspective definitionvoidremoveChild(Position position)Remove a child from the PanelbooleanremovePart(PartDefinition part)Removes the given part definition from this panel definition.voidsetContextDefinition(ContextDefinition contextDefinition)voidsetContextDisplayMode(ContextDisplayMode contextDisplayMode)voidsetElementId(String id)Specifies the DOM ID that should be given to the live panel's element.voidsetHeight(Integer height)Set the height of this panel in pixels.voidsetMinHeight(Integer minHeight)Set the minimum height of the Panel in pixelsvoidsetMinWidth(Integer minWidth)Set the minimum width of the Panel in pixelsvoidsetPanelType(String fqcn)Specifies the WorkbenchPanelPresenter implementation that should be used when adding this panel to the UI.voidsetParent(PanelDefinition parent)voidsetPosition(Position position)Set the Position of the Panel relative to it's parent.voidsetRoot(boolean isRoot)voidsetWidth(Integer width)Set the width of this panel in pixels.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.uberfire.workbench.model.PanelDefinition
asString, getHeightAsInt, getMinHeightAsInt, getMinWidthAsInt, getWidthAsInt, setHeight, setWidth
-
-
-
-
Constructor Detail
-
PanelDefinitionImpl
@JsIgnore public PanelDefinitionImpl()
-
PanelDefinitionImpl
@JsIgnore public PanelDefinitionImpl(String type)
-
-
Method Detail
-
getParent
public PanelDefinition getParent()
Description copied from interface:PanelDefinitionReturn the parent panel, or null ifPanelDefinition.isRoot()} returns true.- Specified by:
getParentin interfacePanelDefinition- Returns:
- a parent panel definition or null if at the top of the hierarchy
-
setParent
public void setParent(PanelDefinition parent)
-
getElementId
public String getElementId()
Description copied from interface:PanelDefinitionReturns the DOM ID that will be given to a panel created from this definition. If null, no ID attribute will be set on a panel created from this definition.- Specified by:
getElementIdin interfacePanelDefinition
-
setElementId
public void setElementId(String id)
Description copied from interface:PanelDefinitionSpecifies the DOM ID that should be given to the live panel's element. Applications are responsible for ensuring the ID values are unique among all live panels.- Specified by:
setElementIdin interfacePanelDefinition- Parameters:
id- the DOM ID to give the panel when it is created. If null, no ID will be set on the panel.
-
addPart
public void addPart(PartDefinition part)
Description copied from interface:PanelDefinitionSpecifies content that should be put in this panel's main display area when it is materialized. The content to add is specified by a PartDefinition, at the core of which is aPlaceRequestthat identifies a WorkbenchActivity (either a screen or an editor).If the given part already belongs to an existing panel, it will be removed from that panel by a call to removePart(part).
- Specified by:
addPartin interfacePanelDefinition- Parameters:
part- The Part to add. Must not be null. The part's place must specify a WorkbenchActivity bean.
-
addPart
public PartDefinition addPart(String partSpec)
Description copied from interface:PanelDefinitionSpecifies content that should be put in this panel's main display area when it is materialized.This is a convenience method equivalent to addPart(new PartDefinitionImpl(DefaultPlaceRequest.parse(partSpec))).
- Specified by:
addPartin interfacePanelDefinition- Parameters:
partSpec- An PlaceRequest ID with optional parameters, encoded as specified inDefaultPlaceRequest.parse(CharSequence). Must not be null. The place ID must specify a WorkbenchActivity bean (either a screen or an editor).- Returns:
- the PartDefinition object that was created and added to this panel definition.
-
removePart
public boolean removePart(PartDefinition part)
Description copied from interface:PanelDefinitionRemoves the given part definition from this panel definition.- Specified by:
removePartin interfacePanelDefinition- Parameters:
part- The Part to be removed- Returns:
- true if the part was found and removed; false if it did not belong to this panel in the first place.
-
getParts
@JsIgnore public Set<PartDefinition> getParts()
Description copied from interface:PanelDefinitionGet the Parts contained in the Panel- Specified by:
getPartsin interfacePanelDefinition- Returns:
- The parts
-
getChildren
@JsIgnore public List<PanelDefinition> getChildren()
Description copied from interface:PanelDefinitionReturns this panel's immediate child panels.- Specified by:
getChildrenin interfacePanelDefinition- Returns:
- a snapshot of the current child list. The list is not modifiable, and will not change as panels are added and removed from this panel. The returned list is never null.
-
insertChild
public void insertChild(Position position, PanelDefinition panel)
Description copied from interface:PanelDefinitionInsert a Panel as an immediate child at the given Position. If this Panel already has a child at the specified position the existing Panel at that position becomes a child of the Panel being added at the same Position.- Specified by:
insertChildin interfacePanelDefinition- Parameters:
position- The Position to add the childpanel- The child Panel
-
appendChild
public void appendChild(Position position, PanelDefinition panel)
Description copied from interface:PanelDefinitionAppend a Panel at the first empty child position. If this Panel already has a child at the specified position the descendants are followed until an empty position is found.- Specified by:
appendChildin interfacePanelDefinition- Parameters:
position- The Position to add the childpanel- The child Panel
-
appendChild
public void appendChild(PanelDefinition panel)
Description copied from interface:PanelDefinitionAppend a Panel at the first empty child position. If this Panel already has a child at the specified position the descendants are followed until an empty position is found.- Specified by:
appendChildin interfacePanelDefinition- Parameters:
panel- The child Panel
-
getChild
public PanelDefinition getChild(Position position)
Description copied from interface:PanelDefinitionGet the Panel's immediate child Panel at the given Position- Specified by:
getChildin interfacePanelDefinition- Parameters:
position- The child Panel's Position- Returns:
- The child Panel or null, if a child does not exist at the given Position
-
removeChild
public void removeChild(Position position)
Description copied from interface:PanelDefinitionRemove a child from the Panel- Specified by:
removeChildin interfacePanelDefinition
-
isRoot
public boolean isRoot()
Description copied from interface:PanelDefinitionIs this Panel the root of the Perspective definition- Specified by:
isRootin interfacePanelDefinition- Returns:
- True if the Panel is the root
-
setRoot
public void setRoot(boolean isRoot)
-
getPanelType
public String getPanelType()
Description copied from interface:PanelDefinitionSpecifies the WorkbenchPanelPresenter implementation that should be used when adding this panel to the UI. Must refer to a Dependent-scoped Errai IOC bean type.- Specified by:
getPanelTypein interfacePanelDefinition- Returns:
- fully-qualified class name of the WorkbenchPanelPresenter implementation to use. Must not be null, but
may be the special value
PanelDefinition.PARENT_CHOOSES_TYPE.
-
setPanelType
public void setPanelType(String fqcn)
Description copied from interface:PanelDefinitionSpecifies the WorkbenchPanelPresenter implementation that should be used when adding this panel to the UI. Must refer to a Dependent-scoped Errai IOC bean type.- Specified by:
setPanelTypein interfacePanelDefinition- Parameters:
fqcn- fully-qualified class name of the WorkbenchPanelPresenter implementation to use. Must not be null, but may be the special valuePanelDefinition.PARENT_CHOOSES_TYPE.
-
getHeight
@JsIgnore public Integer getHeight()
Description copied from interface:PanelDefinitionGet the height of the Panel in pixels- Specified by:
getHeightin interfacePanelDefinition- Returns:
- The height, or null if not set
-
setHeight
@JsIgnore public void setHeight(Integer height)
Description copied from interface:PanelDefinitionSet the height of this panel in pixels.- Specified by:
setHeightin interfacePanelDefinition- Parameters:
height- The height to set. If null, the existing height value is retained.
-
getWidth
@JsIgnore public Integer getWidth()
Description copied from interface:PanelDefinitionGet the width of this panel in pixels.- Specified by:
getWidthin interfacePanelDefinition- Returns:
- The width, or null if not set.
-
setWidth
@JsIgnore public void setWidth(Integer width)
Description copied from interface:PanelDefinitionSet the width of this panel in pixels.- Specified by:
setWidthin interfacePanelDefinition- Parameters:
width- The width to set. If null, the existing width value is retained.
-
getMinHeight
@JsIgnore public final Integer getMinHeight()
Description copied from interface:PanelDefinitionGet the minimum height of this panel in pixels.- Specified by:
getMinHeightin interfacePanelDefinition- Returns:
- The minimum height, or null if not set.
-
setMinHeight
@JsIgnore public final void setMinHeight(Integer minHeight)
Description copied from interface:PanelDefinitionSet the minimum height of the Panel in pixels- Specified by:
setMinHeightin interfacePanelDefinition- Parameters:
minHeight- The minimum height, or null if not set
-
getMinWidth
@JsIgnore public final Integer getMinWidth()
Description copied from interface:PanelDefinitionGet the minimum width of the Panel in pixels- Specified by:
getMinWidthin interfacePanelDefinition- Returns:
- The minimum width, or null if not set
-
setMinWidth
@JsIgnore public final void setMinWidth(Integer minWidth)
Description copied from interface:PanelDefinitionSet the minimum width of the Panel in pixels- Specified by:
setMinWidthin interfacePanelDefinition- Parameters:
minWidth- The width, or null if not set
-
getPosition
public final Position getPosition()
Description copied from interface:PanelDefinitionGet the Position of the Panel relate to it's ParentTODO remove this. parent panels should track the positions of their children; making it a property of the child is error-prone when moving panels around in the UI.
- Specified by:
getPositionin interfacePanelDefinition- Returns:
- The Position of the Panel
-
setPosition
public void setPosition(Position position)
Description copied from interface:PanelDefinitionSet the Position of the Panel relative to it's parent.TODO remove this. parent panels should track the positions of their children; making it a property of the child is error-prone when moving panels around in the UI.
- Specified by:
setPositionin interfacePanelDefinition- Parameters:
position- The Position of the Panel relative to it's parent
-
isMaximized
public boolean isMaximized()
Description copied from interface:PanelDefinitionHas the Panel been expanded to a maximum size- Specified by:
isMaximizedin interfacePanelDefinition- Returns:
- true If maximized
-
getContextDefinition
public ContextDefinition getContextDefinition()
- Specified by:
getContextDefinitionin interfacePanelDefinition
-
setContextDefinition
public void setContextDefinition(ContextDefinition contextDefinition)
- Specified by:
setContextDefinitionin interfacePanelDefinition
-
getContextDisplayMode
public ContextDisplayMode getContextDisplayMode()
- Specified by:
getContextDisplayModein interfacePanelDefinition
-
setContextDisplayMode
public void setContextDisplayMode(ContextDisplayMode contextDisplayMode)
- Specified by:
setContextDisplayModein interfacePanelDefinition
-
-