com.gwtext.client.widgets
Class Panel

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.gwtext.client.widgets.Component
              extended by com.gwtext.client.widgets.BoxComponent
                  extended by com.gwtext.client.widgets.Container
                      extended by com.gwtext.client.widgets.Panel
All Implemented Interfaces:
com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasWidgets, Observable, java.lang.Iterable
Direct Known Subclasses:
ChartPanel, FieldSet, FocusPanel, FormPanel, GridPanel, HTMLPanel, MapPanel, MultiFieldPanel, PaddedPanel, Portal, Portlet, TabPanel, Tip, TreePanel, Window

public class Panel
extends Container

Panel is a container that has specific functionality and structural components that make it the perfect building block for application-oriented user interfaces. The Panel contains bottom and top toolbars, along with separate header, footer and body sections. It also provides built-in expandable and collapsible behavior, along with a variety of prebuilt tool buttons that can be wired up to provide other customized behavior. Panels can be easily dropped into any Container or layout, and the layout and rendering pipeline is completely managed by the framework.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.gwtext.client.widgets.Component
config, id
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
  Panel()
          Create a new Panel.
  Panel(com.google.gwt.user.client.Element element)
          Applys the Panel to an existing element.
protected Panel(com.google.gwt.core.client.JavaScriptObject jsObj)
           
  Panel(java.lang.String title)
          Construct a new Panel with the given title.
  Panel(java.lang.String title, int width, int height)
           
  Panel(java.lang.String title, java.lang.String html)
           
 
Method Summary
 void addButton(Button button)
          Adds a button to this panel.
 void addListener(PanelListener listener)
          Add a Panel listener.
 void addTool(Tool tool)
          The tool to be added to the header tool area.
 void collapse()
          Collapses the panel body so that it becomes hidden.
 void collapse(boolean animate)
          Collapses the panel body so that it becomes hidden.
protected  com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject config)
           
 void expand()
          Expands the panel body so that it becomes visible.
 void expand(boolean animate)
          Expands the panel body so that it becomes visible.
 java.lang.String getBaseCls()
          The base CSS class to apply to this panel's element.
 ExtElement getBody()
          The Panel's body Element which may be used to contain HTML content.
 java.lang.String getBodyStyle()
          Custom CSS styles to be applied to the body element in the format expected by BaseElement.applyStyles(String)
 ExtElement getBodyWrap()
          The wrapper element for the body of the Panel.
 Toolbar getBottomToolbar()
          Returns the toolbar from the bottom section of the panel.
 java.lang.String getCollapsedCls()
          A CSS class to add to the panel's element after it has been collapsed.
 boolean getCollapseFirst()
          True to make sure the collapse/expand toggle button always renders first (to the left of) any other tools in the panel's title bar, false to render it last.
protected  com.google.gwt.core.client.JavaScriptObject getConfigPrototype()
           
 boolean getFloating()
          True to float the panel (absolute position it with automatic shimming and shadow), false to display it inline where it is rendered.
 ExtElement getFooter()
          The Panel's footer Element.
 int getFrameHeight()
          Returns the height in pixels of the framing elements of this panel (including any top and bottom bars and header and footer elements, but not including the body height).
 int getFrameWidth()
          Returns the width in pixels of the framing elements of this panel (not including the body width).
 ExtElement getHeader()
          The Panel's header Element.
 java.lang.String getHtml()
          An HTML fragment, or a DomHelper specification to use as the panel's body content.
 java.lang.String getIconCls()
           
 int getInnerHeight()
          Returns the height in pixels of the body element (not including the height of any framing elements).
 int getInnerWidth()
          Returns the width in pixels of the body element (not including the width of any framing elements).
 int getMinButtonWidth()
          Minimum width in pixels of all buttons in this panel.
 int getShadowOffset()
          The number of pixels to offset the shadow if displayed.
 java.lang.String getTabCls()
          Return the tab CSS Class.
 java.lang.String getTitle()
          The title text to display in the panel header.
 Toolbar getTopToolbar()
          Returns the toolbar from the top section of the panel.
 UpdateManager getUpdateManager()
          Get the UpdateManager for this panel.
 java.lang.String getXType()
          Gets the xtype for this component as registered with ComponentMgr.
 boolean isAnimCollapse()
          True to animate the transition when the panel is collapsed, false to skip the animation.
 boolean isAutoScroll()
          True to use overflow:'auto' on the panel's body element and show scroll bars automatically when necessary, false to clip any overflowing content.
 boolean isBodyBorder()
           
 boolean isBorder()
          True to display the borders of the panel's body element, false to hide them.
 boolean isClosable()
          Whether the Panel is closable.
 boolean isCollapsed()
          True if panel collapsed, false if expanded.
 boolean isCollapsible()
          True to make the panel collapsible and have the expand/collapse toggle button automatically rendered into the header tool button area, false to keep the panel statically sized with no button.
 boolean isFrame()
           
 boolean isHeader()
          True to create the header element explicitly, false to skip creating it.
 boolean isHeaderAsText()
           
 boolean isHideCollapseTool()
          True to hide the expand/collapse toggle button when collapsible = true, false to display it.
 boolean isMaskDisabled()
           
 boolean isShadow()
          True to display a shadow behind the panel, false to display no shadow (defaults to 'sides').
 boolean isShim()
          False to disable the iframe shim in browsers which need one.
 boolean isTitleCollapse()
           
 void load(java.lang.String url)
          Loads this content panel immediately with content returned from an XHR call.
 void load(java.lang.String url, UrlParam[] params, UrlLoadCallback callback, boolean loadScripts)
          Loads this content panel immediately with content returned from an XHR call.
 void setAnimCollapse(boolean animCollapse)
          True to animate the transition when the panel is collapsed, false to skip the animation.
 void setAutoLoad(java.lang.String url)
          If set, the panel will attempt to load its contents from the specified URL immediately upon render.
 void setAutoLoad(java.lang.String url, UrlLoadConfig loadConfig)
          If set, the panel will attempt to load its contents from the specified URL immediately upon render.
 void setAutoScroll(boolean autoScroll)
          True to use overflow:'auto' on the panel's body element and show scroll bars automatically when necessary, false to clip any overflowing content.
 void setBaseCls(java.lang.String baseCls)
          The base CSS class to apply to this panel's element.
 void setBodyBorder(boolean bodyBorder)
          True to display an interior border on the body element of the panel, false to hide it.
 void setBodyStyle(java.lang.String bodyStyle)
          Custom CSS styles to be applied to the body element in the format expected by BaseElement.applyStyles(String)
 void setBorder(boolean border)
          True to display the borders of the panel's body element, false to hide them.
 void setBottomToolbar(Button button)
          The bottom toolbar of the panel.
 void setBottomToolbar(Button[] buttons)
          The bottom toolbar of the panel.
 void setBottomToolbar(Toolbar toolbar)
          The bottom toolbar of the panel.
 void setButtonAlign(Position buttonAlign)
          The alignment of any buttons added to this panel.
 void setButtons(Button[] buttons)
          Used to add buttons to the footer of this panel.
 void setClosable(boolean closable)
          Whether the Panel is closable.
 void setCollapsed(boolean collapsed)
          True if panel collapsed, false if expanded
 void setCollapsedCls(java.lang.String collapsedCls)
          A CSS class to add to the panel's element after it has been collapsed.
 void setCollapseFirst(boolean collapseFirst)
          True to make sure the collapse/expand toggle button always renders first (to the left of) any other tools in the panel's title bar, false to render it last.
 void setCollapsible(boolean collapsible)
          True to make the panel collapsible and have the expand/collapse toggle button automatically rendered into the header tool button area, false to keep the panel statically sized with no button.
 void setContentEl(com.google.gwt.user.client.Element contentEl)
          The id of an existing HTML node to use as the panel's body content
 void setDraggable(boolean draggable)
          True to enable dragging of this Panel (defaults to false).
 void setFloating(boolean floating)
          True to float the panel (absolute position it with automatic shimming and shadow), false to display it inline where it is rendered.
 void setFooter(boolean footer)
          True to create the footer element explicitly, false to skip creating it.
 void setFrame(boolean frame)
          True to render the panel with custom rounded borders, false to render with plain 1px square borders.
 void setHeader(boolean header)
          True to create the header element explicitly, false to skip creating it.
 void setHeaderAsText(boolean headerAsText)
          True to display the panel title in the header, false to hide it

