com.extjs.gxt.ui.client.widget.layout
Class CardLayout

java.lang.Object
  extended by com.extjs.gxt.ui.client.event.BaseObservable
      extended by com.extjs.gxt.ui.client.widget.Layout
          extended by com.extjs.gxt.ui.client.widget.layout.FitLayout
              extended by com.extjs.gxt.ui.client.widget.layout.CardLayout
All Implemented Interfaces:
Observable

public class CardLayout
extends FitLayout

This layout contains multiple widgets, each fit to the container, where only a single widget can be visible at any given time. This layout style is most commonly used for wizards, tab implementations, etc.

Child Widgets are:

The CardLayout's focal method is setActiveItem(Component). Since only one panel is displayed at a time, the only way to move from one panel to the next is by calling setActiveItem the next panel to display. The layout itself does not provide a mechanism for handling this navigation, so that functionality must be provided by the developer.

See Also:
CardPanel

Field Summary
 
Fields inherited from class com.extjs.gxt.ui.client.widget.Layout
activeItem, componentStyleName, container, monitorResize, renderHidden, target, targetStyleName
 
Constructor Summary
CardLayout()
          Creates a new card layout instance.
 
Method Summary
 Component getActiveItem()
          Returns the active component.
 boolean isDeferredRender()
          Returns true if children are rendered when first accessed.
protected  void renderComponent(Component component, int index, El target)
           
 void setActiveItem(Component component)
          Sets the active (visible) item in the layout.
 void setDeferredRender(boolean deferredRender)
          True to render each child when it accessed, false to render all (defaults to true).
 
Methods inherited from class com.extjs.gxt.ui.client.widget.layout.FitLayout
onLayout, setItemSize
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Layout
applyMargins, applyPadding, callLayout, fly, fly, getExtraStyle, getLayoutData, getResizeDelay, getSideMargins, initTarget, isLayoutExecuted, isLayoutNeeded, isRenderHidden, isRunning, isValidParent, layout, layoutContainer, onAdd, onComponentHide, onComponentShow, onRemove, onResize, renderAll, setBounds, setContainer, setExtraStyle, setLayoutData, setLayoutNeeded, setLayoutOnChange, setPosition, setRenderHidden, setResizeDelay, setSize
 
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
 

Constructor Detail

CardLayout

public CardLayout()
Creates a new card layout instance.

Method Detail

getActiveItem

public Component getActiveItem()
Returns the active component.

Returns:
the top widget

isDeferredRender

public boolean isDeferredRender()
Returns true if children are rendered when first accessed.

Returns:
true to defer rendering

setActiveItem

public void setActiveItem(Component component)
Sets the active (visible) item in the layout.

Parameters:
component - the active component

setDeferredRender

public void setDeferredRender(boolean deferredRender)
True to render each child when it accessed, false to render all (defaults to true).

Parameters:
deferredRender - true to defer rendering

renderComponent

protected void renderComponent(Component component,
                               int index,
                               El target)
Overrides:
renderComponent in class Layout