com.arsdigita.bebop
Class ModalContainer
java.lang.Object
com.arsdigita.bebop.Completable
com.arsdigita.bebop.SimpleComponent
com.arsdigita.bebop.TextStylable
com.arsdigita.bebop.BlockStylable
com.arsdigita.bebop.SimpleContainer
com.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
Fields inherited from class com.arsdigita.bebop.BlockStylable |
ABSBOTTOM, ABSMIDDLE, BASELINE, BOTTOM, CENTER, FULL_WIDTH, INSERT, LEFT, MIDDLE, RIGHT, TEXTTOP, TOP |
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.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 interface com.arsdigita.bebop.Component |
getClassAttr, getIdAttr, getKey, getStyleAttr, isVisible, register, respond, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible |
versionId
public static final String versionId
- See Also:
- Constant Field Values
ModalContainer
public ModalContainer()
ModalContainer
public ModalContainer(String tagName,
String xmlns)
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 21 2004:2337 UTC