com.sas.servlet.beans
Class BaseChoicebox

java.lang.Object
  |
  +--com.sas.Component
        |
        +--com.sas.servlet.beans.BaseTransformation
              |
              +--com.sas.servlet.beans.BaseChoicebox
Direct Known Subclasses:
Choicebox

public abstract class BaseChoicebox
extends BaseTransformation
implements ChoiceboxInterface

Transformation bean definition for creating a Choicebox. A Choicebox is a drop-down combo that allows a single selection.

The Choicebox Transformation Bean gathers the selections from a model via the setModelInterface method. A model must implement the com.sas.collection.StaticOrderedCollection interface in order to be used.

See Also:
Serialized Form

Constructor Summary
BaseChoicebox()
           
 
Method Summary
 StaticOrderedCollectionInterface getDescriptionModel()
          Gets the model to be used for the decriptions of the choice entry.
 Vector getRequiredInterfaces()
          Sets the required interface that a model must implement in order to attach to this bean Models must implement com.sas.collection.StaticOrderedCollectionInterface in order to be used by this transformation bean
 int getSelectedIndex()
          Gets the index of single item to be marked as selected.
 String getSelectedItem()
          Gets the value of a single item to be marked as selected.
protected  boolean isSelected(int index)
          Determines if the given index should be marked as selected
protected  boolean isSelected(String value)
          Determines if the given value should be marked as selected
 void setDescriptionModel(StaticOrderedCollectionInterface model)
          Sets the model to be used for the decriptions of the choice entry.
 void setSelectedIndex(int value)
          Sets the index of single item to be marked as selected.
 void setSelectedItem(String value)
          Sets the value of a single item to be marked as selected.
 
Methods inherited from class com.sas.servlet.beans.BaseTransformation
getCustomAttributes, getDescription, getName, getParent, getRequest, getResponse, setCustomAttributes, setDescription, setName, setParent, setRequest, setResponse, toString, write, write, write, write
 
Methods inherited from class com.sas.Component
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachModel, attachView, beansIsDesignTime, beansSetDesignTime, clone, clone, detachModel, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getExtendedBeanInfo, getLinkInfo, getModelInterface, getResources, getStringResource, getViewInterfaceSupportInfo, initialize, initializeComponent, isDesignTime, isLinked, propertyChange, queryLinks, queryLinks, refresh, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setComponentDescription, setComponentSupportInfo, setDefaultValues, setLinkInfo, setModelInterface, setRequiredInterfaces, setViewInterfaceSupportInfo, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, validateObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseChoicebox

public BaseChoicebox()
Method Detail

getRequiredInterfaces

public Vector getRequiredInterfaces()
Sets the required interface that a model must implement in order to attach to this bean Models must implement com.sas.collection.StaticOrderedCollectionInterface in order to be used by this transformation bean
Returns:
An array of interface names
Overrides:
getRequiredInterfaces in class Component

setSelectedIndex

public void setSelectedIndex(int value)
                      throws IOException
Sets the index of single item to be marked as selected. Setting the index will set the corresponding selectedItem.
Specified by:
setSelectedIndex in interface ChoiceboxInterface
Parameters:
index - The 0-based index of the item to be selected, or -1 for none

getSelectedIndex

public int getSelectedIndex()
Gets the index of single item to be marked as selected. If more than one index has been set this will return a -1.
Specified by:
getSelectedIndex in interface ChoiceboxInterface
Returns:
The array of 0-based values, or null for none

setSelectedItem

public void setSelectedItem(String value)
                     throws IOException
Sets the value of a single item to be marked as selected. Setting the value will set the corresponding selectedIndex.
Specified by:
setSelectedItem in interface ChoiceboxInterface
Parameters:
value - The value of the item to be selected

getSelectedItem

public String getSelectedItem()
Gets the value of a single item to be marked as selected. If more than one value has been set this will return a blank string
Specified by:
getSelectedItem in interface ChoiceboxInterface
Returns:
The collection of selected values, or null for none

isSelected

protected boolean isSelected(int index)
Determines if the given index should be marked as selected
Parameters:
index - The index to check
Returns:
true if the index should be marked as selected

isSelected

protected boolean isSelected(String value)
Determines if the given value should be marked as selected
Parameters:
value - The value to check
Returns:
true if the value should be marked as selected

setDescriptionModel

public void setDescriptionModel(StaticOrderedCollectionInterface model)
Sets the model to be used for the decriptions of the choice entry. The default is to use the model specified in setModelInterface, which will cause the value of the choice to be the same as the text.
Specified by:
setDescriptionModel in interface ChoiceboxInterface
Parameters:
model - The collection to use for the descriptions

getDescriptionModel

public StaticOrderedCollectionInterface getDescriptionModel()
Gets the model to be used for the decriptions of the choice entry. The default is to use the model specified in setModelInterface.
Specified by:
getDescriptionModel in interface ChoiceboxInterface
Returns:
The collection to use for the descriptions


Version: 1.2.20000317.001 Formatted: 2000/07/06 15:57:33PM