com.arsdigita.bebop
Class ModalContainer

java.lang.Object
  extended bycom.arsdigita.bebop.Completable
      extended bycom.arsdigita.bebop.SimpleComponent
          extended bycom.arsdigita.bebop.TextStylable
              extended bycom.arsdigita.bebop.BlockStylable
                  extended bycom.arsdigita.bebop.SimpleContainer
                      extended bycom.arsdigita.bebop.ModalContainer
All Implemented Interfaces:
Cloneable, Component, Container, Lockable, Resettable
Direct Known Subclasses:
ItemEditor

public class ModalContainer
extends SimpleContainer
implements Resettable

A modal container is a container that manages visibility for a set of components. It allows only one of its children to be visible. One of its children can be selected as the default visible component. If none is selected the child with index equal to zero is used. The modal container sets the appropriate default and PageState-based visibility for its children.

Author:
Archit Shah

Field Summary
static String versionId
           
 
Fields inherited from class com.arsdigita.bebop.BlockStylable
ABSBOTTOM, ABSMIDDLE, BASELINE, BOTTOM, CENTER, FULL_WIDTH, INSERT, LEFT, MIDDLE, RIGHT, TEXTTOP, TOP
 
Fields inherited from class com.arsdigita.bebop.SimpleComponent
m_attr
 
Fields inherited from interface com.arsdigita.bebop.Component
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE
 
Constructor Summary
ModalContainer()
           
ModalContainer(String tagName, String xmlns)
           
 
Method Summary
 void addModeChangeListener(ChangeListener cl)
          Adds a listener that is called whenever this container's mode (i.e., visible component) is changed using setVisibleComponent().
 Component getDefaultComponent()
           
 Component getVisibleComponent(PageState state)
           
 void next(PageState state)
          Makes the next component in a wizard sequence visible while hiding all other components.
 void previous(PageState state)
          Makes the previous component in a wizard sequence visible while hiding all other components.
 void register(Page p)
          Registers state parameters for the page with its model.
 void reset(PageState state)
          Resets the container to display the default component.
 void setDefaultComponent(Component c)
           
 void setVisibleComponent(PageState state, Component c)
           
 
Methods inherited from class com.arsdigita.bebop.SimpleContainer
add, add, children, contains, generateChildrenXML, generateParent, generateXML, get, getNamespace, getTag, indexOf, isEmpty, setNamespace, setTag, size
 
Methods inherited from class com.arsdigita.bebop.BlockStylable
setBorder, setBorder, setBorderColor, setHorizontalAlignment, setMargin, setMargin, setPadding, setPadding, setVerticalAlignment
 
Methods inherited from class com.arsdigita.bebop.TextStylable
setBackgroundColor, setColor
 
Methods inherited from class com.arsdigita.bebop.SimpleComponent
clone, exportAttributes, getAttribute, getClassAttr, getIdAttr, getKey, getMetaDataAttribute, getStyleAttr, hasAttributes, isLocked, isVisible, lock, register, respond, setAttribute, setClassAttr, setIdAttr, setKey, setMetaDataAttribute, setStyleAttr, setVisible
 
Methods inherited from class com.arsdigita.bebop.Completable
addCompletionListener, fireCompletionEvent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.arsdigita.bebop.Component
getClassAttr, getIdAttr, getKey, getStyleAttr, isVisible, register, respond, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible
 
Methods inherited from interface com.arsdigita.util.Lockable
isLocked, lock
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

ModalContainer

public ModalContainer()

ModalContainer

public ModalContainer(String tagName,
                      String xmlns)
Method Detail

register

public void register(Page p)
Description copied from interface: Component
Registers state parameters for the page with its model. A simple component with a state parameter param would do the following in the body of this method:
   p.addComponent(this);
   p.addComponentStateParam(this, param);
 
You should override this method to set the default visibility of your component:
 public void register(Page p) {
     super.register(p);
     p.setVisibleDefault(childNotInitiallyShown,false);
     p.setVisibleDefault(anotherChild, false);
 }
 
Always call super.register when you override register. Otherwise your component may malfunction and produce errors like "Widget ... isn't associated with any Form"

Specified by:
register in interface Component
Overrides:
register in class SimpleComponent

setDefaultComponent

public void setDefaultComponent(Component c)

getDefaultComponent

public Component getDefaultComponent()

setVisibleComponent

public void setVisibleComponent(PageState state,
                                Component c)

getVisibleComponent

public Component getVisibleComponent(PageState state)

next

public void next(PageState state)
Makes the next component in a wizard sequence visible while hiding all other components.


previous

public void previous(PageState state)
Makes the previous component in a wizard sequence visible while hiding all other components.


reset

public void reset(PageState state)
Resets the container to display the default component.

Specified by:
reset in interface Resettable
Parameters:
state - the page state

addModeChangeListener

public void addModeChangeListener(ChangeListener cl)
Adds a listener that is called whenever this container's mode (i.e., visible component) is changed using setVisibleComponent().



Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC