com.mentata.sg8
Class SG8DiscreteAttribute

java.lang.Object
  extended bycom.mentata.l3d.L3DAttribute
      extended bycom.mentata.sg8.SG8StringAttribute
          extended bycom.mentata.sg8.SG8DiscreteAttribute
All Implemented Interfaces:
Comparator, SG8Attribute
Direct Known Subclasses:
SG8BooleanAttribute, SG8LangAttribute

public class SG8DiscreteAttribute
extends SG8StringAttribute

An attribute with a defined set of possible values for use with SG8 objects. This attribute type is assigned a set of possible values. Attribute update form elements will be selection boxes, and new values are checked against permitted ones before being added. Instances can also be configured to display labels in the selection box to hide raw values.

Since:
0.7
Author:
Jon Roberts

Field Summary
 
Fields inherited from interface com.mentata.sg8.SG8Attribute
TEXT_RESOURCES
 
Constructor Summary
SG8DiscreteAttribute()
          Constructs an empty discrete attribute.
SG8DiscreteAttribute(String[] options)
          Constructs an empty attribute updated with a specific range of values.
SG8DiscreteAttribute(String[] options, String[] labels)
          Constructs an empty attribute updated with a specific range of values and labels.
 
Method Summary
 String getUpdateHTML()
          Returns HTML selection elements for updating or adding values.
 
Methods inherited from class com.mentata.sg8.SG8StringAttribute
getHTMLValues, getHyperlink, getSeparator, getSG8Object, isAugmenting, isHTMLExceeded, processUpdateHTML, setAugmenting, setHTMLThreshold, setSeparator
 
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
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

SG8DiscreteAttribute

public SG8DiscreteAttribute()
Constructs an empty discrete attribute.


SG8DiscreteAttribute

public SG8DiscreteAttribute(String[] options)
Constructs an empty attribute updated with a specific range of values.

Parameters:
options - the possible values for the attribute

SG8DiscreteAttribute

public SG8DiscreteAttribute(String[] options,
                            String[] labels)
Constructs an empty attribute updated with a specific range of values and labels.

Parameters:
options - the possible values for the attribute
labels - the corresponding display labels for each value
Method Detail

getUpdateHTML

public String getUpdateHTML()
                     throws SG8Exception
Returns HTML selection elements for updating or adding values.

Specified by:
getUpdateHTML in interface SG8Attribute
Overrides:
getUpdateHTML in class SG8StringAttribute
Returns:
the HTML modification form elements
Throws:
SG8Exception - if the attribute is generated