planetj.html
Class HTMLOption

java.lang.Object
  |
  +--planetj.html.HTMLElement
        |
        +--planetj.html.HTMLOption

public class HTMLOption
extends HTMLElement

Author:
planetj

Field Summary
static String LABEL
          Attribute used for the option's label.
static String OPTION_CLOSE
           
static String OPTION_OPEN_END
           
static String OPTION_OPEN_START
          Option tag start and ends.
static short ORDER_DISPLAY_SORT
          Indicates that this option should ordered by its display text in the select
static short ORDER_FIRST
          Indicates that this option should be the first one in the select
static short ORDER_LAST
          Indicates that this option should be the last one in the select
static String SELECTED
          Attribute used to denote option is selected.
 
Fields inherited from class planetj.html.HTMLElement
DISABLED
 
Constructor Summary
HTMLOption()
           
 
Method Summary
static StringBuffer appendOption(String value, boolean selected, StringBuffer html)
          Appends a HTML option tag for the given values.
 StringBuffer appendOption(StringBuffer sb)
          Appends a HTML option tag for the given values.
static StringBuffer appendOption(String value, String displayValue, boolean selected, StringBuffer html)
          Appends a HTML option tag for the given values.
static StringBuffer appendOption(String value, String displayValue, boolean selected, String styleClass, StringBuffer html)
          Appends a HTML option tag for the given values.
static StringBuffer appendOption(String value, StringBuffer html)
          Appends a HTML option tag for the given values.
static StringBuffer appendOption(String label, String value, String displayValue, boolean selected, StringBuffer html)
          Appends a HTML option tag for the given values.
static StringBuffer appendOption(String label, String value, String displayValue, boolean selected, String styleClass, StringBuffer html)
          Appends a HTML option tag for the given values.
static StringBuffer appendOption(String value, String displayValue, StringBuffer html)
          Appends a HTML option tag for the given values.
static StringBuffer appendOptions(List options, StringBuffer html)
          Appends multiple HTML Option objects to a StringBuffer of HTML
 String getDisplayText()
          Gets this option's display text
 short getOrder()
          Sets this option's order.
 String getStyleClass()
          Gets the CSS style class of this option
 String getValue()
          Returns the value.
 boolean isSelected()
          Tests if this option is selected
 void setDisplayText(String displayText)
          Sets this option's display text
 void setOrder(short order)
          Sets this option's order.
 void setSelected(boolean selected)
          Sets if this option is selected
 void setStyleClass(String styleClass)
          Gets the CSS style class of this option
 void setValue(String value)
          Sets the value.
 String toString()
           
 
Methods inherited from class planetj.html.HTMLElement
appendAttribute, appendAttribute, appendExtractableHiddenField, getId, isDisplayField, setId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ORDER_FIRST

public static final short ORDER_FIRST
Indicates that this option should be the first one in the select

See Also:
Constant Field Values

ORDER_LAST

public static final short ORDER_LAST
Indicates that this option should be the last one in the select

See Also:
Constant Field Values

ORDER_DISPLAY_SORT

public static final short ORDER_DISPLAY_SORT
Indicates that this option should ordered by its display text in the select

See Also:
Constant Field Values

SELECTED

public static final String SELECTED
Attribute used to denote option is selected.

See Also:
Constant Field Values

LABEL

public static final String LABEL
Attribute used for the option's label.

See Also:
Constant Field Values

OPTION_OPEN_START

public static final String OPTION_OPEN_START
Option tag start and ends.

See Also:
Constant Field Values

OPTION_OPEN_END

public static final String OPTION_OPEN_END
See Also:
Constant Field Values

OPTION_CLOSE

public static final String OPTION_CLOSE
See Also:
Constant Field Values
Constructor Detail

HTMLOption

public HTMLOption()
Method Detail

appendOption

public static StringBuffer appendOption(String label,
                                        String value,
                                        String displayValue,
                                        boolean selected,
                                        String styleClass,
                                        StringBuffer html)
Appends a HTML option tag for the given values.


appendOption

public static StringBuffer appendOption(String label,
                                        String value,
                                        String displayValue,
                                        boolean selected,
                                        StringBuffer html)
Appends a HTML option tag for the given values.


appendOption

public static StringBuffer appendOption(String value,
                                        String displayValue,
                                        StringBuffer html)
Appends a HTML option tag for the given values.


appendOption

public static StringBuffer appendOption(String value,
                                        String displayValue,
                                        boolean selected,
                                        String styleClass,
                                        StringBuffer html)
Appends a HTML option tag for the given values.


appendOption

public static StringBuffer appendOption(String value,
                                        String displayValue,
                                        boolean selected,
                                        StringBuffer html)
Appends a HTML option tag for the given values.


appendOption

public static StringBuffer appendOption(String value,
                                        StringBuffer html)
Appends a HTML option tag for the given values.


appendOption

public static StringBuffer appendOption(String value,
                                        boolean selected,
                                        StringBuffer html)
Appends a HTML option tag for the given values.


appendOption

public StringBuffer appendOption(StringBuffer sb)
Appends a HTML option tag for the given values.


appendOptions

public static StringBuffer appendOptions(List options,
                                         StringBuffer html)
Appends multiple HTML Option objects to a StringBuffer of HTML


getDisplayText

public String getDisplayText()
Gets this option's display text


getOrder

public short getOrder()
Sets this option's order. This can either be an absoloute order or one of the special order constants


getStyleClass

public String getStyleClass()
Gets the CSS style class of this option


getValue

public String getValue()
Returns the value.

Returns:
String

isSelected

public boolean isSelected()
Tests if this option is selected


setDisplayText

public void setDisplayText(String displayText)
Sets this option's display text


setOrder

public void setOrder(short order)
Sets this option's order. This can either be an absoloute order or one of the special order constants


setSelected

public void setSelected(boolean selected)
Sets if this option is selected


setStyleClass

public void setStyleClass(String styleClass)
Gets the CSS style class of this option


setValue

public void setValue(String value)
Sets the value.

Parameters:
value - The value to set

toString

public String toString()
Overrides:
toString in class Object