|
PAJES 2.3.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.pajes.html.Tag
org.pajes.html.TraversableElement
org.pajes.html.SingleElementContainer
org.pajes.html.Anchor
This class builds the HTML ANCHOR tags (<a></a>) for defining hyper links.
| Field Summary | |
protected static java.lang.String |
AMPERSAND
The & character |
protected java.util.HashMap |
parameters
Map of parameters added with addParameter(java.lang.String, java.lang.String). |
protected static java.lang.String |
QUESTION_MARK
The ? character |
| Fields inherited from class org.pajes.html.Tag |
ON_CLICK_ATTRIBUTE, TAG_CLOSE, TAG_LEFT, TAG_RIGHT |
| Constructor Summary | |
Anchor()
Create an empty HTML Anchor tag. |
|
Anchor(HTML text,
java.lang.String url)
Create an HTML Anchor tag. |
|
Anchor(HTML text,
java.lang.String url,
java.lang.String frameTarget)
Create an HTML Anchor tag. |
|
Anchor(HTML text,
java.lang.String url,
java.lang.String frameTarget,
java.lang.String name)
Create an HTML Anchor tag. |
|
Anchor(java.lang.String text,
java.lang.String url)
Create an HTML Anchor tag. |
|
Anchor(java.lang.String text,
java.lang.String url,
java.lang.String frameTarget)
Create an HTML Anchor tag. |
|
Anchor(java.lang.String text,
java.lang.String url,
java.lang.String frameTarget,
java.lang.String name)
Create an HTML Anchor tag. |
|
| Method Summary | |
Anchor |
addParameter(java.lang.String name,
java.lang.String value)
Add a parameter to the Anchor eg. |
Anchor |
clearParameters()
Clears all parameters that have been defined on this anchor. |
java.lang.Object |
clone()
Clones the Anchor. |
java.lang.String |
getContainedText()
Returns the text that this object contains. |
java.lang.String |
getHREF(Browser browser)
Returns the full HREF of the link, including any defined parameters. |
java.lang.String |
getName()
Returns the name attribute of this input element. |
int |
getParameterCount()
Returns the number of parameters. |
protected java.util.HashMap |
getParameters()
Returns the internal parameters HashMap. |
java.lang.String |
getTarget()
Returns the target frame for this link. |
HTML |
getText()
Returns the text that this anchor or link surrounds. |
java.lang.String |
getURL()
Returns the destination URL of the anchor. |
protected void |
init()
Called by the constructor and the Tag.destroy() method to correctly
clear and initialise internal variables. |
protected void |
setAttribute(TagAttribute attribute)
Adds the specified attribute. |
Anchor |
setName(java.lang.String name)
Sets the name of this Anchor tag. |
Anchor |
setStatusDisplay(java.lang.String text)
Sets the appropriate OnMouseOver and OnMouseOut handlers to change the window status display to the specified text. |
Anchor |
setTarget(java.lang.String frameTarget)
Sets the target frame of the anchor. |
Anchor |
setText(HTML text)
Sets the text of the anchor. |
Anchor |
setText(java.lang.String text)
Sets the text of the anchor. |
Anchor |
setURL(java.lang.String url)
Sets the destination URL of the anchor. |
Anchor |
setURL(URI url)
Sets the destination URL of the anchor. |
protected void |
writeContent(Browser browser)
Called by the Tag.write(org.pajes.servlet.Browser) method to write any content between the
start and end tags. |
| Methods inherited from class org.pajes.html.SingleElementContainer |
get, set, size |
| Methods inherited from class org.pajes.html.TraversableElement |
dump, dump, getAll, getFieldByName, getFirstFieldByName, getFirstTagByAttribute, getFirstTagByClass, getFirstTagByID, getFirstTagByName, getTagByAttribute, getTagByClass, getTagByID, getTagByName, setWritable |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static final java.lang.String AMPERSAND
protected static final java.lang.String QUESTION_MARK
protected java.util.HashMap parameters
addParameter(java.lang.String, java.lang.String).
| Constructor Detail |
public Anchor()
public Anchor(java.lang.String text,
java.lang.String url)
text - the text to appear in the anchor.url - the destination URL to goto when the anchor is selected
public Anchor(java.lang.String text,
java.lang.String url,
java.lang.String frameTarget)
text - the text to appear in the anchorurl - the destination URL to goto when the anchor is selectedframeTarget - the frame in which the page will appear
public Anchor(java.lang.String text,
java.lang.String url,
java.lang.String frameTarget,
java.lang.String name)
text - the text to appear in the anchorurl - the destination URL to goto when the anchor is selectedframeTarget - the frame in which the page will appearname - the name of the anchor (used by JavaScript)
public Anchor(HTML text,
java.lang.String url)
text - the text to appear in the anchorurl - the destination URL to goto when the anchor is selected
public Anchor(HTML text,
java.lang.String url,
java.lang.String frameTarget)
text - the text to appear in the anchorurl - the destination URL to goto when the anchor is selectedframeTarget - the frame in which the page will appear
public Anchor(HTML text,
java.lang.String url,
java.lang.String frameTarget,
java.lang.String name)
text - the text to appear in the anchorurl - the destination URL to goto when the anchor is selectedframeTarget - the frame in which the page will appearname - the name of the anchor (used by JavaScript)| Method Detail |
public java.lang.String getContainedText()
getContainedText in interface TextContainerpublic java.lang.String getHREF(Browser browser)
parameters.
browser - the browser object.
public Anchor setName(java.lang.String name)
name - the name to apply to the input object.
public java.lang.String getName()
public int getParameterCount()
public Anchor setStatusDisplay(java.lang.String text)
text - is the text to be displayed in the status bar. If null, the
OnMouseOver and OnMouseOut handlers are cleared.
public Anchor setTarget(java.lang.String frameTarget)
frameTarget - the name of the target frame.
public java.lang.String getTarget()
public Anchor setText(java.lang.String text)
text - is the text to be displayed.
public Anchor setText(HTML text)
text - is the HTML text object to be displayed.
public HTML getText()
public Anchor setURL(java.lang.String url)
url - the destination URL.
public Anchor setURL(URI url)
url - the destination URL.
public java.lang.String getURL()
public Anchor addParameter(java.lang.String name,
java.lang.String value)
name - the name of the parametervalue - the value of the parameter
public Anchor clearParameters()
public java.lang.Object clone()
clone in interface HTMLclone in class Tagprotected void setAttribute(TagAttribute attribute)
setAttribute in class Tagattribute - The attribute.protected java.util.HashMap getParameters()
addParameter(java.lang.String, java.lang.String)protected void init()
Tag.destroy() method to correctly
clear and initialise internal variables.
Sub-classes must call super.init() before doing
anything else to ensure the Tag is initialised correctly.
init in class Tag
protected void writeContent(Browser browser)
throws java.io.IOException
SingleElementContainerTag.write(org.pajes.servlet.Browser) method to write any content between the
start and end tags.
writeContent in class SingleElementContainerbrowser - the browser to which the results are to be output.
java.io.IOException - if an I/O error occurs writing to the browser.Tag.writeContent(Browser)
|
PAJES 2.3.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||