|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.servlet.tbeans.form.BaseChoiceBox
public abstract class BaseChoiceBox
The BaseChoiceBox is an abstract TransformationBean for creating a ChoiceBox. A ChoiceBox is a drop-down combo that allows a single selection.
The ChoiceBox TransformationBean gathers the selections from a model via the setModel method. A model must implement the javax.swing.ComboBoxModel 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:ChoiceBox 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 com.sas.util.transforms.TransformInterface |
labelTransform
|
protected javax.swing.ComboBoxModel |
model
The model for the ChoiceBox. |
static java.lang.String |
RB_KEY
Key used to lookup resources in the resource bundle. |
Constructor Summary | |
---|---|
BaseChoiceBox()
Construct a new ChoiceBox object. |
Method Summary | |
---|---|
javax.swing.ComboBoxModel |
getModel()
Return the model for the ChoiceBox. |
int |
getSelectedIndex()
Gets the index of single item to be marked as selected. |
java.lang.String |
getSelectedItem()
Gets the value of a single item to be marked as selected. |
protected java.lang.String |
getValueItemLabel(com.sas.util.ValueItem item)
|
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.ComboBoxModel comboBoxModel)
Sets the model for the ChoiceBox. |
void |
setSelectedIndex(int value)
Sets the index of single item 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 |
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 com.sas.util.transforms.TransformInterface labelTransform
protected javax.swing.ComboBoxModel model
Constructor Detail |
---|
public BaseChoiceBox()
Method Detail |
---|
public javax.swing.ComboBoxModel getModel()
setModel(javax.swing.ComboBoxModel)
public void setModel(javax.swing.ComboBoxModel comboBoxModel)
comboBoxModel
- The model for the ChoiceBoxgetModel()
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.IOException
setValidateSelection(boolean)
public int getSelectedIndex()
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.IOException
setValidateSelection(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 existpublic java.lang.String getSelectedItem()
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()
protected java.lang.String getValueItemLabel(com.sas.util.ValueItem item)
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |