com.mentata.sg8
Class SG8URLAttribute
java.lang.Object
com.mentata.l3d.L3DAttribute
com.mentata.sg8.SG8StringAttribute
com.mentata.sg8.SG8URLAttribute
- All Implemented Interfaces:
- Comparator, SG8Attribute
- public class SG8URLAttribute
- extends SG8StringAttribute
A URL attribute for use with SG8 objects.
This attribute type represents labelled URLs that are translated into hyperlinks for HTML output, with the option to specify a target window. Instances generate and process update form elements that allow separate modification of the href URL and link text.
- Since:
- 0.7
- Author:
- Jon Roberts
| Methods inherited from class com.mentata.l3d.L3DAttribute |
addValue, compare, getAttribute, getBind, getContext, getLabel, getLengthThreshold, getName, getObject, getObject, getPrerequisites, getShortValues, getSize, getThreshold, getValues, initialize, isBound, isExceeded, isGenerated, isLengthExceeded, isMultivalue, isRequired, removeValue, same, setGenerated, setLabel, setLengthThreshold, setPrerequisites, setThreshold, setValues |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SG8URLAttribute
public SG8URLAttribute()
- Constructs an empty URL attribute.
SG8URLAttribute
public SG8URLAttribute(String target)
- Constructs an empty URL attribute using a given target window.
- Parameters:
target - the target window for the hyperlinks
getHTMLValues
public String[] getHTMLValues()
throws SG8Exception
- Returns the attribute values as translated to hyperlinks.
- Specified by:
getHTMLValues in interface SG8Attribute- Overrides:
getHTMLValues in class SG8StringAttribute
- Returns:
- HTML hyperlinks
- Throws:
SG8Exception
getUpdateHTML
public String getUpdateHTML()
throws SG8Exception
- Returns HTML form elements for modifying the URL and label.
- Specified by:
getUpdateHTML in interface SG8Attribute- Overrides:
getUpdateHTML in class SG8StringAttribute
- Returns:
- the HTML modification form elements
- Throws:
SG8Exception - if the attribute is generated
processUpdateHTML
public boolean processUpdateHTML(HttpServletRequest req)
throws SG8Exception
- Reads and processes attribute changes from relevant HTML request form parameters.
- Specified by:
processUpdateHTML in interface SG8Attribute- Overrides:
processUpdateHTML in class SG8StringAttribute
- Parameters:
req - a servlet request
- Returns:
- whether the attribute values changed
- Throws:
SG8Exception - if form values are inappropriate or the attribute is generated