com.arsdigita.bebop
Class ActionLink

java.lang.Object
  extended bycom.arsdigita.bebop.Completable
      extended bycom.arsdigita.bebop.SimpleComponent
          extended bycom.arsdigita.bebop.TextStylable
              extended bycom.arsdigita.bebop.BaseLink
                  extended bycom.arsdigita.bebop.ControlLink
                      extended bycom.arsdigita.bebop.ActionLink
All Implemented Interfaces:
Cloneable, Component, Lockable

public class ActionLink
extends ControlLink

A link that runs its action listeners when it is clicked. The target of the link is the Page in which the action link is contained.

Typically, an action link is used in the following way:

   ActionLink l = new ActionLink("Send email to everybody");
   l.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        System.out.println("Link was clicked.");
        ... figure out who everybody is and send them email ...
      }
   });
 

See BaseLink for a description of all Bebop Link classes and suggestions for using them.

Version:
$Id: //core-platform/dev/src/com/arsdigita/bebop/ActionLink.java#7 $
Author:
David Lutterkort

Field Summary
protected  String TYPE_ACTION
          The value for the XML type attribute for an ActionLink.
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
ActionLink(Component child)
          Constructs a new ActionLink.
ActionLink(String label)
          Constructs a new ActionLink with the given string label.
 
Method Summary
 void setControlEvent(PageState s)
          Sets the page state's control event.
 
Methods inherited from class com.arsdigita.bebop.ControlLink
addActionListener, fireActionEvent, generateURL, removeActionListener, respond
 
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

versionId

public static final String versionId
See Also:
Constant Field Values

TYPE_ACTION

protected final String TYPE_ACTION
The value for the XML type attribute for an ActionLink.

See Also:
Constant Field Values
Constructor Detail

ActionLink

public ActionLink(Component child)
Constructs a new ActionLink. The link encapsulates the child component (usually either a label or an image).

Parameters:
child - the component to be turned into a link

ActionLink

public ActionLink(String label)
Constructs a new ActionLink with the given string label.

Parameters:
label - the string label for the link
Method Detail

setControlEvent

public void setControlEvent(PageState s)
Sets the page state's control event. Should be overridden by child classes. By default, the link does not receive any control events.

Overrides:
setControlEvent in class ControlLink
Parameters:
s - the current page state


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