|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.gwtext.client.widgets.Component
com.gwtext.client.widgets.BoxComponent
com.gwtext.client.widgets.Container
com.gwtext.client.widgets.Panel
public class Panel
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.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 |
---|
public Panel()
public Panel(java.lang.String title)
title
- the titlepublic Panel(java.lang.String title, java.lang.String html)
public Panel(java.lang.String title, int width, int height)
protected Panel(com.google.gwt.core.client.JavaScriptObject jsObj)
public Panel(com.google.gwt.user.client.Element element)
element
- the elementMethod Detail |
---|
protected com.google.gwt.core.client.JavaScriptObject getConfigPrototype()
getConfigPrototype
in class Container
public java.lang.String getXType()
Component
TextField field = new TextField();
field.getXType() returns "textfield"
getXType
in class Container
protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject config)
create
in class Container
public void addButton(Button button)
button
- the button to addpublic void collapse()
public void collapse(boolean animate)
animate
- True to animate the transition, else false (defaults to the value of the animCollapse panel config)public void expand()
public void expand(boolean animate)
animate
- True to animate the transition, else false (defaults to the value of the animCollapse panel config)public ExtElement getBody()
public ExtElement getFooter()
public ExtElement getHeader()
public ExtElement getBodyWrap()
public Toolbar getBottomToolbar()
public int getFrameHeight()
getInnerHeight()
.
public int getFrameWidth()
getInnerWidth()
.
public int getInnerHeight()
getFrameHeight()
.
public int getInnerWidth()
getFrameWidth()
.
public Toolbar getTopToolbar()
public UpdateManager getUpdateManager()
public void load(java.lang.String url)
url
- the url to load the content frompublic void load(java.lang.String url, UrlParam[] params, UrlLoadCallback callback, boolean loadScripts)
url
- the url to load the content fromparams
- the request URL paramscallback
- callback functionloadScripts
- whether to execute scripts from the laoded content.public void setTitle(java.lang.String title, java.lang.String iconCls)
title
- the titleiconCls
- A CSS class that provides the icon image for this panelpublic void toggleCollapse()
public void toggleCollapse(boolean animate)
animate
- true to animatepublic void addListener(PanelListener listener)
listener
- the listenerpublic void setAnimCollapse(boolean animCollapse)
animCollapse
- Defaults to true if the Fx
class is available, otherwise falsepublic boolean isAnimCollapse()
public void setAutoLoad(java.lang.String url)
url
- the URL to load the panel's contentpublic void setAutoLoad(java.lang.String url, UrlLoadConfig loadConfig) throws java.lang.IllegalStateException
url
- the URL to load the panel's contentloadConfig
- the URL load configuration
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setAutoScroll(boolean autoScroll) throws java.lang.IllegalStateException
autoScroll
- Defaults to false
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean isAutoScroll()
public void setBaseCls(java.lang.String baseCls) throws java.lang.IllegalStateException
baseCls
- Defaults to 'x-panel'
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic java.lang.String getBaseCls()
public void setBodyBorder(boolean bodyBorder) throws java.lang.IllegalStateException
bodyBorder
- Defaults to true
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean isBodyBorder()
public void setBorder(boolean border) throws java.lang.IllegalStateException
border
- Defaults to true
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean isBorder()
public void setPaddings(int padding) throws java.lang.IllegalStateException
padding
- the padding value in pixels
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setPaddings(int top, int left, int right, int bottom) throws java.lang.IllegalStateException
top
- the top paddingleft
- left paddingright
- right paddingbottom
- bottom padding
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setMargins(int margin) throws java.lang.IllegalStateException
margin
- the padding value in pixels
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setMargins(int top, int left, int right, int bottom) throws java.lang.IllegalStateException
top
- the top paddingleft
- left paddingright
- right paddingbottom
- bottom padding
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setBodyStyle(java.lang.String bodyStyle) throws java.lang.IllegalStateException
BaseElement.applyStyles(String)
bodyStyle
- Defaults to null
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic java.lang.String getBodyStyle()
BaseElement.applyStyles(String)
public void setButtonAlign(Position buttonAlign) throws java.lang.IllegalStateException
Position.RIGHT
, Position.LEFT
, Position.CENTER
.
buttonAlign
- Defaults to Position.RIGHT
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setButtons(Button[] buttons) throws java.lang.IllegalStateException
buttons
- Array of Button
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setClosable(boolean closable) throws java.lang.IllegalStateException
closable
- true if closable
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean isClosable()
public void setCollapseFirst(boolean collapseFirst) throws java.lang.IllegalStateException
collapseFirst
- Defaults to true
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean getCollapseFirst()
public void setCollapsed(boolean collapsed)
collapsed
- Defaults to falsepublic boolean isCollapsed()
public void setCollapsedCls(java.lang.String collapsedCls) throws java.lang.IllegalStateException
collapsedCls
- Defaults to 'x-panel-collapsed'
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic java.lang.String getCollapsedCls()
public void setCollapsible(boolean collapsible) throws java.lang.IllegalStateException
collapsible
- Defaults to false
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean isCollapsible()
public void setContentEl(com.google.gwt.user.client.Element contentEl) throws java.lang.IllegalStateException
contentEl
- Defaults to null
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setDraggable(boolean draggable) throws java.lang.IllegalStateException
draggable
- true to enable dragging of this panel
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setFloating(boolean floating) throws java.lang.IllegalStateException
floating
- Defaults to false
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean getFloating()
public void setFooter(boolean footer) throws java.lang.IllegalStateException
footer
- true to create footer
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setFrame(boolean frame) throws java.lang.IllegalStateException
frame
- Defaults to false
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean isFrame()
public void setHeader(boolean header) throws java.lang.IllegalStateException
header
- true to create header
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean isHeader()
public void setHeaderAsText(boolean headerAsText)
headerAsText
- Defaults to truepublic boolean isHeaderAsText()
public void setHideCollapseTool(boolean hideCollapseTool) throws java.lang.IllegalStateException
hideCollapseTool
- Defaults to false
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean isHideCollapseTool()
public void setHtml(java.lang.String html)
html
- Defaults to ""public java.lang.String getHtml()
public void setIconCls(java.lang.String iconCls)
iconCls
- Defaults to ""public java.lang.String getIconCls()
public void setMaskDisabled(boolean maskDisabled) throws java.lang.IllegalStateException
maskDisabled
- Defaults to true
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean isMaskDisabled()
public void setMinButtonWidth(int minButtonWidth) throws java.lang.IllegalStateException
minButtonWidth
- Defaults to 75
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic int getMinButtonWidth() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setShadow(boolean shadow)
shadow
- true to display shadowpublic void setShadow(Shadow.Type shadow)
shadow
- true to display shadowShadow.SIDES
,
Shadow.FRAME
,
Shadow.DROP
public boolean isShadow()
public void setShadowOffset(int shadowOffset) throws java.lang.IllegalStateException
shadowOffset
- Defaults to 4
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic int getShadowOffset()
public void setShim(boolean shim) throws java.lang.IllegalStateException
shim
- Defaults to true
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean isShim()
public void setTopToolbar(Toolbar toolbar) throws java.lang.IllegalStateException
toolbar
- the toolbar
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setTopToolbar(Button button) throws java.lang.IllegalStateException
button
- the button
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setTopToolbar(Button[] buttons) throws java.lang.IllegalStateException
getTopToolbar()
and then add Bottons directly to the toolbar.
buttons
- the buttons
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setBottomToolbar(Toolbar toolbar)
toolbar
- the toolbarpublic void setBottomToolbar(Button button) throws java.lang.IllegalStateException
getBottomToolbar()
and then add Bottons directly to the toolbar.
button
- the button
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setBottomToolbar(Button[] buttons) throws java.lang.IllegalStateException
getBottomToolbar()
and then add Bottons directly to the toolbar.
buttons
- the buttons
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setTabCls(java.lang.String tabCls)
tabCls
- the tabCls
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic java.lang.String getTabCls()
public void setTitle(java.lang.String title)
setTitle
in class Component
title
- Defaults to ""public java.lang.String getTitle()
getTitle
in class Component
public void setTitleCollapse(boolean titleCollapse) throws java.lang.IllegalStateException
titleCollapse
- Defaults to false
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean isTitleCollapse()
public void addTool(Tool tool) throws java.lang.IllegalStateException
tool
- the tool to add
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setTools(Tool[] tools) throws java.lang.IllegalStateException
tools
- the tools to add
java.lang.IllegalStateException
- this property cannot be changed after the Component has been rendered
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |