|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groiss.gui.AbstractComponent
com.groiss.gui.component.SelectList
public class SelectList
A HTML select list with size >1.
| Field Summary | |
|---|---|
static java.lang.String |
MULTIPLE
|
static java.lang.String |
OPTION
|
static java.lang.String |
SELECT
|
static java.lang.String |
SELECTED
|
static java.lang.String |
SELECTLIST
|
static java.lang.String |
SIZE
|
static java.lang.String |
VALUE
|
| Fields inherited from class com.groiss.gui.AbstractComponent |
|---|
actions, ACTIVE, browserMode, DEFAULT, ID, IE, INVISIBLE, isSensitive, label, NS, ON_BLUR, ON_CLICK, ON_DBLCLICK, ON_FOCUS, ON_KEY_DOWN, ON_KEY_PRESS, ON_KEY_UP, ON_LOAD, ON_MOUSE_DOWN, ON_MOUSE_MOVE, ON_MOUSE_OUT, ON_MOUSE_UP, ON_RESET, ON_SELECT, ON_SUBMIT, ON_UNLOAD, outputRoot, outputter, parent, parentElem, READONLY, root, viewMode |
| Constructor Summary | |
|---|---|
SelectList()
Constructs a new empty dropdown list component. |
|
SelectList(java.lang.String name,
java.util.Collection list,
int size)
Constructor with name and content list. |
|
SelectList(java.lang.String name,
java.util.Collection list,
int size,
boolean showNull)
Constructor with name and content list. |
|
SelectList(java.lang.String name,
java.util.Collection list,
int size,
boolean showNull,
java.lang.String selected)
Constructor with name and content list. |
|
SelectList(java.lang.String name,
java.util.Collection list,
int size,
boolean showNull,
java.lang.String selected,
java.lang.String styleClass)
Constructor with name and content list. |
|
SelectList(java.lang.String name,
int size)
Constructor with name. |
|
| Method Summary | |
|---|---|
void |
addOption(org.jdom.Element option)
adds a new option at the end to the dropdownlist |
void |
addOption(int i,
org.jdom.Element option)
adds a new option at the passed position within the dropdownlist |
void |
addOption(int i,
java.lang.String value,
java.lang.String text)
|
void |
addOption(KeyValuePair p)
Adds a new option at the end to the dropdownlist |
void |
addOption(java.lang.String value,
java.lang.String text)
adds a new option at the end to the dropdownlist |
void |
deleteOption(int index)
Removes the specified option, if it can be identified, from the dropdownlist. |
void |
deleteOption(java.lang.String value)
Removes the specified option, if it can be identified, from the dropdownlist. |
void |
deleteOption(java.lang.String value,
java.lang.String text)
Deprecated. use method with one argument |
java.lang.Object |
getContent()
|
int |
getOptionIndex(java.lang.String value,
java.lang.String text)
returns the index of the specified option (identified by value-text-pair |
java.lang.String |
getOptionText(int index)
Returns the displayed text of the specified option. |
java.util.Vector |
getOptionTexts()
Returns a vector with the displayed text of every option. |
java.lang.String |
getOptionValue(int index)
Returns the value of the specified option. |
java.util.Vector |
getOptionValues()
Returns a vector with the value of every options. |
int |
getSelectedOption()
Returns the index of the selected option. |
int[] |
getSelections()
returns a array of all selected options |
int |
getSize()
returns the number of nested options in the dropdownlist - the size |
boolean |
isSelected(int index)
Returns whether the specified option has the attribute SELECTED, or not |
void |
removeSelection()
Removes the attribute SELECTED from the selected option. |
void |
removeSelections()
removes the attribute SELECTED from the selected options |
void |
setContent(java.lang.Object o)
Sets the content of the component. |
void |
setContent(java.lang.Object o,
boolean showNull)
Sets the content of the component. |
void |
setContent(java.lang.Object o,
KeyValuePair val)
Sets the content of the component. |
void |
setDisplayedSize(int size)
sets the displayed list size |
void |
setMultiple(boolean yesno)
|
void |
setSelectedOption(int index)
Adds the attribute SELECTED to the specified option. |
void |
setSelectedOption(java.lang.String value)
Adds the attribute SELECTED to the specified option. |
void |
setSelectedOptions(java.util.Vector vals)
|
java.lang.String |
showOptions()
Show the options text. |
| Methods inherited from class com.groiss.gui.AbstractComponent |
|---|
clone, getActionListener, getAttribute, getBrowserMode, getId, getLabel, getName, getParent, getParentElement, getRoot, getRootName, getStyle, getViewMode, init, init, init, removeAttribute, setActionListener, setAttribute, setBrowserMode, setEncoding, setExpandEmptyElements, setId, setIndenting, setLabel, setName, setNewLines, setParent, setParentElement, setRootName, setStyle, setViewMode, show, show, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.String OPTION
public static java.lang.String VALUE
public static java.lang.String SELECT
public static java.lang.String SIZE
public static java.lang.String MULTIPLE
public static java.lang.String SELECTED
public static java.lang.String SELECTLIST
| Constructor Detail |
|---|
public SelectList()
public SelectList(java.lang.String name,
int size)
name - the name of the form element
public SelectList(java.lang.String name,
java.util.Collection list,
int size)
name - the name of the form elementlist - the content listsize - the number of visible lines
public SelectList(java.lang.String name,
java.util.Collection list,
int size,
boolean showNull)
name - the name of the form elementlist - the content listsize - the number of visible linesshowNull - if true, add the option with value and display string empty to the begin of the list
public SelectList(java.lang.String name,
java.util.Collection list,
int size,
boolean showNull,
java.lang.String selected)
name - the name of the form elementlist - the content listsize - the number of visible linesshowNull - if true, add the option with value and display string empty
to the begin of the listselected - the option where the value equals this argument is selected
public SelectList(java.lang.String name,
java.util.Collection list,
int size,
boolean showNull,
java.lang.String selected,
java.lang.String styleClass)
name - the name of the form elementlist - the content listsize - the number of visible linesshowNull - if true, add the option with value and display string empty
to the begin of the listselected - the option where the value equals this argument is selectedstyleClass - the name of a CSS class| Method Detail |
|---|
public void setMultiple(boolean yesno)
public void addOption(java.lang.String value,
java.lang.String text)
value - the value of the new optiontext - the displayed text of the new option
public void addOption(int i,
java.lang.String value,
java.lang.String text)
public void addOption(org.jdom.Element option)
option - an Element describing the option to add
public void addOption(int i,
org.jdom.Element option)
i - the index where to add the optionoption - an Element describing the option to addpublic void addOption(KeyValuePair p)
p - the new option
public void deleteOption(java.lang.String value,
java.lang.String text)
value - the value of the specified optiontext - the displayed text of the new optionpublic void deleteOption(java.lang.String value)
value - the value of the specified optionpublic void deleteOption(int index)
index - the position of the specified option in the dropdownlistpublic java.lang.String getOptionText(int index)
index - the position of the specified option in the dropdownlist
public java.lang.String getOptionValue(int index)
index - the position of the specified option in the dropdownlist
public int getSelectedOption()
public void setSelectedOption(int index)
index - the option which is selectedpublic void setSelectedOption(java.lang.String value)
value - the option value which is selectedpublic void removeSelection()
public boolean isSelected(int index)
index - the index of the specified option
public java.util.Vector getOptionValues()
public java.util.Vector getOptionTexts()
public int getSize()
public void setContent(java.lang.Object o)
setContent in interface ComponentsetContent in class AbstractComponento - must be a collection
public void setContent(java.lang.Object o,
boolean showNull)
o - a collection of objects for the optionsshowNull - if true, add the option with value and display string empty to the begin of the list
public void setContent(java.lang.Object o,
KeyValuePair val)
o - a collection of objects for the optionsval - a pair where the key equals one of the keys of the content parameterpublic java.lang.Object getContent()
getContent in interface ComponentgetContent in class AbstractComponentpublic java.lang.String showOptions()
public void setSelectedOptions(java.util.Vector vals)
public int[] getSelections()
public void removeSelections()
public void setDisplayedSize(int size)
size - the size
public int getOptionIndex(java.lang.String value,
java.lang.String text)
value - the value of the specified optiontext - the displayed text of the specified option
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||