|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.servlet.tbeans.form.BaseListBox
public abstract class BaseListBox
The BaseListBox is an abstract TransformationBean for creating a ListBox input field. A ListBox is a menu that allows either a single selection or multiple selections.
The ListBox TransformationBean gathers the selections from a model via the ListModel. A model must implement the javax.swing.ListModel interface in order to be used.
Note that subclasses of this bean actually provide the markup rendering used in/with Servlet and JavaServer Pages technologies. If you need to add support for a markup language that is not explicitly provided with AppDev Studio, then you must extend this class.
For More Information:
JSP custom tags provide an alternative to using the TransformationBeans. Visit the Custom Tag Library Reference for additional information on the sas:ListBox custom tag.
Note: A snapshot of the AppDev Studio Developers Site is installed on your local Web server when you install AppDev Studio. To access the site from webAF, select Help -> Developer Site .
| Field Summary | |
|---|---|
protected javax.swing.ListModel |
model
The model for the ListBox. |
static java.lang.String |
RB_KEY
Key used to lookup resources in the resource bundle. |
| Constructor Summary | |
|---|---|
BaseListBox()
Construct a new ListBox |
|
| Method Summary | |
|---|---|
javax.swing.ListModel |
getModel()
Return the model for the ListBox. |
boolean |
getMultipleSelections()
Gets the multiple selection attribute |
int |
getSelectedIndex()
Gets the index of single item to be marked as selected. |
int[] |
getSelectedIndexes()
Gets the array of index values of items to be marked as selected. |
java.lang.String |
getSelectedItem()
Gets the value of a single item to be marked as selected. |
javax.swing.ListModel |
getSelectedItems()
Gets the collection of values of items to be marked as selected. |
int |
getSize()
Gets the size attribute |
protected boolean |
isSelected(int index)
Determines if the given index should be marked as selected |
protected boolean |
isSelected(java.lang.String value)
Determines if the given value should be marked as selected |
boolean |
isValidateSelection()
Returns whether or not exceptions are thrown for setSelectedIndex() and setSelectedItem(). |
void |
setModel(javax.swing.ListModel listModel)
Sets the model for the ListBox. |
void |
setMultipleSelections(boolean value)
Sets the multiple selection attribute allowing multiple selections of values in the list. |
void |
setSelectedIndex(int value)
Sets the index of single item to be marked as selected. |
void |
setSelectedIndexes(int[] value)
Sets an array of index values for items to be marked as selected. |
void |
setSelectedItem(java.lang.String value)
Sets the value of a single item to be marked as selected. |
void |
setSelectedItem(java.lang.String value,
int defaultIndex)
Sets the value of a single item to be marked as selected. |
void |
setSelectedItems(javax.swing.ListModel values)
Sets a collection of values of items to be marked as selected. |
void |
setSelectedItems(javax.swing.ListModel values,
int defaultIndex)
Sets a collection of values of items to be marked as selected. |
void |
setSize(int value)
Sets the size attribute. |
void |
setValidateSelection(boolean value)
Determines whether or not exceptions are thrown for setSelectedIndex() and setSelectedItem(). |
| Field Detail |
|---|
public static final java.lang.String RB_KEY
protected javax.swing.ListModel model
| Constructor Detail |
|---|
public BaseListBox()
| Method Detail |
|---|
public javax.swing.ListModel getModel()
setModel(javax.swing.ListModel)public void setModel(javax.swing.ListModel listModel)
listModel - the model for the ListBoxgetModel()public void setSize(int value)
size - The maximum number of values visible to the userpublic int getSize()
public void setMultipleSelections(boolean value)
multiple - true if multiple selections are allowedpublic boolean getMultipleSelections()
public void setSelectedIndex(int value)
throws java.io.IOException
index - The 0-based index of the item to be selected, or -1 for none
java.lang.IllegalArgumentException - Thrown if index is out of bounds and setValidateSelection(true)
java.io.IOExceptionsetValidateSelection(boolean)
public void setSelectedIndexes(int[] value)
throws java.io.IOException
indexArray - An array of 0-based index values for items to be selected
java.lang.IllegalArgumentException - Thrown if index is out of bounds and setValidateSelection(true)
java.io.IOExceptionsetValidateSelection(boolean)public int getSelectedIndex()
public int[] getSelectedIndexes()
public void setSelectedItem(java.lang.String value)
throws java.io.IOException
value - The value of the item to be selected
java.lang.IllegalArgumentException - Thrown if item is not found and setValidateSelection(true)
java.io.IOExceptionsetValidateSelection(boolean)
public void setSelectedItem(java.lang.String value,
int defaultIndex)
value - The value of the item to be selectedindex - The 0-based index of the item to be selected, or -1 to remain the same, if selectedItem does not exist
public void setSelectedItems(javax.swing.ListModel values)
throws java.io.IOException
values - The collection of values to be marked as selected
java.lang.IllegalArgumentException - Thrown if item is not found and setValidateSelection(true)
java.io.IOException
public void setSelectedItems(javax.swing.ListModel values,
int defaultIndex)
values - The collection of values to be marked as selectedindex - The 0-based index of the item to be selected, or -1 to remain the same, if selectedItem does not existpublic java.lang.String getSelectedItem()
public javax.swing.ListModel getSelectedItems()
protected boolean isSelected(int index)
index - The index to check
protected boolean isSelected(java.lang.String value)
value - The value to check
public void setValidateSelection(boolean value)
value - true if exceptions should be thrown for setSelectedIndex() and setSelectedItem()setSelectedIndex(int),
setSelectedItem(java.lang.String)public boolean isValidateSelection()
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||