com.extjs.gxt.ui.client.widget
Class Layout

java.lang.Object
  extended by com.extjs.gxt.ui.client.event.BaseObservable
      extended by com.extjs.gxt.ui.client.widget.Layout
All Implemented Interfaces:
Observable
Direct Known Subclasses:
AnchorLayout, BorderLayout, BoxLayout, ColumnLayout, FitLayout, FlowLayout, MenuLayout, RowLayout, TableLayout, ToolBarLayout

public abstract class Layout
extends BaseObservable

Layout provides the basic foundation for all other layout classes in GXT. It is a non-visual class that simply provides the base logic required to function as a layout. This class is intended to be extended.

Layout instances should not be shared with multiple containers.

See Also:
LayoutContainer

Field Summary
protected  Component activeItem
           
protected  java.lang.String componentStyleName
           
protected  Container<?> container
           
protected  boolean monitorResize
           
protected  boolean renderHidden
           
protected  El target
           
protected  java.lang.String targetStyleName
           
 
Constructor Summary
Layout()
           
 
Method Summary
protected  void applyMargins(El target, Margins margins)
           
protected  void applyPadding(El target, Padding paddings)
           
protected  void callLayout(Component c, boolean force)
           
protected  El fly(com.google.gwt.dom.client.Element elem)
           
protected  El fly(com.google.gwt.user.client.Element elem)
           
 java.lang.String getExtraStyle()
          Returns the extra style name.
protected  LayoutData getLayoutData(Component c)
           
 int getResizeDelay()
          Returns the window resize delay.
protected  int getSideMargins(Component c)
           
protected  void initTarget()
           
protected  boolean isLayoutExecuted(Container<?> c)
           
protected  boolean isLayoutNeeded(Container<?> c)
           
 boolean isRenderHidden()
          Returns true if the container will be render child components hidden.
 boolean isRunning()
          Returns true if the layout is currently running.
protected  boolean isValidParent(com.google.gwt.user.client.Element elem, com.google.gwt.user.client.Element parent)
           
 void layout()
          Layouts the container, by executing it's layout.
protected  void layoutContainer()
           
protected  void onAdd(Component component)
           
protected  void onComponentHide(Component component)
           
protected  void onComponentShow(Component component)
           
protected  void onLayout(Container<?> container, El target)
           
protected  void onRemove(Component component)
           
protected  void onResize(ComponentEvent ce)
           
protected  void renderAll(Container<?> container, El target)
           
protected  void renderComponent(Component component, int index, El target)
           
protected  void setBounds(com.google.gwt.user.client.ui.Widget w, int x, int y, int width, int height)
           
 void setContainer(Container<?> ct)
          Sets the layout's container.
 void setExtraStyle(java.lang.String extraStyle)
          Sets an optional extra CSS style name that will be added to the container.
protected  void setLayoutData(Component c, LayoutData data)
           
protected  void setLayoutNeeded(Container<?> c, boolean needed)
           
protected  void setLayoutOnChange(Container<?> c, boolean change)
           
protected  void setPosition(Component c, int left, int top)
           
 void setRenderHidden(boolean renderHidden)
          True to hide each contained component on render (defaults to false).
 void setResizeDelay(int resizeDelay)
          Sets the number of milliseconds to buffer resize events (defaults to 0).
protected  void setSize(Component c, int width, int height)
           
 
Methods inherited from class com.extjs.gxt.ui.client.event.BaseObservable
addListener, callListener, fireEvent, fireEvent, getFiresEvents, getListeners, hasActiveEvent, hasListeners, hasListeners, removeAllListeners, removeListener, setFiresEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

activeItem

protected Component activeItem

componentStyleName

protected java.lang.String componentStyleName

container

protected Container<?> container

monitorResize

protected boolean monitorResize

renderHidden

protected boolean renderHidden

target

protected El target

targetStyleName

protected java.lang.String targetStyleName
Constructor Detail

Layout

public Layout()
Method Detail

getExtraStyle

public java.lang.String getExtraStyle()
Returns the extra style name.

Returns:
the extra style

getResizeDelay

public int getResizeDelay()
Returns the window resize delay.

Returns:
the delay

isRenderHidden

public boolean isRenderHidden()
Returns true if the container will be render child components hidden.

Returns:
the render hidden state

isRunning

public boolean isRunning()
Returns true if the layout is currently running.

Returns:
true if the layout is currently running

layout

public void layout()
Layouts the container, by executing it's layout.


setContainer

public void setContainer(Container<?> ct)
Sets the layout's container.

Parameters:
ct - the container

setExtraStyle

public void setExtraStyle(java.lang.String extraStyle)
Sets an optional extra CSS style name that will be added to the container. This can be useful for adding customized styles to the container or any of its children using standard CSS rules.

Parameters:
extraStyle - the extra style name

setRenderHidden

public void setRenderHidden(boolean renderHidden)
True to hide each contained component on render (defaults to false).

Parameters:
renderHidden - true to render hidden

setResizeDelay

public void setResizeDelay(int resizeDelay)
Sets the number of milliseconds to buffer resize events (defaults to 0). Only applies when monitorResize = true.

Parameters:
resizeDelay - the delay in milliseconds

applyMargins

protected void applyMargins(El target,
                            Margins margins)

applyPadding

protected void applyPadding(El target,
                            Padding paddings)

callLayout

protected void callLayout(Component c,
                          boolean force)

fly

protected El fly(com.google.gwt.dom.client.Element elem)

fly

protected El fly(com.google.gwt.user.client.Element elem)

getLayoutData

protected LayoutData getLayoutData(Component c)

getSideMargins

protected int getSideMargins(Component c)

initTarget

protected void initTarget()

isLayoutExecuted

protected boolean isLayoutExecuted(Container<?> c)

isLayoutNeeded

protected boolean isLayoutNeeded(Container<?> c)

isValidParent

protected boolean isValidParent(com.google.gwt.user.client.Element elem,
                                com.google.gwt.user.client.Element parent)

layoutContainer

protected void layoutContainer()

onAdd

protected void onAdd(Component component)

onComponentHide

protected void onComponentHide(Component component)

onComponentShow

protected void onComponentShow(Component component)

onLayout

protected void onLayout(Container<?> container,
                        El target)

onRemove

protected void onRemove(Component component)

onResize

protected void onResize(ComponentEvent ce)

renderAll

protected void renderAll(Container<?> container,
                         El target)

renderComponent

protected void renderComponent(Component component,
                               int index,
                               El target)

setBounds

protected void setBounds(com.google.gwt.user.client.ui.Widget w,
                         int x,
                         int y,
                         int width,
                         int height)

setLayoutData

protected void setLayoutData(Component c,
                             LayoutData data)

setLayoutNeeded

protected void setLayoutNeeded(Container<?> c,
                               boolean needed)

setLayoutOnChange

protected void setLayoutOnChange(Container<?> c,
                                 boolean change)

setPosition

protected void setPosition(Component c,
                           int left,
                           int top)

setSize

protected void setSize(Component c,
                       int width,
                       int height)