Note: This property cannot be changed after the Component has been rendered.
 void setHideCollapseTool(boolean hideCollapseTool)
          True to hide the expand/collapse toggle button when collapsible = true, false to display it.
 void setHtml(java.lang.String html)
          An HTML fragment, or a DomHelper specification to use as the panel's body content.
 void setIconCls(java.lang.String iconCls)
          A CSS class that will provide a background image to be used as the panel header icon
 void setMargins(int margin)
          Set padding on all sides.
 void setMargins(int top, int left, int right, int bottom)
          Set paddings to Panel.
 void setMaskDisabled(boolean maskDisabled)
          True to mask the panel when it is disabled, false to not mask it.
 void setMinButtonWidth(int minButtonWidth)
          Minimum width in pixels of all buttons in this panel.
 void setPaddings(int padding)
          Set padding on all sides.
 void setPaddings(int top, int left, int right, int bottom)
          Set paddings to Panel.
 void setShadow(boolean shadow)
          True to display a shadow behind the panel, false to display no shadow (defaults to 'sides').
 void setShadow(Shadow.Type shadow)
          Set the shadow behind the Panel.
 void setShadowOffset(int shadowOffset)
          The number of pixels to offset the shadow if displayed.
 void setShim(boolean shim)
          False to disable the iframe shim in browsers which need one.
 void setTabCls(java.lang.String tabCls)
          Set the tab CSS Class.
 void setTitle(java.lang.String title)
          The title text to display in the panel header.
 void setTitle(java.lang.String title, java.lang.String iconCls)
          Sets the title text for the panel and optioanlly the icon class.
 void setTitleCollapse(boolean titleCollapse)
          True to allow expanding and collapsing the panel (when collapsible = true) by clicking anywhere in the header bar, false to allow it only by clicking to tool button
 void setTools(Tool[] tools)
          The tools to be added to the header tool area.
 void setTopToolbar(Button button)
          The top toolbar of the panel.
 void setTopToolbar(Button[] buttons)
          The top toolbar of the panel.
 void setTopToolbar(Toolbar toolbar)
          The top toolbar of the panel.
 void toggleCollapse()
          Shortcut for performing an expand or collapse based on the current state of the panel.
 void toggleCollapse(boolean animate)
          Shortcut for performing an expand or collapse based on the current state of the panel.
 
Methods inherited from class com.gwtext.client.widgets.Container
add, add, add, add, addListener, bubble, cascade, clear, doLayout, doLayout, findBy, findByID, findByType, getActiveItem, getActiveItemID, getAutoDestroy, getBufferResize, getComponent, getComponent, getComponents, getHideBorders, getItems, getLayout, getMonitorResize, insert, iterator, remove, remove, remove, remove, removeAll, removeAll, setActiveItem, setActiveItemID, setAutoDestroy, setBufferResize, setDefaults, setHideBorders, setLayout, setMonitorResize
 
Methods inherited from class com.gwtext.client.widgets.BoxComponent
addListener, doOnRender, doOnRender, getAutoHeight, getAutoWidth, getBox, getBox, getHeight, getPosition, getPosition, getSize, getWidth, setAutoHeight, setAutoWidth, setHeight, setHeight, setPagePosition, setPosition, setSize, setSize, setWidth, setWidth, syncSize, updateBox
 
Methods inherited from class com.gwtext.client.widgets.Component
addClass, addClassCreated, addEvent, addEvents, addListener, addListener, addListener, addPlugin, addStyleDependentName, addStyleName, afterRender, beforeDestroy, check, checkExtVer, cloneComponent, cloneComponent, cloneConfig, destroy, disable, enable, equals, error, findParentBy, findParentByType, fireEvent, focus, focus, focus, focus, getApplyTo, getAttribute, getAttributeAsBoolean, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAutoShow, getCls, getComponentJS, getConfig, getConfigAsString, getCtCls, getDisabledClass, getEl, getElement, getElement, getElement, getHideMode, getHideParent, getId, getItemId, getJsObj, getOffsetHeight, getOffsetWidth, getOrCreateJsObj, getOwnerContainer, getRenderTo, getStateEvents, getStateId, getXTypes, hashCode, hide, initComponent, isCreated, isDisabled, isHidden, isRendered, isVisible, isXType, isXType, onDestroy, purgeListeners, removeClass, removeStyleDependentName, removeStyleName, render, render, render, render, render, render, resumeEvents, setApplyTo, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAutoEl, setAutoEl, setAutoShow, setCls, setCtCls, setDisabled, setDisabledClass, setEl, setEl, setElement, setHideMode, setHideParent, setId, setRenderTo, setRenderToID, setStateEvents, setStateId, setStyle, setStyle, setStyleName, setStylePrimaryName, setVisible, show, suspendEvents, toString
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, setElement, setPixelSize, setStyleName, setStyleName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Panel

public Panel()
Create a new Panel.


Panel

public Panel(java.lang.String title)
Construct a new Panel with the given title.

Parameters:
title - the title

Panel

public Panel(java.lang.String title,
             java.lang.String html)

Panel

public Panel(java.lang.String title,
             int width,
             int height)

Panel

protected Panel(com.google.gwt.core.client.JavaScriptObject jsObj)

Panel

public Panel(com.google.gwt.user.client.Element element)
Applys the Panel to an existing element.

Parameters:
element - the element
Method Detail

getConfigPrototype

protected com.google.gwt.core.client.JavaScriptObject getConfigPrototype()
Overrides:
getConfigPrototype in class Container

getXType

public java.lang.String getXType()
Description copied from class: Component
Gets the xtype for this component as registered with ComponentMgr. For a list of all available xtypes, see the Component javadocs.

 
 

TextField field = new TextField(); field.getXType() returns "textfield"

Overrides:
getXType in class Container
Returns:
the xtype

create

protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject config)
Overrides:
create in class Container

addButton

public void addButton(Button button)
Adds a button to this panel. Note that this method must be called prior to rendering. The preferred approach is to add buttons via the buttons config.

Parameters:
button - the button to add

collapse

public void collapse()
Collapses the panel body so that it becomes hidden. Fires the beforecollapse event which will cancel the collapse action if it returns false.


collapse

public void collapse(boolean animate)
Collapses the panel body so that it becomes hidden. Fires the beforecollapse event which will cancel the collapse action if it returns false.

Parameters:
animate - True to animate the transition, else false (defaults to the value of the animCollapse panel config)

expand

public void expand()
Expands the panel body so that it becomes visible. Fires the beforeexpand event which will cancel the expand action if it returns false.


expand

public void expand(boolean animate)
Expands the panel body so that it becomes visible. Fires the beforeexpand event which will cancel the expand action if it returns false.

Parameters:
animate - True to animate the transition, else false (defaults to the value of the animCollapse panel config)

getBody

