|
|||||||||||
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
The parent of all Bebop Link classes, this class represents a URL on a page. It may contain a label, an image, or any other component.
The following table lists all Bebop Link classes and suggests when they might be used.
Link Class | Usage |
---|---|
BaseLink |
Parent class of Bebop Link classes. Extend this class to build your own Link class. |
Link |
Link class that manages its own URL variables. Session information is added to the target URL for this type. |
ExternalLink |
Link that does not encode the URL with any session information. Used for a link to a page outside the site. |
ControlLink |
Used for references within its own page (often as fields in a table header for sorting a column). |
ActionLink |
Sets its own control event and runs its own ActionListener s. When the link is clicked, the code in the Listener's actionPerformed method runs. |
ToggleLink |
A link that turns into label when it is selected and turns back into a link when it is unselected. |
Field Summary | |
protected Component |
m_child
|
protected String |
m_noJavascriptURL
|
protected String |
m_url
|
static String |
versionId
|
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 | |
BaseLink(Component child,
PrintListener l)
|
|
BaseLink(Component child,
String url)
|
|
BaseLink(PrintListener l)
|
|
BaseLink(String label,
PrintListener l)
|
|
BaseLink(String label,
String url)
|
Method Summary | |
void |
addPrintListener(PrintListener listener)
Adds a print listener. |
Object |
clone()
Clones a component. |
protected BaseLink |
firePrintEvent(PageState state)
|
protected void |
generateExtraXMLAttributes(PageState state,
Element link)
Adds type-specific XML attributes to the XML element representing this link. |
protected abstract void |
generateURL(PageState state,
Element parent)
|
void |
generateXML(PageState state,
Element parent)
Generates a DOM fragment: |
Component |
getChild()
|
String |
getNoJavascriptTarget()
|
String |
getTarget()
|
void |
removePrintListener(PrintListener listener)
Removes a previously added print listener. |
void |
setChild(Component child)
|
void |
setConfirmation(String message)
Forces the user to click through a confirmation dialog before this link is followed. |
void |
setNoJavascriptTarget(String sURL)
|
void |
setOnClick(String value)
Sets onClick event. |
void |
setTarget(String url)
|
protected void |
setTypeAttr(String t)
Sets the type of link this link represents. |
protected void |
setupNoJavascriptURL(PageState ps,
Element link)
|
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, respond, 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 String m_url
protected String m_noJavascriptURL
protected Component m_child
Constructor Detail |
public BaseLink(Component child, String url)
public BaseLink(String label, String url)
public BaseLink(Component child, PrintListener l)
public BaseLink(String label, PrintListener l)
public BaseLink(PrintListener l)
Method Detail |
public Object clone() throws CloneNotSupportedException
SimpleComponent
clone
in class SimpleComponent
CloneNotSupportedException
public void addPrintListener(PrintListener listener) throws IllegalStateException, TooManyListenersException
PrintListener
is expected to modify the
target of the PrintEvent
, only one print listener can be
set for a link.
listener
- the print listener
IllegalArgumentException
- if listener
is null.
TooManyListenersException
- if a print listener has previously been
added.
IllegalStateException
public void removePrintListener(PrintListener listener) throws IllegalArgumentException
listener
is
not the listener that was added with addPrintListener
, an IllegalArgumentException will be thrown.
listener
- the listener that was previously added with
addPrintListener
IllegalArgumentException
- if listener
is not the
currently registered print listener or is null
.protected BaseLink firePrintEvent(PageState state)
public final Component getChild()
public void setChild(Component child)
public final String getTarget()
public final void setTarget(String url)
protected void setTypeAttr(String t)
t
- the type of linkprotected abstract void generateURL(PageState state, Element parent)
public void generateXML(PageState state, Element parent)
Generates 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 Component
generateXML
in class SimpleComponent
generateXML(com.arsdigita.bebop.PageState, com.arsdigita.xml.Element)
,
ToggleLink.generateXML(com.arsdigita.bebop.PageState, com.arsdigita.xml.Element)
protected void setupNoJavascriptURL(PageState ps, Element link)
protected void generateExtraXMLAttributes(PageState state, Element link)
generateXML
produces by default.
state
- the current requestlink
- the XML element representing this linkpublic void setOnClick(String value)
value
- setConfirmation(java.lang.String)
public void setConfirmation(String message)
message
- the confirmation message presented to the user. This
message cannot have an apostrophe or back slashpublic final void setNoJavascriptTarget(String sURL)
public final String getNoJavascriptTarget()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |