|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.arsdigita.bebop.Completable
com.arsdigita.bebop.SimpleComponent
com.arsdigita.bebop.TextStylable
com.arsdigita.bebop.BlockStylable
com.arsdigita.bebop.SimpleContainer
com.arsdigita.bebop.TabbedPane
A tabbed pane that lets the user switch between components by clicking on a given title in the tab strip.
Tabs (components) are added using the addTab method. Each
entry consists of a label (which is a string) and the Component
that is displayed if the user clicks on the label.
There is always exactly one component that is currently visible, the component
that is returned by getCurrentPane(com.arsdigita.bebop.PageState). Without user interaction,
this is the default pane -- that was set by setDefaultPane(com.arsdigita.bebop.Component) -- or, if
none has been set, the first component that was added to the TabbedPane.
| 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 | |
TabbedPane()
Constructs an empty TabbedPane. |
|
| Method Summary | |
void |
add(Component pc)
Adds a new pane to the dialog. |
void |
add(Component pc,
int constraints)
Adds a new pane with layout constraints to the dialog. |
void |
addActionListener(ActionListener l)
Adds an ActionListener, which is run whenever respond is called. |
void |
addTab(Component label,
Component c)
Adds a tab and its associated component. |
void |
addTab(String label,
Component c)
Adds a tab and its associated component. |
protected int |
findPane(Component c)
Find the pane whose body is the specified component |
protected void |
fireActionEvent(PageState state)
Fires an ActionEvent. |
protected void |
generateTabs(PageState data,
Element parent)
Builds a DOM representing the header for the tab strip. |
void |
generateXML(PageState state,
Element parent)
Services the request by building a DOM tree with the tabs themselves and then the included page. |
Component |
getCurrentPane(PageState data)
Gets the currently visible pane. |
Component |
getDefaultPane()
Gets the default pane. |
Component |
getPane(Component label)
Gets the pane with the specified label. |
Component |
getPane(String label)
Gets the pane with the specified key in its label. |
int |
getSelectedIndex(PageState state)
|
boolean |
isTabVisible(PageState s,
Component c)
Determine if a particular tab is visible |
boolean |
isTabVisible(PageState s,
int i)
Determine if a particular tab is visible |
void |
register(Page p)
Registers with the specified root container. |
void |
removeActionListener(ActionListener l)
Removes a previously added ActionListener. |
void |
respond(PageState state)
Notifies the TabbedPane that one of the tabs has been
selected. |
void |
setDefaultPane(Component pane)
Sets the default pane, which is visible until the user clicks on another label in the tab strip. |
protected void |
setDefaultPaneIndex(int i)
Sets the index of the default pane, which is visible until the user clicks on another label in the tab strip. |
void |
setSelectedIndex(PageState state,
int index)
|
void |
setTabVisible(PageState s,
Component c,
boolean v)
Show or hide a particular tab |
void |
setTabVisible(PageState s,
int i,
boolean v)
Show or hide a particular tab |
| Methods inherited from class com.arsdigita.bebop.SimpleContainer |
children, contains, generateChildrenXML, generateParent, 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, 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, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible |
| Methods inherited from interface com.arsdigita.util.Lockable |
isLocked, lock |
| Field Detail |
public static final String versionId
| Constructor Detail |
public TabbedPane()
| Method Detail |
public void register(Page p)
register in interface Componentregister in class SimpleComponentp - the root container to register withpublic void add(Component pc)
addTab
instead.
add in interface Containeradd in class SimpleContainerpc - the component to be added
public void add(Component pc,
int constraints)
addTab instead.
add in interface Containeradd in class SimpleContainerconstraints - this parameter is ignored. Child classes should
override the add method if they wish to provide special handling
of constraints.
public void addTab(Component label,
Component c)
label - the text to display in the tab stripc - the component to display when the user clicks on the
label in the tab strip
public void addTab(String label,
Component c)
label - the text to display in the tab stripc - the component to display when the user clicks on the
label in the tab strippublic void addActionListener(ActionListener l)
ActionListener, which is run whenever respond is called.
respondpublic void removeActionListener(ActionListener l)
ActionListener.
addActionListenerprotected void fireActionEvent(PageState state)
ActionEvent. All registered
ActionListeners are run. The source of the event is the
TabbedPane.
state - the current page staterespondprotected void setDefaultPaneIndex(int i)
i - the index of the default pane
public void setDefaultPane(Component pane)
throws IllegalArgumentException
pane - the component to display as the default pane
IllegalArgumentException
public void setTabVisible(PageState s,
int i,
boolean v)
s - the page statei - the index of the tabv - if true, shows the tab. Otherwise, hides the tab
public void setTabVisible(PageState s,
Component c,
boolean v)
s - the page statec - the body of the tabv - if true, shows the tab. Otherwise, hides the tab
public boolean isTabVisible(PageState s,
int i)
s - the page statei - the index of the tab
public boolean isTabVisible(PageState s,
Component c)
s - the page statec - the body of the tabprotected int findPane(Component c)
c - the component
public Component getDefaultPane()
null if there are no
panes.public Component getPane(Component label)
null
if a pane with that label does not exist.public Component getPane(String label)
null
if a pane with that label does not exist.public Component getCurrentPane(PageState data)
public void setSelectedIndex(PageState state,
int index)
public int getSelectedIndex(PageState state)
protected void generateTabs(PageState data,
Element parent)
public void generateXML(PageState state,
Element parent)
Generates a DOM fragment:
<bebop:tabbedPane>
<bebop:tabStrip>
<bebop:tab [href="..."] [current="t|f"]> .. label .. </bebop:tab>
<bebop:tab [href="..."] [current="t|f"]> .. label .. </bebop:tab>
<bebop:tab [href="..."] [current="t|f"]> .. label .. </bebop:tab>
</bebop:tabStrip>
<bebop:currentPane>
... contentes ..
</bebop:currentPane>
</bebop:tabbedPane>
generateXML in interface ComponentgenerateXML in class SimpleContainerstate - represents the current requestparent - the parent XML elementSimpleContainer.setTag(String),
SimpleContainer.setNamespace(String)
public void respond(PageState state)
throws javax.servlet.ServletException
TabbedPane that one of the tabs has been
selected. Changes the currently visible pane and runs all the ActionListeners.
The respond method on the now-visible component is
not called.
respond in interface Componentrespond in class SimpleComponentstate - the current page state
javax.servlet.ServletException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||