public ExtElement getBody()
The Panel's body Element which may be used to contain HTML content. The content may be specified in the html config, or it may be loaded using the autoLoad config, or through the Panel's Updater.
If this is used to load visible HTML elements in either way, then the Panel may not be used as a Layout for hosting nested Panels.
If this Panel is intended to be used as the host of a Layout (See layout then the body Element must not be loaded or changed - it is under the control of the Panel's Layout.

Returns:
the body element

getFooter

public ExtElement getFooter()
The Panel's footer Element. This Element is used to house the Panel's buttons.

Returns:
the footer element

getHeader

public ExtElement getHeader()
The Panel's header Element. This Element is used to house the title and tools

Returns:
the header element

getBodyWrap

public ExtElement getBodyWrap()
The wrapper element for the body of the Panel.

Returns:
the wrapper element for the body of the Panel

getBottomToolbar

public Toolbar getBottomToolbar()
Returns the toolbar from the bottom section of the panel.

Returns:
the bottom toolbar

getFrameHeight

public int getFrameHeight()
Returns the height in pixels of the framing elements of this panel (including any top and bottom bars and header and footer elements, but not including the body height). To retrieve the body height see getInnerHeight().

Returns:
the frame hieght

getFrameWidth

public int getFrameWidth()
Returns the width in pixels of the framing elements of this panel (not including the body width). To retrieve the body width see getInnerWidth().

Returns:
the frame width

getInnerHeight

public int getInnerHeight()
Returns the height in pixels of the body element (not including the height of any framing elements). For the frame height see getFrameHeight() .

Returns:
the inner height

getInnerWidth

public int getInnerWidth()
Returns the width in pixels of the body element (not including the width of any framing elements). For the frame width see getFrameWidth() .

Returns:
the inner width

getTopToolbar

public Toolbar getTopToolbar()
Returns the toolbar from the top section of the panel.

Returns:
the top toolbar

getUpdateManager

public UpdateManager getUpdateManager()
Get the UpdateManager for this panel. Enables you to perform Ajax updates of this panel's body.

Returns:
the UpdateManager

load

public void load(java.lang.String url)
Loads this content panel immediately with content returned from an XHR call.

Parameters:
url - the url to load the content from

load

public void load(java.lang.String url,
                 UrlParam[] params,
                 UrlLoadCallback callback,
                 boolean loadScripts)
Loads this content panel immediately with content returned from an XHR call.

Parameters:
url - the url to load the content from
params - the request URL params
callback - callback function
loadScripts - whether to execute scripts from the laoded content.

setTitle

public void setTitle(java.lang.String title,
                     java.lang.String iconCls)
Sets the title text for the panel and optioanlly the icon class.

Parameters:
title - the title
iconCls - A CSS class that provides the icon image for this panel

toggleCollapse

public void toggleCollapse()
Shortcut for performing an expand or collapse based on the current state of the panel.


toggleCollapse

public void toggleCollapse(boolean animate)
Shortcut for performing an expand or collapse based on the current state of the panel.

Parameters:
animate - true to animate

addListener

public void addListener(PanelListener listener)
Add a Panel listener.

Parameters:
listener - the listener

setAnimCollapse

public void setAnimCollapse(boolean animCollapse)
True to animate the transition when the panel is collapsed, false to skip the animation.

Parameters:
animCollapse - Defaults to true if the Fx class is available, otherwise false

isAnimCollapse

public boolean isAnimCollapse()
True to animate the transition when the panel is collapsed, false to skip the animation.

Returns:
true to animate the transition when the panel is collapsed, false to skip the animation

setAutoLoad

public void setAutoLoad(java.lang.String url)
If set, the panel will attempt to load its contents from the specified URL immediately upon render.

The URL will become the default URL for this panel's body element, so it may be refreshed at any time.

Parameters:
url - the URL to load the panel's content

setAutoLoad

public void setAutoLoad(java.lang.String url,
                        UrlLoadConfig loadConfig)
                 throws java.lang.IllegalStateException
If set, the panel will attempt to load its contents from the specified URL immediately upon render.

The URL will become the default URL for this panel's body element, so it may be refreshed at any time.

Parameters:
url - the URL to load the panel's content
loadConfig - the URL load configuration
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setAutoScroll

public void setAutoScroll(boolean autoScroll)
                   throws java.lang.IllegalStateException
True to use overflow:'auto' on the panel's body element and show scroll bars automatically when necessary, false to clip any overflowing content.

Parameters:
autoScroll - Defaults to false
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

isAutoScroll

public boolean isAutoScroll()
True to use overflow:'auto' on the panel's body element and show scroll bars automatically when necessary, false to clip any overflowing content.

Returns:
true to autoscroll

setBaseCls

public void setBaseCls(java.lang.String baseCls)
                throws java.lang.IllegalStateException
The base CSS class to apply to this panel's element.

Parameters:
baseCls - Defaults to 'x-panel'
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getBaseCls

public java.lang.String getBaseCls()
The base CSS class to apply to this panel's element.

Returns:
the base CSS class to apply to this panel's element. Defaults to 'x-panel'

setBodyBorder

public void setBodyBorder(boolean bodyBorder)
                   throws java.lang.IllegalStateException
True to display an interior border on the body element of the panel, false to hide it. This only applies when border == true. If border == true and bodyBorder == false, the border will display as a 1px wide inset border, giving the entire body element an inset appearance.

Parameters:
bodyBorder - Defaults to true
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

isBodyBorder

public boolean isBodyBorder()
Returns:
true to display an interior border on the body element of the panel, false to hide it.

setBorder

public void setBorder(boolean border)
               throws java.lang.IllegalStateException
True to display the borders of the panel's body element, false to hide them. By default, the border is a 2px wide inset border, but this can be further altered by setting bodyBorder to false.

Parameters:
border - Defaults to true
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

isBorder

public boolean isBorder()
True to display the borders of the panel's body element, false to hide them. By default, the border is a 2px wide inset border, but this can be further altered by setting bodyBorder to false.

Returns:
true to display the borders of the panel's body element, false to hide them.

setPaddings

public void setPaddings(int padding)
                 throws java.lang.IllegalStateException
Set padding on all sides.

Parameters:
padding - the padding value in pixels
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setPaddings

public void setPaddings(int top,
                        int left,
                        int right,
                        int bottom)
                 throws java.lang.IllegalStateException
Set paddings to Panel.

Parameters:
top - the top padding
left - left padding
right - right padding
bottom - bottom padding
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setMargins

public void setMargins(int margin)
                throws java.lang.IllegalStateException
Set padding on all sides.

Parameters:
margin - the padding value in pixels
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setMargins

public void setMargins(int top,
                       int left,
                       int right,
                       int bottom)
                throws java.lang.IllegalStateException
Set paddings to Panel.

Parameters:
top - the top padding
left - left padding
right - right padding
bottom - bottom padding
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setBodyStyle

public void setBodyStyle(java.lang.String bodyStyle)
                  throws java.lang.IllegalStateException
Custom CSS styles to be applied to the body element in the format expected by BaseElement.applyStyles(String)

Parameters:
bodyStyle - Defaults to null
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getBodyStyle

public java.lang.String getBodyStyle()
Custom CSS styles to be applied to the body element in the format expected by BaseElement.applyStyles(String)

Returns:
the custom CSS styles to be applied to the body element

setButtonAlign

public void setButtonAlign(Position buttonAlign)
                    throws java.lang.IllegalStateException
The alignment of any buttons added to this panel. Valid values are Position.RIGHT, Position.LEFT, Position.CENTER.

Parameters:
buttonAlign - Defaults to Position.RIGHT
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setButtons

public void setButtons(Button[] buttons)
                throws java.lang.IllegalStateException
Used to add buttons to the footer of this panel.

Parameters:
buttons - Array of Button
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setClosable

public void setClosable(boolean closable)
                 throws java.lang.IllegalStateException
Whether the Panel is closable. This is applicable when a Panel is added to a TabPanel.

Parameters:
closable - true if closable
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

isClosable

public boolean isClosable()
Whether the Panel is closable. This is applicable when a Panel is added to a TabPanel.

Returns:
true if the Panel is closable

setCollapseFirst

public void setCollapseFirst(boolean collapseFirst)
                      throws java.lang.IllegalStateException
True to make sure the collapse/expand toggle button always renders first (to the left of) any other tools in the panel's title bar, false to render it last.

Parameters:
collapseFirst - Defaults to true
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getCollapseFirst

public boolean getCollapseFirst()
True to make sure the collapse/expand toggle button always renders first (to the left of) any other tools in the panel's title bar, false to render it last.

Returns:
true to make sure the collapse/expand toggle button always renders first

setCollapsed

public void setCollapsed(boolean collapsed)
True if panel collapsed, false if expanded

Parameters:
collapsed - Defaults to false

isCollapsed

public boolean isCollapsed()
True if panel collapsed, false if expanded.

Returns:
true to render the panel expanded, false to render it collapsed

setCollapsedCls

public void setCollapsedCls(java.lang.String collapsedCls)
                     throws java.lang.IllegalStateException
A CSS class to add to the panel's element after it has been collapsed.

Parameters:
collapsedCls - Defaults to 'x-panel-collapsed'
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getCollapsedCls

public java.lang.String getCollapsedCls()
A CSS class to add to the panel's element after it has been collapsed.

Returns:
the CSS class to add to the panel's element after it has been collapsed.

setCollapsible

public void setCollapsible(boolean collapsible)
                    throws java.lang.IllegalStateException
True to make the panel collapsible and have the expand/collapse toggle button automatically rendered into the header tool button area, false to keep the panel statically sized with no button.

Parameters:
collapsible - Defaults to false
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

isCollapsible

public boolean isCollapsible()
True to make the panel collapsible and have the expand/collapse toggle button automatically rendered into the header tool button area, false to keep the panel statically sized with no button.

Returns:
true to make the panel collapsible and have the expand/collapse toggle button automatically rendered into the header tool button area, false to keep the panel statically sized with no button

setContentEl

public void setContentEl(com.google.gwt.user.client.Element contentEl)
                  throws java.lang.IllegalStateException
The id of an existing HTML node to use as the panel's body content

Parameters:
contentEl - Defaults to null
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setDraggable

public void setDraggable(boolean draggable)
                  throws java.lang.IllegalStateException
True to enable dragging of this Panel (defaults to false).

Parameters:
draggable - true to enable dragging of this panel
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setFloating

public void setFloating(boolean floating)
                 throws java.lang.IllegalStateException
True to float the panel (absolute position it with automatic shimming and shadow), false to display it inline where it is rendered. Note that by default, setting floating to true will cause the panel to display at negative offsets so that it is hidden -- because the panel is absolute positioned, the position must be set explicitly after render (e.g., myPanel.setPosition(100,100);). Also, when floating a panel you should always assign a fixed width, otherwise it will be auto width and will expand to fill to the right edge of the viewport.

Parameters:
floating - Defaults to false
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getFloating

public boolean getFloating()
True to float the panel (absolute position it with automatic shimming and shadow), false to display it inline where it is rendered. Note that by default, setting floating to true will cause the panel to display at negative offsets so that it is hidden -- because the panel is absolute positioned, the position must be set explicitly after render (e.g., myPanel.setPosition(100,100);). Also, when floating a panel you should always assign a fixed width, otherwise it will be auto width and will expand to fill to the right edge of the viewport.

Returns:
true to float panel, false to display it inline where it is rendered

setFooter

public void setFooter(boolean footer)
               throws java.lang.IllegalStateException
True to create the footer element explicitly, false to skip creating it. By default, when footer is not specified, if one or more buttons have been added to the panel the footer will be created automatically, otherwise it will not.

Parameters:
footer - true to create footer
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setFrame

public void setFrame(boolean frame)
              throws java.lang.IllegalStateException
True to render the panel with custom rounded borders, false to render with plain 1px square borders.

Parameters:
frame - Defaults to false
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

isFrame

public boolean isFrame()
Returns:
true to render the panel with custom rounded borders

setHeader

public void setHeader(boolean header)
               throws java.lang.IllegalStateException
True to create the header element explicitly, false to skip creating it. By default, when header is not specified, if a title is set the header will be created automatically, otherwise it will not. If a title is set but header is explicitly set to false, the header will not be rendered.

Parameters:
header - true to create header
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

isHeader

public boolean isHeader()
True to create the header element explicitly, false to skip creating it. By default, when header is not specified, if a title is set the header will be created automatically, otherwise it will not. If a title is set but header is explicitly set to false, the header will not be rendered.

Returns:
true to create header

setHeaderAsText

public void setHeaderAsText(boolean headerAsText)
True to display the panel title in the header, false to hide it

Note: This property cannot be changed after the Component has been rendered.

Parameters:
headerAsText - Defaults to true

isHeaderAsText

public boolean isHeaderAsText()
Returns:
true to display the panel title in the header, false to hide it

setHideCollapseTool

public void setHideCollapseTool(boolean hideCollapseTool)
                         throws java.lang.IllegalStateException
True to hide the expand/collapse toggle button when collapsible = true, false to display it.

Parameters:
hideCollapseTool - Defaults to false
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

isHideCollapseTool

public boolean isHideCollapseTool()
True to hide the expand/collapse toggle button when collapsible = true, false to display it.

Returns:
true to hide the expand/collapse toggle button when collapsible = true, false to display it.

setHtml

public void setHtml(java.lang.String html)
An HTML fragment, or a DomHelper specification to use as the panel's body content.

Parameters:
html - Defaults to ""

getHtml

public java.lang.String getHtml()
An HTML fragment, or a DomHelper specification to use as the panel's body content.

Returns:
the HTML fragment, or a DomHelper specification to use as the panel's body content.

setIconCls

public void setIconCls(java.lang.String iconCls)
A CSS class that will provide a background image to be used as the panel header icon

Parameters:
iconCls - Defaults to ""

getIconCls

public java.lang.String getIconCls()
Returns:
the CSS class that will provide a background image to be used as the panel header icon

setMaskDisabled

public void setMaskDisabled(boolean maskDisabled)
                     throws java.lang.IllegalStateException
True to mask the panel when it is disabled, false to not mask it. Either way, the panel will always tell its contained elements to disable themselves when it is disabled, but masking the panel can provide an additional visual cue that the panel is disabled.

Parameters:
maskDisabled - Defaults to true
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

isMaskDisabled

public boolean isMaskDisabled()
Returns:
true to mask the panel when it is disabled, false to not mask it.

setMinButtonWidth

public void setMinButtonWidth(int minButtonWidth)
                       throws java.lang.IllegalStateException
Minimum width in pixels of all buttons in this panel.

Parameters:
minButtonWidth - Defaults to 75
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getMinButtonWidth

public int getMinButtonWidth()
                      throws java.lang.IllegalStateException
Minimum width in pixels of all buttons in this panel.

Returns:
the minimum width in pixels of all buttons in this panel.
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setShadow

public void setShadow(boolean shadow)
True to display a shadow behind the panel, false to display no shadow (defaults to 'sides'). Note that this option only applies when floating = true.

Parameters:
shadow - true to display shadow

setShadow

public void setShadow(Shadow.Type shadow)
Set the shadow behind the Panel. Note that this option only applies when floating = true.

Parameters:
shadow - true to display shadow
See Also:
Shadow.SIDES, Shadow.FRAME, Shadow.DROP

isShadow

public boolean isShadow()
True to display a shadow behind the panel, false to display no shadow (defaults to 'sides').

Returns:
true to display a shadow behind the panel, false to display no shadow (defaults to 'sides').

setShadowOffset

public void setShadowOffset(int shadowOffset)
                     throws java.lang.IllegalStateException
The number of pixels to offset the shadow if displayed. Note that this option only applies when floating = true.

Parameters:
shadowOffset - Defaults to 4
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getShadowOffset

public int getShadowOffset()
The number of pixels to offset the shadow if displayed. Note that this option only applies when floating = true.

Returns:
the number of pixels to offset the shadow if displayed. Note that this option only applies when floating = true.

setShim

public void setShim(boolean shim)
             throws java.lang.IllegalStateException
False to disable the iframe shim in browsers which need one. Note that this option only applies when floating = true.

Parameters:
shim - Defaults to true
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

isShim

public boolean isShim()
False to disable the iframe shim in browsers which need one. Note that this option only applies when floating = true.

Returns:
false to disable the iframe shim in browsers which need one.

setTopToolbar

public void setTopToolbar(Toolbar toolbar)
                   throws java.lang.IllegalStateException
The top toolbar of the panel. Note that this is not available as a property after render. To access the top toolbar after render, use getTopToolbar.

Parameters:
toolbar - the toolbar
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setTopToolbar

public void setTopToolbar(Button button)
                   throws java.lang.IllegalStateException
The top toolbar of the panel. Note that this is not available as a property after render. To access the top toolbar after render, use getTopToolbar.

Parameters:
button - the button
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setTopToolbar

public void setTopToolbar(Button[] buttons)
                   throws java.lang.IllegalStateException
The top toolbar of the panel. Note that this is not available as a property after render. To access the top toolbar after render, use getTopToolbar.

Note: This property cannot be changed after the Component has been rendered. To add buttons after the Panel has been rendered, call getTopToolbar() and then add Bottons directly to the toolbar.

Parameters:
buttons - the buttons
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setBottomToolbar

public void setBottomToolbar(Toolbar toolbar)
The bottom toolbar of the panel. Note that this is not available as a property after render. To access the bottom toolbar after render, use @link #getBottomToolbar.

Parameters:
toolbar - the toolbar

setBottomToolbar

public void setBottomToolbar(Button button)
                      throws java.lang.IllegalStateException
The bottom toolbar of the panel. Note that this is not available as a property after render. To access the bottom toolbar after render, use @link #getBottomToolbar.

Note: This property cannot be changed after the Component has been rendered. To add buttons after the Panel has been rendered, call getBottomToolbar() and then add Bottons directly to the toolbar.

Parameters:
button - the button
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setBottomToolbar

public void setBottomToolbar(Button[] buttons)
                      throws java.lang.IllegalStateException
The bottom toolbar of the panel. Note that this is not available as a property after render. To access the bottom toolbar after render, use @link #getBottomToolbar.

Note: This property cannot be changed after the Component has been rendered. To add buttons after the Panel has been rendered, call getBottomToolbar() and then add Bottons directly to the toolbar.

Parameters:
buttons - the buttons
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setTabCls

public void setTabCls(java.lang.String tabCls)
Set the tab CSS Class. This method is only applicable it the PAnel is being added to a TabPanel. This CSS class is applied to the <li> elements of the tab in the tabpanel.

Parameters:
tabCls - the tabCls
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getTabCls

public java.lang.String getTabCls()
Return the tab CSS Class.

Returns:
the tabCls

setTitle

public void setTitle(java.lang.String title)
The title text to display in the panel header. When a title is specified the header element will automatically be created and displayed unless header is explicitly set to false. If you don't want to specify a title at config time, but you may want one later, you must either specify a non-empty title (a blank space " " will do) or call setHeader(true) so that the container element will get created.

Overrides:
setTitle in class Component
Parameters:
title - Defaults to ""

getTitle

public java.lang.String getTitle()
The title text to display in the panel header.

Overrides:
getTitle in class Component
Returns:
the title text to display in the panel header.

setTitleCollapse

public void setTitleCollapse(boolean titleCollapse)
                      throws java.lang.IllegalStateException
True to allow expanding and collapsing the panel (when collapsible = true) by clicking anywhere in the header bar, false to allow it only by clicking to tool button

Parameters:
titleCollapse - Defaults to false
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

isTitleCollapse

public boolean isTitleCollapse()
Returns:
true to allow expanding and collapsing the panel (when collapsible = true) by clicking anywhere in the header bar, false to allow it only by clicking to tool button

addTool

public void addTool(Tool tool)
             throws java.lang.IllegalStateException
The tool to be added to the header tool area.

Parameters:
tool - the tool to add
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setTools

public void setTools(Tool[] tools)
              throws java.lang.IllegalStateException
The tools to be added to the header tool area.

Parameters:
tools - the tools to add
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered