|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.awt.Choice
public class Choice
Choice is a component that maintains a dropdown list
of items for selection.
Creation:
Choice choice1 = new Choice();
choice1.initialize();
| Field Summary | |
|---|---|
static java.lang.String |
RB_KEY
|
| Constructor Summary | |
|---|---|
Choice()
Default constructor |
|
| Method Summary | |
|---|---|
void |
add(java.lang.Object item)
Adds an item to the end of the list if the attached model supports addition of items. |
void |
add(java.lang.Object[] items)
Adds items to the end of the list if the attached model supports addition of items. |
void |
add(java.lang.String item)
Adds an item to the end of the list if the attached model supports addition of items. |
void |
addItems(java.util.Enumeration items)
Adds items to the end of the list if the attached model supports addition of items. |
void |
addNotify()
Notifies the component that it has been added to a container and that the peer should be created. |
void |
attachModel(com.sas.ModelInterface model)
Attaches a model to the component. |
java.lang.Object |
clone()
Clones the component |
java.awt.Dimension |
computePreferredSize()
Returns the preferred size of the component |
void |
contentsChanged(com.sas.collection.ContentsChangedEvent evt)
Called when the contents of the Model have changed. |
void |
detachModel(com.sas.ModelInterface model)
Detaches the current model and attaches the default model if the model is set to null |
static int |
getDefaultHeight()
Returns the default height for instances of this class |
static int |
getDefaultWidth()
Returns the default width for instances of this class |
com.sas.util.transforms.TransformInterface |
getDisplayTransform()
Returns the display transform. |
static com.sas.beans.ExtendedBeanInfo |
getExtendedBeanInfo()
Returns the ExtendedBeanInfo for this class. |
java.lang.String[] |
getInitialItems()
Returns the initial items (an empty string array is returned if there are no initial items) |
com.sas.util.transforms.TransformInterface |
getInputTransform()
Returns the InputTransform |
java.lang.String[] |
getItems()
Returns the items in the model (an empty string array is returned is there are no items) |
com.sas.util.transforms.TransformInterface |
getOutputTransform()
Returns the OutputTransform |
java.util.Vector |
getRequiredInterfaces()
Returns the required interfaces Vector for this component. |
java.lang.Object[] |
getSelectedObjects()
Returns the selected object This method is overriden in order to actually contain an object within the object array(AWT returns an object array containing a string item) |
java.lang.String |
getText()
Returns the selected item. |
void |
insert(java.lang.Object item,
int index)
Adds an item at the specified location if the attached model supports addition of items. |
void |
insert(java.lang.String item,
int index)
Adds an item at the specified location if the attached model supports addition of items. |
boolean |
isDefaultModelAttached()
Returns whether the default model is attached. |
boolean |
isResizeToFit()
Returns the value of the resizeToFit property The resizeToFit property determines whether to change the size of the component when either the text or font changes. |
protected void |
processItemEvent(java.awt.event.ItemEvent e)
Processes item events occurring on this component.Subclasses should always call super so that events are delivered to any ItemListeners. |
void |
refresh()
Clear current items and add items obtained from the attached model |
void |
refresh(com.sas.ModelInterface model)
Clear current items and add items obtained from the attached model |
void |
remove(int position)
Removes the item at the specified position if the attached model supports removal of items. |
void |
remove(java.lang.Object item)
Removes the first occurrence of item if the attached model supports removal of items. |
void |
remove(java.lang.String item)
Removes the first occurrence of item if the attached model supports removal of items. |
void |
removeAll()
Removes all items if the attached model supports removal of items. |
void |
select(int index)
Selects the item corresponding to the specified index |
void |
select(java.lang.String str)
Selects the item corresponding to the specified string. |
static void |
setDefaultHeight(int newDefaultHeight)
Sets the default height of the component. |
void |
setDefaultValues()
Sets the initial values to the default values. |
static void |
setDefaultWidth(int newDefaultWidth)
Sets the default width of the component. |
void |
setDisplayTransform(com.sas.util.transforms.TransformInterface transform)
Sets the display transform. |
void |
setFont(java.awt.Font font)
Sets the font to be used by the component for displaying text. |
void |
setInitialItems(java.lang.String[] items)
Sets the initialItems on the Choice. |
void |
setInputTransform(com.sas.util.transforms.TransformInterface transform)
Sets the input Transform. |
void |
setItems(java.lang.Object[] items)
Sets the items if the attached model supports addition of items |
void |
setItems(java.lang.String[] items)
Sets the items |
void |
setOutputTransform(com.sas.util.transforms.TransformInterface transform)
Sets the output Transform. |
void |
setResizeToFit(boolean resizeToFit)
Sets the value of the resizeToFit property. |
void |
setSelectedIndex(int index)
Selects the item corresponding to the specified index |
void |
setSelectedItem(java.lang.Object text)
Sets the selected item to the specified object. |
void |
setSelectedItem(java.lang.String text)
Sets the selected item to the specified string. |
void |
setText(java.lang.String text)
Sets the selected item. |
| Field Detail |
|---|
public static final java.lang.String RB_KEY
| Constructor Detail |
|---|
public Choice()
| Method Detail |
|---|
public static int getDefaultWidth()
setDefaultWidth(int)public static void setDefaultWidth(int newDefaultWidth)
newDefaultWidth - the new default width in pixelsgetDefaultWidth()public static int getDefaultHeight()
setDefaultHeight(int)public static void setDefaultHeight(int newDefaultHeight)
newDefaultHeight - the new default height in pixelsgetDefaultHeight()public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
public void add(java.lang.String item)
add in class java.awt.Choiceitem - item to be addedpublic void add(java.lang.Object[] items)
items - items to be addedpublic void addItems(java.util.Enumeration items)
items - items to be addedpublic void add(java.lang.Object item)
item - item to be addedpublic void addNotify()
addNotify in class java.awt.Choicepublic void attachModel(com.sas.ModelInterface model)
attachModel in interface com.sas.ViewInterfaceattachModel in class ChoiceVisualComponentmodel - model to attachViewInterface.attachModel(com.sas.ModelInterface)
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface com.sas.PublicClonableclone in class ChoiceVisualComponentjava.lang.CloneNotSupportedException - if the model attached to the component being cloned
will not allow the clone to attach.public java.awt.Dimension computePreferredSize()
computePreferredSize in interface VisualInterfacecomputePreferredSize in class ChoiceVisualComponentVisualInterface.computePreferredSize()public void contentsChanged(com.sas.collection.ContentsChangedEvent evt)
contentsChanged in interface com.sas.collection.ContentsChangedListenerevt - ContentsChangedEvent from the Modelpublic void detachModel(com.sas.ModelInterface model)
detachModel in interface com.sas.ViewInterfacedetachModel in class ChoiceVisualComponentmodel - Model to detachViewInterface.detachModel(com.sas.ModelInterface)public com.sas.util.transforms.TransformInterface getDisplayTransform()
setDisplayTransform(com.sas.util.transforms.TransformInterface)public java.lang.String[] getInitialItems()
setInitialItems(java.lang.String[])public com.sas.util.transforms.TransformInterface getInputTransform()
setInputTransform(com.sas.util.transforms.TransformInterface)public java.lang.String[] getItems()
public com.sas.util.transforms.TransformInterface getOutputTransform()
setOutputTransform(com.sas.util.transforms.TransformInterface)public java.util.Vector getRequiredInterfaces()
getRequiredInterfaces in interface com.sas.ViewInterfacegetRequiredInterfaces in class ChoiceVisualComponentViewInterface.getRequiredInterfaces()public java.lang.Object[] getSelectedObjects()
getSelectedObjects in interface java.awt.ItemSelectablegetSelectedObjects in class java.awt.Choicepublic java.lang.String getText()
getText in interface com.sas.lang.StringDataInterfacesetText(java.lang.String)
public void insert(java.lang.Object item,
int index)
item - item to be addedindex - location for adding the item
public void insert(java.lang.String item,
int index)
insert in class java.awt.Choiceitem - item to be addedindex - location for adding the itempublic boolean isDefaultModelAttached()
isDefaultModelAttached in interface com.sas.ViewDefaultModelInterfacepublic boolean isResizeToFit()
isResizeToFit in interface ResizeToFitInterfacesetResizeToFit(boolean)protected void processItemEvent(java.awt.event.ItemEvent e)
processItemEvent in class java.awt.Choicee - event to be handledpublic void refresh()
public void refresh(com.sas.ModelInterface model)
refresh in interface com.sas.ViewInterfacerefresh in class ChoiceVisualComponentmodel - attached modelViewInterface.refresh(com.sas.ModelInterface)public void remove(int position)
remove in class java.awt.Choiceposition - the index of the item to removepublic void remove(java.lang.Object item)
item - item to be removed
java.lang.IllegalArgumentException - if item is not found in
the componentpublic void remove(java.lang.String item)
remove in class java.awt.Choiceitem - item to be removed
java.lang.IllegalArgumentException - if item is not found in
the componentpublic void removeAll()
removeAll in class java.awt.Choicepublic void select(int index)
select in class java.awt.Choiceindex - the selected item positionpublic void select(java.lang.String str)
select in class java.awt.Choicestr - the specified stringpublic void setDefaultValues()
setDefaultValues in interface VisualInterfacesetDefaultValues in interface com.sas.ComponentInterfacesetDefaultValues in class ChoiceVisualComponentComponentInterface.setDefaultValues()public void setDisplayTransform(com.sas.util.transforms.TransformInterface transform)
transform - the new value for the displayTransform propertygetDisplayTransform()public void setFont(java.awt.Font font)
setFont in interface VisualInterfacesetFont in class ChoiceVisualComponentfont - the font to be used by the component for displaying text.Component.setFont(java.awt.Font),
ChoiceVisualComponent.getFont()public void setInitialItems(java.lang.String[] items)
items - items to add to the defaultModelgetInitialItems()public void setInputTransform(com.sas.util.transforms.TransformInterface transform)
the - new value for the inputTransform propertygetInputTransform()public void setItems(java.lang.Object[] items)
items - an array of elementspublic void setItems(java.lang.String[] items)
items - an array of elementspublic void setOutputTransform(com.sas.util.transforms.TransformInterface transform)
transform - the new value for the outputTransform propertygetOutputTransform()public void setResizeToFit(boolean resizeToFit)
setResizeToFit in interface ResizeToFitInterfaceresizeToFit - boolean valueisResizeToFit()public void setSelectedIndex(int index)
index - the selected item positionpublic void setSelectedItem(java.lang.Object text)
text - the string to selectpublic void setSelectedItem(java.lang.String text)
text - the string to selectpublic void setText(java.lang.String text)
setText in interface com.sas.lang.StringDataInterfacetext - selected itemgetText()
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||