com.extjs.gxt.ui.client.widget
クラス LayoutContainer

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.extjs.gxt.ui.client.widget.Component
              extended by com.extjs.gxt.ui.client.widget.BoxComponent
                  extended by com.extjs.gxt.ui.client.widget.Container<T>
                      extended by com.extjs.gxt.ui.client.widget.ScrollContainer<Component>
                          extended by com.extjs.gxt.ui.client.widget.LayoutContainer
すべての実装インターフェース:
Observable, com.google.gwt.user.client.EventListener
Direct Known Subclasses:
CardPanel, ContentPanel, HorizontalPanel, Popup, TabItem, VerticalPanel, Viewport

public class LayoutContainer
extends ScrollContainer<Component>

A Container that lays out its children using a Layout. Layouts are responsible for connecting the child components to the container. Layouts are very flexible as they can create any internal element structure, inserting its child components at any location. For example, a TableLayout lays out its children using HTML tables.

Many layouts support layout data which are configurable objects that provide additional information to the layout. These objects can be passed when adding and inserting child components into the container. Each layout will document if and what layout data it supports.

FlowLayout is the the default layout and will be used if not a layout is not specified.

Events:
BeforeAdd : ContainerEvent(container, item, index)
Fires before a item is added or inserted. Listeners can set the doit field to false to cancel the action.
BeforeRemove : ContainerEvent(container, item)
Fires before a item is removed. Listeners can set the doit field to false to cancel the action.
Add : ContainerEvent(container, item, index)
Fires after a item has been added or inserted.
Remove : ContainerEvent(container, item)
Fires after a item has been removed.
AfterLayout : ContainerEvent(container)
Fires when the widgets in this container are arranged by the associated layout.

See Also:
Layout

入れ子クラス 概要
 
クラス com.google.gwt.user.client.ui.UIObject から継承された 入れ子クラス/インターフェース
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field 概要
 
クラス com.google.gwt.user.client.ui.UIObject から継承されたフィールド(Fields)
DEBUG_ID_PREFIX
 
コンストラクタ 概要
LayoutContainer()
          Creates a new layout container.
LayoutContainer(Layout layout)
          Creates a new layout container.
 
メソッド 概要
 boolean add(com.google.gwt.user.client.ui.Widget widget)
          Adds a widget to this Container.
 boolean add(com.google.gwt.user.client.ui.Widget widget, LayoutData layoutData)
          Adds a widget to this Container.
 Html addText(java.lang.String text)
          Creates a new HTML instance and adds it to the container.
 WidgetComponent findComponent(com.google.gwt.user.client.ui.Widget widget)
          Returns the widget component that wraps the given widget.
 Layout getLayout()
          Returns the layout which is associated with the container, or null if one has not been set.
 boolean getLayoutOnChange()
          Returns true if the layout will be executed when widgets are added or removed.
 El getLayoutTarget()
          Override this method to specify the element to be used by the layout as the container.
 boolean insert(com.google.gwt.user.client.ui.Widget widget, int index)
          Inserts a widget into this Container at a specified index.
 boolean insert(com.google.gwt.user.client.ui.Widget widget, int index, LayoutData layoutData)
          Inserts a widget into this Container at a specified index.
 boolean isMonitorResize()
          Returns true if the container's layout is executed when the container is resized (default to true).
 boolean isMonitorWindowResize()
          Returns true if the container's layout is executed when the browser window is resized (defaults to false).
 boolean layout()
          Executes the container's layout.
 boolean remove(com.google.gwt.user.client.ui.Widget widget)
          Removes a component from this container.
 boolean removeAll()
          Removes all of children from this container.
 void setLayout(Layout layout)
          Sets the container's layout.
 void setLayoutData(Component component, LayoutData layoutData)
          Sets the component's layout data.
 void setLayoutOnChange(boolean layoutOnChange)
          Specifies if the container's layout should be called when widgets are added or removed.
 void setMonitorWindowResize(boolean monitorWindowResize)
          True to have the container's layout executed when the browser window is resized (default to false).
 
クラス com.extjs.gxt.ui.client.widget.ScrollContainer から継承されたメソッド
addScrollListener, getHScrollPosition, getScrollMode, getVScrollPosition, onComponentEvent, removeScrollListener, scrollIntoView, setHScrollPosition, setScrollMode, setVScrollPosition
 
クラス com.extjs.gxt.ui.client.widget.Container から継承されたメソッド
findItem, getItem, getItemByItemId, getItemCount, getItems, getWidget, indexOf, iterator, scrollIntoView
 
クラス 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
 
クラス com.extjs.gxt.ui.client.widget.Component から継承されたメソッド
addListener, addStyleName, addWidgetListener, disable, disableEvents, disableTextSelection, el, enable, enableEvents, fireEvent, fireEvent, fireEvent, fly, focus, getBaseStyle, getBorders, getData, getData, getElement, getId, getItemId, getModel, getState, getToolTip, hide, hideToolTip, 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, toString
 
クラス com.google.gwt.user.client.ui.Widget から継承されたメソッド
getParent, isAttached
 
クラス com.google.gwt.user.client.ui.UIObject から継承されたメソッド
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタ 詳細

LayoutContainer

public LayoutContainer()
Creates a new layout container.


LayoutContainer

public LayoutContainer(Layout layout)
Creates a new layout container.

パラメータ:
layout - the layout
メソッド 詳細

add

public boolean add(com.google.gwt.user.client.ui.Widget widget)
Adds a widget to this Container. Fires the BeforeAdd event before adding, then fires the Add event after the component has been added.

パラメータ:
widget - the widget to add. If the widget is not a Component instance it will be wrapped in a WidgetComponent

add

public boolean add(com.google.gwt.user.client.ui.Widget widget,
                   LayoutData layoutData)
Adds a widget to this Container. Fires the BeforeAdd event before adding, then fires the Add event after the component has been added.

パラメータ:
widget - the widget to add. If the widget is not a Component instance it will be wrapped in a WidgetComponent
layoutData - the layout data

addText

public Html addText(java.lang.String text)
Creates a new HTML instance and adds it to the container. Fires the BeforeAdd event before adding, then fires the Add event after the component has been added.

パラメータ:
text - the html text
戻り値:
the new HTML instance

findComponent

public WidgetComponent findComponent(com.google.gwt.user.client.ui.Widget widget)
Returns the widget component that wraps the given widget.

パラメータ:
widget - the wrapped widget
戻り値:
the component or null

getLayout

public Layout getLayout()
Returns the layout which is associated with the container, or null if one has not been set.

戻り値:
the container's layout or null

getLayoutOnChange

public boolean getLayoutOnChange()
Returns true if the layout will be executed when widgets are added or removed.

戻り値:
the layout on change state

getLayoutTarget

public El getLayoutTarget()
Override this method to specify the element to be used by the layout as the container. Allows the container to be decorated.

戻り値:
the element to be used as the panel's container

insert

public boolean insert(com.google.gwt.user.client.ui.Widget widget,
                      int index)
Inserts a widget into this Container at a specified index. Fires the BeforeAdd event before inserting, then fires the Add event after the component has been inserted.

パラメータ:
widget - the widget to insert. If the widget is not a Component instance it will be wrapped in a WidgetComponent
index - the index at which the component will be inserted in

insert

public boolean insert(com.google.gwt.user.client.ui.Widget widget,
                      int index,
                      LayoutData layoutData)
Inserts a widget into this Container at a specified index. Fires the BeforeAdd event before inserting, then fires the Add event after the component has been inserted.

パラメータ:
widget - the widget to insert. If the widget is not a Component instance it will be wrapped in a WidgetComponent
index - the index at which the component will be inserted in
layoutData - the component's layout data

isMonitorResize

public boolean isMonitorResize()
Description copied from class: Container
Returns true if the container's layout is executed when the container is resized (default to true).

戻り値:
true to enable resize monitoring

isMonitorWindowResize

public boolean isMonitorWindowResize()
Description copied from class: Container
Returns true if the container's layout is executed when the browser window is resized (defaults to false).

戻り値:
true if window resize monitoring is enabled

layout

public boolean layout()
Executes the container's layout.


remove

public boolean remove(com.google.gwt.user.client.ui.Widget widget)
Removes a component from this container. Fires the 'BeforeRemove' event before removing, then fires the 'Remove' event after the component has been removed.

パラメータ:
widget - the widget to remove

removeAll

public boolean removeAll()
Removes all of children from this container.

オーバーライド:
removeAll in class Container<Component>
戻り値:
true if all items where removed

setLayout

public void setLayout(Layout layout)
Sets the container's layout.

パラメータ:
layout - the new layout

setLayoutData

public void setLayoutData(Component component,
                          LayoutData layoutData)
Sets the component's layout data.

パラメータ:
component - the component
layoutData - the layou data

setLayoutOnChange

public void setLayoutOnChange(boolean layoutOnChange)
Specifies if the container's layout should be called when widgets are added or removed. Default value is false.

パラメータ:
layoutOnChange - true to enable

setMonitorWindowResize

public void setMonitorWindowResize(boolean monitorWindowResize)
Description copied from class: Container
True to have the container's layout executed when the browser window is resized (default to false).

パラメータ:
monitorWindowResize - true to monitor window resizing