|
|||||||||||
| 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.BaseLink
com.arsdigita.bebop.ControlLink
com.arsdigita.bebop.ToggleLink
A component that is either selected or not. By default, a link is only generated when the component is not selected. When it is selected, only a label is printed.
See BaseLink for a description
of all Bebop Link classes.
| Field Summary | |
protected String |
TYPE_TOGGLE
The value for the XML type attribute for a ToggleLink |
static String |
versionId
|
| Fields inherited from class com.arsdigita.bebop.ControlLink |
TYPE_CONTROL |
| Fields inherited from class com.arsdigita.bebop.BaseLink |
m_child, m_noJavascriptURL, m_url |
| 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 | |
ToggleLink(Component child)
Create a ToggleLink that uses child
to label the link it generates when it is not selected, and
that displays child by itself when it is
selected. |
|
ToggleLink(String label)
Creates a ToggleLink that uses a Label
containing label to label the link it generates when it
is not selected, and that displays just the label by itself when it is
selected. |
|
| Method Summary | |
Iterator |
children()
Returns the selected component if it has been set. |
protected void |
generateExtraXMLAttributes(PageState s,
Element link)
Adds a selected attribute to the standard XML generated by
Link. |
void |
generateXML(PageState s,
Element e)
Generates a DOM fragment: |
Component |
getSelectedComponent()
Gets the component that is displayed if the link is selected. |
boolean |
isSelected(PageState s)
Returns true if the link is currently selected in the request
represented by s |
void |
register(Page p)
Registers the link and its state with the page. |
void |
respond(PageState s)
Responds to the incoming request represented by s. |
void |
setControlEvent(PageState s)
Sets the page state's control event so that generated links cause this link's selected state to be toggled when the user clicks them. |
void |
setSelected(PageState s,
boolean v)
Sets whether the link is selected in the context of the request described by s. |
void |
setSelectedComponent(Component v)
Sets the component that is displayed if the link is selected. |
| Methods inherited from class com.arsdigita.bebop.ControlLink |
addActionListener, fireActionEvent, generateURL, removeActionListener |
| Methods inherited from class com.arsdigita.bebop.BaseLink |
addPrintListener, clone, firePrintEvent, getChild, getNoJavascriptTarget, getTarget, removePrintListener, setChild, setConfirmation, setNoJavascriptTarget, setOnClick, setTarget, setTypeAttr, setupNoJavascriptURL |
| Methods inherited from class com.arsdigita.bebop.TextStylable |
setBackgroundColor, setColor |
| Methods inherited from class com.arsdigita.bebop.SimpleComponent |
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 |
| Field Detail |
public static final String versionId
protected final String TYPE_TOGGLE
ToggleLink
| Constructor Detail |
public ToggleLink(Component child)
ToggleLink that uses child
to label the link it generates when it is not selected, and
that displays child by itself when it is
selected. The child is selected by default.
child - the component used to label this linkpublic ToggleLink(String label)
ToggleLink that uses a Label
containing label to label the link it generates when it
is not selected, and that displays just the label by itself when it is
selected.
label - the string used to label this link| Method Detail |
public void register(Page p)
register in interface Componentregister in class SimpleComponentp - the page that contains this linkpublic void respond(PageState s)
s. Changes
whether the link is selected or not according to what is indicated in
s. Fires an ActionEvent
after updating its state.
respond in interface Componentrespond in class ControlLinks - represents the current requestpublic Iterator children()
children in interface Componentchildren in class SimpleComponentpublic boolean isSelected(PageState s)
true if the link is currently selected in the request
represented by s
s - describes the current request
true if the link is selected;
false otherwise.
public void setSelected(PageState s,
boolean v)
s.
s - describes the current requestv - true if the link is currently selectedpublic final Component getSelectedComponent()
public void setSelectedComponent(Component v)
v - the component to display if the link is selected
public void generateXML(PageState s,
Element e)
BaseLinkGenerates a DOM fragment:
<bebop:link href="..." type="..." %bebopAttr;/>The
href attribute contains the target the link
should point to. The type attribute is used to
give more finegrained control over which kind of link this element
represents. The types are link for a
Link, control for a ControlLink,
and toggle for a ToggleLink. There may be
additional attributes depending on what type of link this link
represents.
generateXML in interface ComponentgenerateXML in class BaseLinkBaseLink.generateXML(com.arsdigita.bebop.PageState, com.arsdigita.xml.Element),
generateXML(com.arsdigita.bebop.PageState, com.arsdigita.xml.Element)public void setControlEvent(PageState s)
setControlEvent in class ControlLinks - the current page state
protected void generateExtraXMLAttributes(PageState s,
Element link)
selected attribute to the standard XML generated by
Link. The value of the attribute is either
yes or no, reflecting whether the link is
selected or not.
generateExtraXMLAttributes in class BaseLinks - a PageState valuelink - an Element value
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||