|
|||||||||||
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
A link back to the page in which it is contained. The control link captures
and preserves the current state of the page, and possibly any control events
that have been set. It is most useful inside a ListCellRenderer
or a TableCellRenderer
, where the list or table has
already set up the events 'tight' for the control link to do the right thing.
Warning: Even though a control link lets you add action
listeners, they are not run unless you override setControlEvent
. If you need this behavior, you should use an ActionLink
. A control link is hardly ever useful unless it is contained
in an event-generating component like List
or Table
.
Example: A control link is mainly useful to send events to other components. For example, the following control link will cause a control event delete with associated value 42 to be sent to the component fooComponent when the user clicks on it:
ControlLink l = new ControlLink("click here") { public void setControlEvent(PageState s) { s.setControlEvent(fooComponent, "delete", 42); } };
This requires that fooComponent is part of the page
hierarchy. The control link l does not have to be part of the
page hierarchy, and may be generated on the fly. (See
PageState
for details on control events.)
See BaseLink
for a description
of all Bebop Link classes.
Field Summary | |
protected String |
TYPE_CONTROL
The XML type attribute for a ControlLink . |
static String |
versionId
|
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 | |
ControlLink(Component child)
Constructs a new ControlLink. |
|
ControlLink(String label)
Constructs a new ControlLink with the given string label. |
Method Summary | |
void |
addActionListener(ActionListener l)
Adds an ActionListener , which will be run when respond is called. |
protected void |
fireActionEvent(PageState state)
Fires an ActionEvent , which causes all registered
ActionListener s to be run. |
protected void |
generateURL(PageState state,
Element parent)
Generates the URL for a link and sets it as the "href" attribute of the parent. |
void |
removeActionListener(ActionListener l)
Removes a previously added ActionListener . |
void |
respond(PageState state)
Responds to the incoming request. |
void |
setControlEvent(PageState ps)
Sets the page state's control event. |
Methods inherited from class com.arsdigita.bebop.BaseLink |
addPrintListener, clone, firePrintEvent, generateExtraXMLAttributes, generateXML, 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 |
children, exportAttributes, getAttribute, getClassAttr, getIdAttr, getKey, getMetaDataAttribute, getStyleAttr, hasAttributes, isLocked, isVisible, lock, register, 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_CONTROL
ControlLink
.
Constructor Detail |
public ControlLink(Component child)
child
- the component that will be turned into a linkpublic ControlLink(String label)
label
- the string label for the linkMethod Detail |
public void addActionListener(ActionListener l)
ActionListener
, which will be run when respond
is called.
respond
public void removeActionListener(ActionListener l)
ActionListener
.
addActionListener
protected void fireActionEvent(PageState state)
ActionEvent
, which causes all registered
ActionListener
s to be run. The source of the event
is the TabbedPane
.
state
- the current page staterespond
public void respond(PageState state)
ActionEvent
.
respond
in interface Component
respond
in class SimpleComponent
state
- the current page stateprotected void generateURL(PageState state, Element parent)
generateURL
in class BaseLink
state
- the current page stateparent
- the parent elementpublic void setControlEvent(PageState ps)
ps
- the current page state
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |