Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2012 JBoss Inc
   *
   * Licensed under the Apache License, Version 2.0 (the "License"); you may not
   * use this file except in compliance with the License. You may obtain a copy of
   * the License at
   *
   * http://www.apache.org/licenses/LICENSE-2.0
   *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  * License for the specific language governing permissions and limitations under
  * the License.
  */
 package org.uberfire.workbench.model;
 
 import java.util.List;
 import java.util.Set;
 
Describes a physical region within a Workbench Perspective. Panels have a set physical size that they occupy, which is divided up between any panel decorations (a tab bar or dropdown list is common), one or more Parts (generally Editors or Screens), one of which can be visible at a time, and also child Panel Definitions, all of which are visible simultaneously.
 
 public interface PanelDefinition {

    
Special value for getPanelType(). When adding a new child panel to a parent panel, if the child panel has this type, the parent can create any type of PanelPresenter it likes. Typically, each panel type will have some constant default child type that it uses in this scenario.
 
     String PARENT_CHOOSES_TYPE = "PARENT_CHOOSES_TYPE";

    
Specifies 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.

Parameters:
id the DOM ID to give the panel when it is created. If null, no ID will be set on the panel.
 
     public void setElementIdfinal String id );

    
Returns 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.
 
     public String getElementId();

    
Specifies 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 a org.uberfire.mvp.PlaceRequest that 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).

Parameters:
part The Part to add. Must not be null. The part's place must specify a WorkbenchActivity bean.
 
     public void addPartfinal PartDefinition part );

    
Specifies 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))).

Parameters:
partSpec An PlaceRequest ID with optional parameters, encoded as specified in org.uberfire.mvp.impl.DefaultPlaceRequest.parse(java.lang.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.
 
     public PartDefinition addPartfinal String partSpec );

    
Removes the given part definition from this panel definition.

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.
 
     public boolean removePartfinal PartDefinition part );

    
Get the Parts contained in the Panel

Returns:
The parts
 
     public Set<PartDefinitiongetParts();

    
Returns this panel's immediate child panels.

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.
    public List<PanelDefinitiongetChildren();

    
Insert 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.

Parameters:
position The Position to add the child
panel The child Panel
    public void insertChildfinal Position position,
                             final PanelDefinition panel );

    
Append 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.

Parameters:
position The Position to add the child
panel The child Panel
    public void appendChildfinal Position position,
                             final PanelDefinition panel );

    
Append 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.

Parameters:
panel The child Panel
    public void appendChild(
                            final PanelDefinition panel );

    
Return the parent panel, or null if isRoot()} returns true.

Returns:
a parent panel definition or null if at the top of the hierarchy
    public PanelDefinition getParent();

    
Get the Panel's immediate child Panel at the given Position

Parameters:
position The child Panel's Position
Returns:
The child Panel or null, if a child does not exist at the given Position
    public PanelDefinition getChildfinal Position position );

    
Remove a child from the Panel

Parameters:
position
    public void removeChildfinal Position position );

    
Is this Panel the root of the Perspective definition

Returns:
True if the Panel is the root
    public boolean isRoot();

    
Specifies the WorkbenchPanelPresenter implementation that should be used when adding this panel to the UI. Must refer to a Dependent-scoped Errai IOC bean type.

Returns:
fully-qualified class name of the WorkbenchPanelPresenter implementation to use. Must not be null, but may be the special value PARENT_CHOOSES_TYPE.
    public String getPanelType();

    
Specifies the WorkbenchPanelPresenter implementation that should be used when adding this panel to the UI. Must refer to a Dependent-scoped Errai IOC bean type.

Parameters:
fqcn fully-qualified class name of the WorkbenchPanelPresenter implementation to use. Must not be null, but may be the special value PARENT_CHOOSES_TYPE.
    public void setPanelTypeString fqcn );

    
Get the height of the Panel in pixels

Returns:
The height, or null if not set
    public Integer getHeight();

    
Set the height of this panel in pixels.

Parameters:
height The height to set. If null, the existing height value is retained.
    public void setHeightInteger height );

    
Get the width of this panel in pixels.

Returns:
The width, or null if not set.
    public Integer getWidth();

    
Set the width of this panel in pixels.

Parameters:
width The width to set. If null, the existing width value is retained.
    public void setWidthInteger width );

    
Get the minimum height of this panel in pixels.

Returns:
The minimum height, or null if not set.
    public Integer getMinHeight();

    
Set the minimum height of the Panel in pixels

Parameters:
minHeight The minimum height, or null if not set
    public void setMinHeightInteger minHeight );

    
Get the minimum width of the Panel in pixels

Returns:
The minimum width, or null if not set
    public Integer getMinWidth();

    
Set the minimum width of the Panel in pixels

Parameters:
minWidth The width, or null if not set
    public void setMinWidthInteger minWidth );

    
Get the Position of the Panel relate 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.

Returns:
The Position of the Panel
    public Position getPosition();

    
Set 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.

Parameters:
position The Position of the Panel relative to it's parent
    public void setPositionPosition position );

    
Has the Panel been expanded to a maximum size

Returns:
true If maximized
    public boolean isMaximized();
    void setContextDefinitionfinal ContextDefinition contextDefinition );
    void setContextDisplayModefinal ContextDisplayMode contextDisplayMode );
New to GrepCode? Check out our FAQ X