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

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.AccordionLayout
All Implemented Interfaces:
Observable

public class AccordionLayout
extends FitLayout

This is a layout that contains multiple content panels in an expandable accordion style such that only one panel can be open at any given time.

Child Widgets are:

Note: All children added to the container must be ContentPanel instances.


Field Summary
 
Fields inherited from class com.extjs.gxt.ui.client.widget.Layout
activeItem, componentStyleName, container, monitorResize, renderHidden, target, targetStyleName
 
Constructor Summary
AccordionLayout()
           
 
Method Summary
 boolean getActiveOnTop()
          Returns true if the active item if first.
 boolean getAutoWidth()
          Returns true if auto width is enabled.
 boolean getFill()
          Returns true if fill is enabled.
 boolean getHideCollapseTool()
          Returns true if the collapse tool is hidden.
 boolean getTitleCollapse()
          Returns true if title collapse is enabled.
 boolean isSequence()
           
protected  void onAdd(Component component)
           
protected  void onBeforeExpand(ComponentEvent ce)
           
protected  void onExpand(ComponentEvent ce)
           
protected  void onRemove(Component component)
           
protected  void renderComponent(Component component, int index, El target)
           
 void setActiveItem(Component component)
          Sets the active component.
 void setActiveOnTop(boolean activeOnTop)
          True to swap the position of each panel as it is expanded so that it becomes the first item in the container, false to keep the panels in the rendered order.
 void setAutoWidth(boolean autoWidth)
          True to set each contained item's width to 'auto', false to use the item's current width (defaults to false).
 void setFill(boolean fill)
          True to adjust the active item's height to fill the available space in the container, false to use the item's current height (defaults to true).
 void setHideCollapseTool(boolean hideCollapseTool)
          True to hide the contained panels' collapse/expand toggle buttons, false to display them (defaults to false).
protected  void setItemSize(Component item, Size size)
           
 void setSequence(boolean sequence)
           
 void setTitleCollapse(boolean titleCollapse)
          True to allow expand/collapse of each contained panel by clicking anywhere on the title bar, false to allow expand/collapse only when the toggle tool button is clicked (defaults to true).
 
Methods inherited from class com.extjs.gxt.ui.client.widget.layout.FitLayout
onLayout
 
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, onComponentHide, onComponentShow, 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

AccordionLayout

public AccordionLayout()
Method Detail

getActiveOnTop

public boolean getActiveOnTop()
Returns true if the active item if first.

Returns:
the active on top state

getAutoWidth

public boolean getAutoWidth()
Returns true if auto width is enabled.

Returns:
the auto width state

getFill

public boolean getFill()
Returns true if fill is enabled.

Returns:
the fill state

getHideCollapseTool

public boolean getHideCollapseTool()
Returns true if the collapse tool is hidden.

Returns:
the hide collapse tool state

getTitleCollapse

public boolean getTitleCollapse()
Returns true if title collapse is enabled.

Returns:
the title collapse state

isSequence

public boolean isSequence()

setActiveItem

public void setActiveItem(Component component)
Sets the active component.

Parameters:
component - the active component

setActiveOnTop

public void setActiveOnTop(boolean activeOnTop)
True to swap the position of each panel as it is expanded so that it becomes the first item in the container, false to keep the panels in the rendered order. (defaults to false).

Parameters:
activeOnTop - true to keep the active item on top

setAutoWidth

public void setAutoWidth(boolean autoWidth)
True to set each contained item's width to 'auto', false to use the item's current width (defaults to false).

Parameters:
autoWidth - true for auto width

setFill

public void setFill(boolean fill)
True to adjust the active item's height to fill the available space in the container, false to use the item's current height (defaults to true).

Parameters:
fill - true to fill

setHideCollapseTool

public void setHideCollapseTool(boolean hideCollapseTool)
True to hide the contained panels' collapse/expand toggle buttons, false to display them (defaults to false). When set to true, titleCollapse should be true also.

Parameters:
hideCollapseTool - true to hide

setSequence

public void setSequence(boolean sequence)

setTitleCollapse

public void setTitleCollapse(boolean titleCollapse)
True to allow expand/collapse of each contained panel by clicking anywhere on the title bar, false to allow expand/collapse only when the toggle tool button is clicked (defaults to true). When set to false, hideCollapseTool should be false also.

Parameters:
titleCollapse - true for title collapse

onBeforeExpand

protected void onBeforeExpand(ComponentEvent ce)

onExpand

protected void onExpand(ComponentEvent ce)

renderComponent

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

onAdd

protected void onAdd(Component component)
Overrides:
onAdd in class Layout

onRemove

protected void onRemove(Component component)
Overrides:
onRemove in class Layout

setItemSize

protected void setItemSize(Component item,
                           Size size)
Overrides:
setItemSize in class FitLayout