|
|||||||||
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
public class Container
Base class for any BoxComponent
that can contain other components. Containers handle the basic behavior of
containing items, namely adding, inserting and removing them. The specific layout logic required to visually render
contained items is delegated to any one of the different layout classes available. This class is intended to be extended
and should generally not need to be created directly via the new keyword.
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 | |
---|---|
Container()
|
|
Container(com.google.gwt.user.client.Element element)
|
|
Container(com.google.gwt.core.client.JavaScriptObject jsObj)
|
Method Summary | |
---|---|
void |
add(Component component)
Add a Component to the Container. |
void |
add(Component component,
LayoutData layoutData)
Add a Component to the Container. |
void |
add(com.google.gwt.user.client.ui.Widget widget)
Add a widget to the Container. |
void |
add(com.google.gwt.user.client.ui.Widget widget,
LayoutData layoutData)
Add a widget to the Container. |
void |
addListener(ContainerListener listener)
Add a Container listener. |
void |
bubble(ComponentTraversalCallback cb)
Bubbles up the component/container heirarchy, calling the specified function with each component. |
void |
cascade(ComponentTraversalCallback cb)
Cascades down the component/container heirarchy from this component (called first), calling the specified function with each component. |
void |
clear()
Remove all child elements destroying them. |
protected com.google.gwt.core.client.JavaScriptObject |
create(com.google.gwt.core.client.JavaScriptObject config)
|
void |
doLayout()
Force this container's layout to be recalculated. |
void |
doLayout(boolean shallow)
Force this container's layout to be recalculated. |
Component[] |
findBy(ComponentTraversalCallback cb)
Find a component under this container at any level by a custom function. |
Component |
findByID(java.lang.String id)
Find a component under this container at any level by id. |
Component[] |
findByType(java.lang.String xtype)
Find a component under this container at any level by xtype. |
int |
getActiveItem()
Return the Active Item index. |
java.lang.String |
getActiveItemID()
|
boolean |
getAutoDestroy()
|
boolean |
getBufferResize()
|
Component |
getComponent(int index)
Gets a direct child Component by by index. |
Component |
getComponent(java.lang.String id)
Gets a direct child Component by id. |
Component[] |
getComponents()
The collection of components in this container. |
protected com.google.gwt.core.client.JavaScriptObject |
getConfigPrototype()
|
boolean |
getHideBorders()
True to hide the borders of each contained component, false to defer to the component's existing border settings (defaults to false). |
Component[] |
getItems()
The collection of components in this container. |
ContainerLayout |
getLayout()
|
boolean |
getMonitorResize()
|
java.lang.String |
getXType()
Gets the xtype for this component as registered with ComponentMgr. |
void |
insert(int index,
Component component)
Inserts a Component into this Container at a specified index. |
java.util.Iterator |
iterator()
|
void |
remove(Component component,
boolean autoDestroy)
Removes a component from this container. |
void |
remove(java.lang.String id)
Removes a component from this container. |
void |
remove(java.lang.String id,
boolean autoDestroy)
Removes a component from this container. |
boolean |
remove(com.google.gwt.user.client.ui.Widget w)
|
void |
removeAll()
Removes all child components without destroying them. |
void |
removeAll(boolean autoDestroy)
Removes all components from this container. |
void |
setActiveItem(int activeItem)
A string component id or the numeric index of the component that should be initially activated within the container's layout on render. |
void |
setActiveItemID(java.lang.String activeItem)
A string component id or the numeric index of the component that should be initially activated within the container's layout on render. |
void |
setAutoDestroy(boolean autoDestroy)
If true the container will automatically destroy any contained component that is removed from it, else destruction must be handled manually (defaults to true). |
void |
setBufferResize(boolean bufferResize)
When set to true (100 milliseconds), the layout assigned for this container will buffer the frequency it calculates and does a re-layout of components. |
void |
setDefaults(DefaultsHandler defaultsHandler)
|
void |
setHideBorders(boolean hideBorders)
True to hide the borders of each contained component, false to defer to the component's existing border settings (defaults to false). |
void |
setLayout(ContainerLayout layout)
The layout type to be used in this container. |
void |
setMonitorResize(boolean monitorResize)
True to automatically monitor window resize events to handle anything that is sensitive to the current size of the viewport. |
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 Container()
public Container(com.google.gwt.core.client.JavaScriptObject jsObj)
public Container(com.google.gwt.user.client.Element element)
Method Detail |
---|
protected com.google.gwt.core.client.JavaScriptObject getConfigPrototype()
getConfigPrototype
in class BoxComponent
public java.lang.String getXType()
Component
TextField field = new TextField();
field.getXType() returns "textfield"
getXType
in class BoxComponent
protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject config)
create
in class BoxComponent
public void setDefaults(DefaultsHandler defaultsHandler)
public void add(Component component, LayoutData layoutData)
component
- the component to addlayoutData
- the layout to use when adding the componentpublic void add(com.google.gwt.user.client.ui.Widget widget)
add
in interface com.google.gwt.user.client.ui.HasWidgets
widget
- the widget to addpublic void add(com.google.gwt.user.client.ui.Widget widget, LayoutData layoutData)
widget
- the widget to addlayoutData
- the layout to use when adding the componentpublic void add(Component component)
component
- the component to addpublic Component findByID(java.lang.String id)
id
- the component ID
public Component[] findByType(java.lang.String xtype)
xtype
- the components xtype
public Component[] findBy(ComponentTraversalCallback cb)
cb
- the find function
public Component getComponent(java.lang.String id)
id
- the component ID
public Component getComponent(int index)
index
- the component index
public void bubble(ComponentTraversalCallback cb)
cb
- the traversal callbackpublic void cascade(ComponentTraversalCallback cb)
cb
- the traversal callbackpublic void insert(int index, Component component)
index
- the index to insert the component atcomponent
- the component to insertpublic void remove(java.lang.String id)
id
- the id of the Component to removepublic boolean remove(com.google.gwt.user.client.ui.Widget w)
remove
in interface com.google.gwt.user.client.ui.HasWidgets
public void clear()
clear
in interface com.google.gwt.user.client.ui.HasWidgets
public Component[] getItems()
getComponents()
public Component[] getComponents()
public java.util.Iterator iterator()
iterator
in interface com.google.gwt.user.client.ui.HasWidgets
iterator
in interface java.lang.Iterable
public void remove(Component component, boolean autoDestroy)
component
- the id of the Component to removeautoDestroy
- true to automatically invoke the Component's destroy methodpublic void remove(java.lang.String id, boolean autoDestroy)
id
- the id of the Component to removeautoDestroy
- true to automatically invoke the Component's destroy methodpublic void removeAll()
public void removeAll(boolean autoDestroy)
autoDestroy
- true to automatically invoke the component's destroypublic void doLayout()
public void doLayout(boolean shallow)
shallow
- True to only calculate the layout of this component, and let child components auto calculate layouts as requiredpublic void addListener(ContainerListener listener)
listener
- the listenerpublic void setActiveItemID(java.lang.String activeItem)
AccordionLayout
, CardLayout
and FitLayout
).
activeItem
- the active Item IDpublic java.lang.String getActiveItemID()
public void setActiveItem(int activeItem)
AccordionLayout
, CardLayout
and FitLayout
).
activeItem
- the active Item IDpublic int getActiveItem()
public void setAutoDestroy(boolean autoDestroy)
autoDestroy
- true to autodestroypublic boolean getAutoDestroy()
public void setBufferResize(boolean bufferResize)
bufferResize
- true to buffer resizepublic boolean getBufferResize()
public void setHideBorders(boolean hideBorders)
hideBorders
- true to hide borderspublic boolean getHideBorders()
public void setLayout(ContainerLayout layout) throws java.lang.IllegalStateException
layout
- the layout to use
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic ContainerLayout getLayout()
public void setMonitorResize(boolean monitorResize) throws java.lang.IllegalStateException
monitorResize
- true to monitor resize
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean getMonitorResize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |