PAJES 2.3.9

org.pajes.html
Class AnchorButton

java.lang.Object
  extended byorg.pajes.html.Tag
      extended byorg.pajes.html.TraversableElement
          extended byorg.pajes.html.SingleElementContainer
              extended byorg.pajes.html.Anchor
                  extended byorg.pajes.html.AnchorButton
All Implemented Interfaces:
java.lang.Cloneable, HTML, java.io.Serializable, TextContainer, Traversable

public class AnchorButton
extends Anchor

This class creates button for a form which invokes a URL.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.pajes.html.Anchor
AMPERSAND, parameters, QUESTION_MARK
 
Fields inherited from class org.pajes.html.Tag
ON_CLICK_ATTRIBUTE, TAG_CLOSE, TAG_LEFT, TAG_RIGHT
 
Constructor Summary
AnchorButton(Anchor source, java.lang.String text)
          Create a button that invokes a URL.
AnchorButton(Button source, java.lang.String url, java.lang.String frameTarget)
          Create a button that invokes a URL.
AnchorButton(java.lang.String text, java.lang.String url, java.lang.String frameTarget)
          Create a button that invokes a URL.
AnchorButton(java.lang.String text, java.lang.String url, java.lang.String frameTarget, java.lang.String name)
          Create a button that invokes a URL.
 
Method Summary
 AnchorButton addParameter(java.lang.String name, Input field)
          Add a parameter to the Anchor where the value of the parameter is determined at button press time by the value of a specified Input field.
protected  void init()
          Called by the constructor and the Tag.destroy() method to correctly clear and initialise internal variables.
 AnchorButton setButtonText(java.lang.String text)
          Sets the text of the button.
 void write(Browser browser)
          Writes the <input type="button"> tag to the browser.
 
Methods inherited from class org.pajes.html.Anchor
addParameter, clearParameters, clone, getContainedText, getHREF, getName, getParameterCount, getParameters, getTarget, getText, getURL, setAttribute, setName, setStatusDisplay, setTarget, setText, setText, setURL, setURL, writeContent
 
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 org.pajes.html.Tag
addAttribute, addAttributes, addAttributes, addContent, clearAttribute, clearAttributes, destroy, getAttribute, getAttributes, getAttributeSet, getContainer, getContent, getDocument, getId, getOnClickHandler, getOnDBLClickHandler, getOnKeyDownHandler, getOnKeyPressHandler, getOnKeyUpHandler, getOnMouseDownHandler, getOnMouseOutHandler, getOnMouseOverHandler, getOnMouseUpHandler, getStyle, getStyleSheetClass, getTagName, getTitle, getWritePermission, initAttributes, isWritable, isWritable, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setContainer, setContent, setContent, setId, setOnClickHandler, setOnDBLClickHandler, setOnKeyDownHandler, setOnKeyPressHandler, setOnKeyUpHandler, setOnMouseDownHandler, setOnMouseOutHandler, setOnMouseOverHandler, setOnMouseUpHandler, setStyle, setStyleSheetClass, setTagName, setTitle, setWritable, setWriteAttributes, setWriteEndTag, setWritelnAfter, setWritelnAfterContent, setWritelnBefore, setWritelnBeforeContent, setWritePermission, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnchorButton

public AnchorButton(Anchor source,
                    java.lang.String text)
Create a button that invokes a URL.

Parameters:
source - The Anchor instance from which the attributes of this instance will be sourced.
text - is the text to be displayed on the button.

AnchorButton

public AnchorButton(Button source,
                    java.lang.String url,
                    java.lang.String frameTarget)
Create a button that invokes a URL.

Parameters:
source - The Button instance from which the attributes of this instance will be sourced.
url - The destination URL to goto when the button is pushed.
frameTarget - The frame that the page will appear in.

AnchorButton

public AnchorButton(java.lang.String text,
                    java.lang.String url,
                    java.lang.String frameTarget)
Create a button that invokes a URL.

Parameters:
text - The text to appear on the button.
url - The destination URL to goto when the button is pushed.
frameTarget - The frame that the page will appear in.

AnchorButton

public AnchorButton(java.lang.String text,
                    java.lang.String url,
                    java.lang.String frameTarget,
                    java.lang.String name)
Create a button that invokes a URL.

Parameters:
text - The text to appear on the button.
url - The destination URL to goto when the button is pushed.
frameTarget - The frame that the page will appear in.
name - The name of the button (used by JavaScript).
Method Detail

setButtonText

public AnchorButton setButtonText(java.lang.String text)
Sets the text of the button.

Parameters:
text - is the text to be displayed on the button.
Returns:
the modified Anchor object.

addParameter

public AnchorButton addParameter(java.lang.String name,
                                 Input field)
Add a parameter to the Anchor where the value of the parameter is determined at button press time by the value of a specified Input field.

Parameters:
name - the name of the variable name
field - the Input field containing the value
Returns:
the modified AnchorButton instance.

write

public void write(Browser browser)
           throws java.io.IOException
Writes the <input type="button"> tag to the browser.

Specified by:
write in interface HTML
Overrides:
write in class Tag
Parameters:
browser - the browser to which the results are to be output.
Throws:
java.io.IOException - if an I/O error occurs writing to the browser.
See Also:
Tag.setWriteEndTag(boolean), Tag.writeContent(org.pajes.servlet.Browser)

init

protected void init()
Called by the constructor and the 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.

Overrides:
init in class Anchor

PAJES 2.3.9

Copyright © 2002-2003 Viridian Pty Limited. All Rights Reserved.