com.sas.servlet.beans
Class BaseRadio

java.lang.Object
  |
  +--com.sas.Component
        |
        +--com.sas.servlet.beans.BaseTransformation
              |
              +--com.sas.servlet.beans.BaseRadio
Direct Known Subclasses:
Radio, Radio

public abstract class BaseRadio
extends BaseTransformation
implements RadioInterface

Transformation bean base object for creating a Radio input field, which is used for attributes which can take a single value from a set of alternatives.

The Radio Transformation Bean gathers the alternatives 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
BaseRadio()
           
 
Method Summary
 StaticOrderedCollectionInterface getDescriptionModel()
          Gets the model to be used for the descriptions of the radio entry.
 Vector getRequiredInterfaces()
          Gets 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 value of a single item to be marked as selected
 String getSelectedItem()
          Gets the value of a single item to be marked as selected
 boolean isBreak()
          Gets the flag indicating whether to force a break after each input field.
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 setBreak(boolean value)
          Forces a break after each input field.
 void setDescriptionModel(StaticOrderedCollectionInterface model)
          Sets the model to be used for the descriptions of the radio entry.
 void setSelectedIndex(int value)
          Sets the index of a 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

BaseRadio

public BaseRadio()
Method Detail

getRequiredInterfaces

public Vector getRequiredInterfaces()
Gets 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 a single item to be marked as selected. Setting the index will also update the corresponding selectedItem.
Specified by:
setSelectedIndex in interface RadioInterface
Parameters:
index - The 0-based index of the item to be selected, or -1 for none

setSelectedItem

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

getSelectedIndex

public int getSelectedIndex()
Gets the index value of a single item to be marked as selected
Specified by:
getSelectedIndex in interface RadioInterface
Returns:
The of 0-based index of the item to be selected, or -1 for none

getSelectedItem

public String getSelectedItem()
Gets the value of a single item to be marked as selected
Specified by:
getSelectedItem in interface RadioInterface
Returns:
The value of the item to be selected, 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:
index - The value to check
Returns:
true if the value should be marked as selected

setBreak

public void setBreak(boolean value)
Forces a break after each input field. Default is true
Specified by:
setBreak in interface RadioInterface
Parameters:
break - Set to true to force a line break after each input field

isBreak

public boolean isBreak()
Gets the flag indicating whether to force a break after each input field.
Specified by:
isBreak in interface RadioInterface
Returns:
True to force a line break after each input field

setDescriptionModel

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

getDescriptionModel

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


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