|
|||||||||
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.extjs.gxt.ui.client.widget.Component
com.extjs.gxt.ui.client.widget.BoxComponent
com.extjs.gxt.ui.client.widget.Container<T>
com.extjs.gxt.ui.client.widget.ScrollContainer<Component>
com.extjs.gxt.ui.client.widget.LayoutContainer
com.extjs.gxt.ui.client.widget.ContentPanel
public class ContentPanel
ContentPanel is a component 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 pre-built tool buttons that can be wired up to provide other customized behavior. Code snippet:
ContentPanel cp = new ContentPanel(); cp.setHeading("Folder Contents"); cp.setSize(250, 140); cp.setPosition(10, 10); cp.setCollapsible(true); cp.setFrame(true); cp.setBodyStyle("backgroundColor: white;"); cp.getHeader().addTool(new ToolButton("x-tool-gear")); cp.getHeader().addTool(new ToolButton("x-tool-close")); cp.addText(getBogusText()); cp.addButton(new Button("Ok")); cp.setIconStyle("tree-folder-open"); RootPanel.get().add(cp); cp.layout();
BaseEvent.setCancelled(boolean)
.BaseEvent.setCancelled(boolean)
.BaseEvent.setCancelled(boolean)
.
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 | |
---|---|
protected java.lang.String |
bbarStyle
|
protected java.lang.String |
bodStyle
|
protected El |
body
|
protected El |
bwrap
|
protected java.lang.String |
bwrapStyle
|
protected java.lang.String |
collapseStyle
|
protected ButtonBar |
fbar
|
protected java.lang.String |
footerStyle
|
protected boolean |
frame
|
protected Header |
head
|
protected java.lang.String |
headerStyle
|
protected java.lang.String |
headerTextStyle
|
protected java.lang.String |
tbarStyle
|
Fields inherited from class com.extjs.gxt.ui.client.widget.Container |
---|
attachChildren, enableLayout, layoutExecuted, layoutNeeded, layoutOnAttach, layoutOnChange |
Fields inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
---|
adjustSize, cacheSizes, ensureVisibilityOnSizing, height, lastSize, layer, shim, width |
Fields inherited from class com.extjs.gxt.ui.client.widget.Component |
---|
afterRender, attachables, baseStyle, disabled, disabledStyle, disableTextSelection, dummy, focusable, hidden, mask, maskMessage, maskMessageStyleName, monitorWindowResize, rendered, resizeHandler, setElementRender, stateId, swallowEvents, toolTip, windowResizeDelay, windowResizeTask |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
ContentPanel()
Creates a new panel instance. |
|
ContentPanel(Layout layout)
Creates a new content panel. |
Method Summary | |
---|---|
void |
addButton(Button button)
Adds a button the the panel. |
protected Size |
adjustBodySize()
|
protected void |
afterCollapse()
|
protected void |
afterExpand()
|
void |
collapse()
Collapses the panel body so that it becomes hidden. |
protected void |
createStyles(java.lang.String baseStyle)
|
protected void |
doAttachChildren()
|
protected void |
doDetachChildren()
|
void |
expand()
Expands the panel body so that it becomes visible. |
boolean |
getAnimCollapse()
Returns true if animation is enabled for expand / collapse. |
El |
getBody()
Returns the panel's body element. |
boolean |
getBodyBorder()
Returns true if the body border is enabled. |
java.lang.String |
getBodyStyle()
Returns the body style. |
Component |
getBottomComponent()
Returns the panel's bottom component. |
Style.HorizontalAlignment |
getButtonAlign()
Returns the panel's button alignment. |
ButtonBar |
getButtonBar()
|
ToolButton |
getCollapseBtn()
Returns the panel's collapse button. |
boolean |
getCollapsible()
Returns true if the panel is collapsible. |
com.google.gwt.user.client.Element |
getElement(java.lang.String name)
Provides access to internal elements. |
boolean |
getFrame()
Returns true if framing is enabled. |
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). |
protected Size |
getFrameSize()
|
int |
getFrameWidth()
Returns the width in pixels of the framing elements of this panel (not including the body width). |
Header |
getHeader()
Returns the panel's header. |
java.lang.String |
getHeading()
Returns the panel's heading. |
com.google.gwt.user.client.ui.AbstractImagePrototype |
getIcon()
Returns the panel's icon style. |
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). |
El |
getLayoutTarget()
Override this method to specify the element to be used by the layout as the container. |
int |
getMinButtonWidth()
|
boolean |
getTitleCollapse()
|
java.lang.String |
getTitleText()
Deprecated. use getHeading() |
Component |
getTopComponent()
Returns the panels top component. |
protected void |
initTools()
|
boolean |
isCollapsed()
Returns true if the panel is collapsed. |
boolean |
isExpanded()
Returns true if the panel is expanded. |
boolean |
isFooter()
Returns true if the footer is enabled. |
boolean |
isHeaderVisible()
Returns true if the header is visible. |
boolean |
isHideCollapseTool()
Returns true if the collapse tool is hidden. |
protected void |
layoutBars()
|
protected void |
notifyHide()
|
protected void |
notifyShow()
|
protected void |
onClick(ComponentEvent ce)
|
protected void |
onCollapse()
|
void |
onComponentEvent(ComponentEvent ce)
Any events a component receives will be forwarded to this method. |
protected void |
onDisable()
|
protected void |
onEnable()
|
protected void |
onExpand()
|
protected void |
onRender(com.google.gwt.user.client.Element parent,
int pos)
Subclasses must override and ensure setElement is called for lazy rendered components. |
protected void |
onResize(int width,
int height)
Called after the component is resized, this method is empty by default but can be implemented by any subclass that needs to perform custom logic after a resize occurs. |
protected boolean |
remove(Component item)
Removes the item from the container. |
void |
setAnimCollapse(boolean animCollapse)
Sets whether expand and collapse is animating (defaults to true, pre-render). |
void |
setBodyBorder(boolean bodyBorder)
True to display the borders of the panel's body element, false to hide them (defaults to true, pre-render). |
void |
setBodyStyle(java.lang.String bodyStyle)
Custom CSS styles to be applied to the body element in the format expected by El.applyStyles(java.lang.String) (pre-render). |
void |
setBodyStyleName(java.lang.String style)
A style name that is added to the panel's body element (pre-render). |
void |
setBottomComponent(Component bottomComponent)
Sets the panel's bottom component (pre-render). |
void |
setButtonAlign(Style.HorizontalAlignment buttonAlign)
Sets the button alignment of any buttons added to this panel (defaults to RIGHT, pre-render). |
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 (defaults to false, pre-render). |
void |
setExpanded(boolean expanded)
Sets the panel's expand state. |
void |
setFooter(boolean footer)
True to create the footer element explicitly, false to skip creating it (pre-render). |
void |
setFrame(boolean frame)
True to render the panel with custom rounded borders, false to render with plain 1px square borders (defaults to false, pre-render). |
void |
setHeaderVisible(boolean headerVisible)
True to create the header element explicitly, false to skip creating it (defaults to true, pre-render). |
void |
setHeading(java.lang.String text)
Sets the title text for the panel. |
void |
setHideCollapseTool(boolean hideCollapseTool)
Sets whether the collapse tool should be displayed when the panel is collapsible. |
void |
setIcon(com.google.gwt.user.client.ui.AbstractImagePrototype icon)
Sets the item's icon style. |
void |
setIconStyle(java.lang.String icon)
Sets the icon style. |
void |
setInsetBorder(boolean insetBorder)
Deprecated. behavior not implemented |
void |
setMinButtonWidth(int minButtonWidth)
|
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 (defaults to false, pre-render). |
void |
setTopComponent(Component topComponent)
Sets the panel's top component (pre-render). |
com.google.gwt.user.client.ui.Frame |
setUrl(java.lang.String url)
Adds the content from the given url. |
Methods inherited from class com.extjs.gxt.ui.client.widget.LayoutContainer |
---|
add, add, addText, findComponent, getLayout, getWindowResizeDelay, insert, insert, isLayoutOnChange, isMonitorWindowResize, layout, layout, onBlur, onFocus, remove, removeAll, setLayout, setLayoutData, setLayoutOnChange, setMonitorWindowResize, setWindowResizeDelay |
Methods inherited from class com.extjs.gxt.ui.client.widget.ScrollContainer |
---|
addScrollListener, afterRender, getHScrollPosition, getScrollMode, getVScrollPosition, removeScrollListener, scrollIntoView, setHScrollPosition, setScrollMode, setVScrollPosition |
Methods inherited from class com.extjs.gxt.ui.client.widget.Container |
---|
add, adjustIndex, adopt, createContainerEvent, disable, doLayout, doLayout, enable, findItem, getItem, getItemByItemId, getItemCount, getItems, getWidget, indexOf, insert, isLayoutNeeded, iterator, onAfterLayout, onAttach, onBeforeLayoutExcecuted, onInsert, onLayoutExcecuted, onRemove, orphan, remove, removeAll, scrollIntoView, setLayoutNeeded, wrapWidget |
Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
---|
adjustPosition, adjustSize, createComponentEvent, getBounds, getHeight, getHeight, getPosition, getPositionEl, getResizeEl, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, hideShadow, hideShim, hideUnders, isAutoHeight, isAutoWidth, isDeferHeight, isShim, onHide, onPosition, onShow, onUnload, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShadowOffset, setShadowPosition, setShim, setSize, setSize, setWidth, setWidth, sync, syncSize |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, setLayoutData |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String bodStyle
protected El body
protected El bwrap
protected java.lang.String bwrapStyle
protected java.lang.String collapseStyle
protected ButtonBar fbar
protected boolean frame
protected Header head
protected java.lang.String headerStyle
protected java.lang.String footerStyle
protected java.lang.String headerTextStyle
protected java.lang.String tbarStyle
protected java.lang.String bbarStyle
Constructor Detail |
---|
public ContentPanel()
public ContentPanel(Layout layout)
layout
- the panel's layoutMethod Detail |
---|
public void addButton(Button button)
button
- the button to addpublic void collapse()
public void expand()
public boolean getAnimCollapse()
public El getBody()
public boolean getBodyBorder()
public java.lang.String getBodyStyle()
public Component getBottomComponent()
public Style.HorizontalAlignment getButtonAlign()
public ButtonBar getButtonBar()
public ToolButton getCollapseBtn()
public boolean getCollapsible()
public com.google.gwt.user.client.Element getElement(java.lang.String name)
Valid values are:
name
- the element name
public boolean getFrame()
public int getFrameHeight()
getInnerHeight()
.
public int getFrameWidth()
getInnerWidth()
.
public Header getHeader()
public java.lang.String getHeading()
public com.google.gwt.user.client.ui.AbstractImagePrototype getIcon()
getIcon
in interface IconSupport
public int getInnerHeight()
getFrameHeight()
.
public int getInnerWidth()
getFrameWidth()
.
public El getLayoutTarget()
LayoutContainer
getLayoutTarget
in class LayoutContainer
public int getMinButtonWidth()
public boolean getTitleCollapse()
public java.lang.String getTitleText()
getHeading()
public Component getTopComponent()
public boolean isCollapsed()
public boolean isExpanded()
true
if the panel is expanded.
public boolean isFooter()
public boolean isHeaderVisible()
public boolean isHideCollapseTool()
public void onComponentEvent(ComponentEvent ce)
Component
Component.onBrowserEvent(com.google.gwt.user.client.Event)
method
should not be overridden or modified.
onComponentEvent
in class LayoutContainer
ce
- the base eventpublic void setAnimCollapse(boolean animCollapse)
animCollapse
- true to enable animationspublic void setBodyBorder(boolean bodyBorder)
bodyBorder
- true for a body borderpublic void setBodyStyle(java.lang.String bodyStyle)
El.applyStyles(java.lang.String)
(pre-render).
bodyStyle
- the body stylepublic void setBodyStyleName(java.lang.String style)
style
- the style namepublic void setBottomComponent(Component bottomComponent)
bottomComponent
- the bottom componentpublic void setButtonAlign(Style.HorizontalAlignment buttonAlign)
buttonAlign
- the button alignmentpublic void setCollapsible(boolean collapsible)
collapsible
- the collapsible to setpublic void setExpanded(boolean expanded)
expanded
- true true to expand
public void setFooter(boolean footer)
footer
- the footer statepublic void setFrame(boolean frame)
frame
- true to use the frame stylepublic void setHeaderVisible(boolean headerVisible)
setHeading(String)
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.
headerVisible
- true to show the headerpublic void setHeading(java.lang.String text)
text
- the title textpublic void setHideCollapseTool(boolean hideCollapseTool)
hideCollapseTool
- true if the tool is hiddenpublic void setIcon(com.google.gwt.user.client.ui.AbstractImagePrototype icon)
<code> .my-icon { background: url(images/icons/my-icon.png) no-repeat center left !important; } </code>
setIcon
in interface IconSupport
icon
- the iconpublic void setIconStyle(java.lang.String icon)
IconSupport
setIconStyle
in interface IconSupport
icon
- a CSS style namepublic void setInsetBorder(boolean insetBorder)
setBodyBorder(boolean)
== true.
insetBorder
- true to display the interior borderpublic void setMinButtonWidth(int minButtonWidth)
public void setTitleCollapse(boolean titleCollapse)
collapsible
= true) by clicking anywhere in the header bar, false to allow it only by
clicking to tool button (defaults to false, pre-render).
titleCollapse
- the titleCollapse to setpublic void setTopComponent(Component topComponent)
topComponent
- the componentpublic com.google.gwt.user.client.ui.Frame setUrl(java.lang.String url)
url
- the url
protected Size adjustBodySize()
protected void afterCollapse()
protected void afterExpand()
protected void createStyles(java.lang.String baseStyle)
createStyles
in class Component
protected void doAttachChildren()
doAttachChildren
in class Container<Component>
protected void doDetachChildren()
doDetachChildren
in class Container<Component>
protected Size getFrameSize()
protected void initTools()
protected void layoutBars()
protected void notifyHide()
notifyHide
in class Container<Component>
protected void notifyShow()
notifyShow
in class Container<Component>
protected void onClick(ComponentEvent ce)
protected void onCollapse()
protected void onDisable()
onDisable
in class Component
protected void onEnable()
onEnable
in class Component
protected void onExpand()
protected void onRender(com.google.gwt.user.client.Element parent, int pos)
Component
onRender
in class LayoutContainer
parent
- the target elementpos
- the insert locationprotected void onResize(int width, int height)
BoxComponent
onResize
in class BoxComponent
width
- the widthheight
- the heightprotected boolean remove(Component item)
Container
remove
in class Container<Component>
item
- the item to remove
true
if the item was removed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |