|
|||||||||
| 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();
doit field to false to cancel the expand.doit field false to cancel the collapse.doit field to false to cancel the operation.
| 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.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. |
void |
collapse()
Collapses the panel body so that it becomes hidden. |
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()
Returns the panel's button bar. |
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 |
getFooter()
|
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). |
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. |
java.lang.String |
getIconStyle()
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. |
boolean |
getTitleCollapse()
|
java.lang.String |
getTitleText()
Deprecated. use getHeading() |
Component |
getTopComponent()
Returns the panels top component. |
boolean |
isExpanded()
Returns true if the panel is expanded. |
boolean |
isHeaderVisible()
Returns true if the header is visible. |
boolean |
isHideCollapseTool()
Returns true if the collapse tool is hidden. |
void |
onComponentEvent(ComponentEvent ce)
Any events a component receives will be forwarded to this method. |
void |
setAnimCollapse(boolean animCollapse)
Sets whether exand 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 |
setButtonBar(ButtonBar buttonBar)
|
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 |
setIconStyle(java.lang.String iconStyle)
Sets the item's icon style. |
void |
setInsetBorder(boolean insetBorder)
Deprecated. behavior not implemented |
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, getLayoutOnChange, insert, insert, isMonitorResize, isMonitorWindowResize, layout, remove, removeAll, setLayout, setLayoutData, setLayoutOnChange, setMonitorWindowResize |
| Methods inherited from class com.extjs.gxt.ui.client.widget.ScrollContainer |
|---|
addScrollListener, getHScrollPosition, getScrollMode, getVScrollPosition, removeScrollListener, scrollIntoView, setHScrollPosition, setScrollMode, setVScrollPosition |
| Methods inherited from class com.extjs.gxt.ui.client.widget.Container |
|---|
disable, enable, findItem, getItem, getItemByItemId, getItemCount, getItems, getWidget, indexOf, iterator, scrollIntoView |
| Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
|---|
getBounds, getHeight, getHeight, getPosition, getShadow, getSize, getWidth, getWidth, isAutoHeight, isAutoWidth, isDeferHeight, isShim, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShim, setSize, setSize, setWidth, setWidth |
| Methods inherited from class com.extjs.gxt.ui.client.widget.Component |
|---|
addListener, addPlugin, addStyleName, addWidgetListener, disableEvents, disableTextSelection, el, enableEvents, fireEvent, fireEvent, fireEvent, fly, focus, getBaseStyle, getBorders, getData, getData, getElement, getId, getItemId, getModel, getState, getToolTip, hide, hideToolTip, isDisabledEvents, isEnabled, isRendered, isVisible, onBrowserEvent, recalculate, removeAllListeners, removeFromParent, removeListener, removeStyleName, removeWidgetListener, render, render, saveState, setBorders, setData, setData, setElement, setEnabled, setEnableState, setId, setIntStyleAttribute, setItemId, setStyleAttribute, setStyleName, setTitle, setToolTip, setToolTip, setVisible, show, sinkEvents, toString |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
getParent, isAttached |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ContentPanel()
public ContentPanel(Layout layout)
layout - the panel's layout| Method 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 getFooter()
public boolean getFrame()
public int getFrameHeight()
getInnerHeight().
public int getFrameWidth()
getInnerWidth().
public Header getHeader()
public java.lang.String getHeading()
public java.lang.String getIconStyle()
public int getInnerHeight()
getFrameHeight().
public int getInnerWidth()
getFrameWidth().
public El getLayoutTarget()
LayoutContainer
getLayoutTarget in class LayoutContainerpublic boolean getTitleCollapse()
public java.lang.String getTitleText()
getHeading()
public Component getTopComponent()
public boolean isExpanded()
true if the panel is expanded.
public boolean isHeaderVisible()
public boolean isHideCollapseTool()
public void onComponentEvent(ComponentEvent ce)
ComponentComponent.onBrowserEvent(com.google.gwt.user.client.Event) method
should not be overridden or modified.
onComponentEvent in class ScrollContainer<Component>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 setButtonBar(ButtonBar buttonBar)
public void setCollapsible(boolean collapsible)
collapsible - the collapsible to setpublic void setExpanded(boolean expanded)
expanded - true true to expandpublic 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 setIconStyle(java.lang.String iconStyle)
.my-icon { background: url(images/icons/my-icon.png) no-repeat
center left !important; }
iconStyle - the icon stylepublic void setInsetBorder(boolean insetBorder)
setBodyBorder(boolean) == true.
insetBorder - true to display the interior borderpublic 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
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||