|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.visuals.ComboBox
public class ComboBox
ComboBox displays a list of items for selection and contains an optionally
editable text control that allows the user to enter text that is not in the list
portion of the comboBox.
Creation:
ComboBox comboBox1 = new ComboBox();
comboBox1.initialize();
Field Summary | |
---|---|
static int |
DROPDOWN
|
static int |
DROPDOWNLIST
|
com.sas.collection.OrderedListCollection |
excludedKeys
|
protected com.sas.visuals.ComboBoxFocusHandler |
focusHandler
|
java.awt.event.ItemListener |
itemListener
|
java.awt.event.KeyListener |
keyListener
|
int |
oldSelectedIndex
|
static java.lang.String |
RB_KEY
|
static int |
SIMPLE
|
boolean |
textOverride
|
Constructor Summary | |
---|---|
ComboBox()
Default constructor |
Method Summary | |
---|---|
void |
add(com.sas.Component comp)
Adds the specified component to this container. |
void |
add(com.sas.Component comp,
int index)
Adds the specified component to this container at the specified index. |
void |
add(com.sas.Component comp,
java.lang.Object constraints)
Adds the specified component to this container with the specified constraints. |
void |
add(com.sas.Component comp,
java.lang.Object constraints,
int index)
Adds the specified component to this container with the specified constraints at the specified index. |
void |
add(java.util.Enumeration items)
Adds items 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 name,
com.sas.Component comp)
Adds the specified component to this container. |
void |
addImpl(com.sas.Component comp,
java.lang.Object constraints,
int index)
Adds the specified component to this container with the specified constraints at the specified index. |
void |
addItem(java.lang.Object item)
Adds an item to the end of the list if the attached model supports addition of items. |
void |
addItem(java.lang.Object item,
int index)
Adds an item at the specified location if the attached model supports addition of items. |
void |
addItemListener(java.awt.event.ItemListener l)
Add a listener to receive item events when the state of an item changes. |
void |
addKeyListener(java.awt.event.KeyListener l)
Add a listener to receive key events |
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. |
protected int |
calculateWindowHeight()
Calculates the height of the window in which to display the dropdown items |
java.awt.Dimension |
computePreferredSize()
Returns the preferred size of the ComboBox |
void |
contentsChanged(com.sas.collection.ContentsChangedEvent evt)
Called when the contents of the Model have changed. |
protected void |
createItemEvent(int changed,
java.lang.String selItem,
int selected)
Processes item events by dispatching them to any registered ItemListener objects. |
protected void |
createKeyEvent(int id,
long when,
int modifiers,
int keyCode,
char keyChar)
Processes key events by dispatching them to any registered KeyListener objects. |
void |
detachModel(com.sas.ModelInterface model)
Detaches the current model and attaches the default model if the model is set to null |
void |
displayList()
Displays the list portion of the comboBox |
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 input transform. |
java.awt.Dimension |
getMinimumSize()
Returns the minimum size of the comboBox |
com.sas.util.transforms.TransformInterface |
getOutputTransform()
Returns the output transform. |
java.util.Vector |
getRequiredInterfaces()
Returns the required interfaces Vector for this component. |
int |
getSelectedIndex()
Returns the selected index |
java.lang.String |
getSelectedItem()
Returns the selectedItem |
java.lang.Object[] |
getSelectedObjects()
Returns the selected object. |
int |
getStyle()
Returns the style of the comboBox |
java.lang.String |
getText()
Returns the text |
void |
hideList()
Hide the list portion of the comboBox |
void |
initialize()
Draw comboBox according to style chosen |
boolean |
isAddTextToList()
Returns the value of the addTextToList property. |
boolean |
isAutoHighlight()
Returns the value of the autoHighlight property |
boolean |
isDefaultModelAttached()
Returns whether the default model is attached. |
boolean |
isMatchedEntry()
Returns the value of the matchedEntry property. |
boolean |
isResizeToFit()
Returns the value of the resizeToFit property. |
protected com.sas.visuals.ComboButton |
newComboButton()
|
void |
refresh()
Clears 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(com.sas.Component comp)
Removes the specified component from this container. |
void |
remove(int index)
Removes the component at the specified index from this container. |
void |
removeAll()
Removes all the components from this container. |
void |
removeAllItems()
Removes all items |
void |
removeItem(int index)
Removes the item at the specified position if the attached model supports removal of items. |
void |
removeItem(java.lang.Object item)
Removes the first occurrence of item if the attached model supports removal of items. |
void |
removeItem(java.lang.String item)
Removes the first occurrence of item if the attached model supports removal of items. |
void |
removeItemListener(java.awt.event.ItemListener l)
Removes an item listener. |
void |
removeKeyListener(java.awt.event.KeyListener l)
Removes a key listener. |
void |
replaceItem(java.lang.Object newvalue,
int index)
Replaces an item if the attached model supports replacement of items. |
void |
requestFocus()
Overridden in order to select the text in the textField if the autoHighlight property is true and the style is not DROPDOWNLIST |
void |
selectedItem(java.lang.Object text)
Set the selected item to the specified object. |
void |
setAddTextToList(boolean state)
Sets the specified boolean to indicate whether text entries should be added to the list. |
void |
setAutoHighlight(boolean value)
Sets the specified boolean to indicate whether or not all text in the component will be selected when the component receives focus. |
void |
setBackgroundColor(java.awt.Color color)
Sets the background color |
void |
setBounds(int x,
int y,
int width,
int height)
Reshapes the Component to the specified bounding box. |
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 |
setEnabled(boolean value)
Sets the enabled property |
void |
setFont(java.awt.Font font)
Sets the font |
void |
setForeground(java.awt.Color color)
Sets the foreground color |
void |
setForegroundColor(java.awt.Color color)
Sets the foreground color |
void |
setInitialItems(java.lang.String[] items)
Sets the initial items |
void |
setInputTransform(com.sas.util.transforms.TransformInterface transform)
Sets the input Transform. |
void |
setMatchedEntry(boolean state)
Sets the value of the matchedEntry property. |
void |
setOutputTransform(com.sas.util.transforms.TransformInterface transform)
Sets the output Transform. |
void |
setResizeToFit(boolean value)
Sets 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. |
void |
setSelectedIndex(int index)
Sets the selected index |
void |
setSelectedItem(java.lang.String text)
Sets the selected item |
void |
setStyle(int cstyle)
Sets the style of the comboBox |
void |
setText(java.lang.String text)
Sets the text to the specified text |
Methods inherited from class com.sas.awt.Panel |
---|
remove |
Methods inherited from interface com.sas.awt.ContainerInterface |
---|
getComponents, getLayout, invalidate, setLayout, validate |
Field Detail |
---|
public boolean textOverride
public transient int oldSelectedIndex
public transient java.awt.event.ItemListener itemListener
public transient java.awt.event.KeyListener keyListener
public transient com.sas.collection.OrderedListCollection excludedKeys
protected com.sas.visuals.ComboBoxFocusHandler focusHandler
public static final java.lang.String RB_KEY
public static final int DROPDOWN
public static final int SIMPLE
public static final int DROPDOWNLIST
Constructor Detail |
---|
public ComboBox()
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(com.sas.Component comp)
comp
- component to be addedpublic void add(java.lang.String name, com.sas.Component comp)
name
- component namecomp
- component to be addedpublic void add(com.sas.Component comp, int index)
comp
- component to be addedindex
- the position in the container's list at which to insert the component.
-1 means insert at the end.public void add(com.sas.Component comp, java.lang.Object constraints)
comp
- component to be addedconstraints
- layout contraints for this componentpublic void add(com.sas.Component comp, java.lang.Object constraints, int index)
comp
- component to be addedconstraints
- layout contraints for this componentindex
- the position in the container's list at which to insert the component.
-1 means insert at the end.public void addImpl(com.sas.Component comp, java.lang.Object constraints, int index)
comp
- component to be addedconstraints
- layout contraints for this componentindex
- the position in the container's list at which to insert the component.
-1 means insert at the end.public void addItem(java.lang.Object item)
item
- item to be addedpublic void addItem(java.lang.Object item, int index)
item
- item to be addedindex
- location for adding the itempublic void add(java.lang.Object[] items)
items
- items to be addedpublic void add(java.util.Enumeration items)
items
- items to be addedpublic void addItemListener(java.awt.event.ItemListener l)
addItemListener
in interface java.awt.ItemSelectable
l
- the listener to receive events.public void addKeyListener(java.awt.event.KeyListener l)
addKeyListener
in class java.awt.Component
l
- the listener to receive events.public void addNotify()
addNotify
in interface ContainerInterface
addNotify
in class PanelContainerComponent
public void attachModel(com.sas.ModelInterface model)
attachModel
in interface com.sas.ViewInterface
attachModel
in class PanelVisualComponent
model
- model to attachViewInterface.attachModel(com.sas.ModelInterface)
protected int calculateWindowHeight()
public java.awt.Dimension computePreferredSize()
computePreferredSize
in interface VisualInterface
computePreferredSize
in class PanelVisualComponent
VisualInterface.computePreferredSize()
public void contentsChanged(com.sas.collection.ContentsChangedEvent evt)
contentsChanged
in interface com.sas.collection.ContentsChangedListener
evt
- ContentsChangedEvent from the Modelprotected void createItemEvent(int changed, java.lang.String selItem, int selected)
e
- the item eventprotected void createKeyEvent(int id, long when, int modifiers, int keyCode, char keyChar)
e
- the key eventpublic void detachModel(com.sas.ModelInterface model)
detachModel
in interface com.sas.ViewInterface
detachModel
in class PanelVisualComponent
model
- Model to detachViewInterface.detachModel(com.sas.ModelInterface)
public void displayList()
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.awt.Dimension getMinimumSize()
getMinimumSize
in interface VisualInterface
getMinimumSize
in class PanelVisualComponent
VisualInterface.getMinimumSize()
public com.sas.util.transforms.TransformInterface getOutputTransform()
setOutputTransform(com.sas.util.transforms.TransformInterface)
public java.util.Vector getRequiredInterfaces()
getRequiredInterfaces
in interface com.sas.ViewInterface
getRequiredInterfaces
in class PanelVisualComponent
ViewInterface.getRequiredInterfaces()
public int getSelectedIndex()
setSelectedIndex(int)
public java.lang.String getSelectedItem()
setSelectedItem(java.lang.String)
public java.lang.Object[] getSelectedObjects()
getSelectedObjects
in interface java.awt.ItemSelectable
public int getStyle()
setStyle(int)
public java.lang.String getText()
getText
in interface com.sas.lang.StringDataInterface
setText(java.lang.String)
public void hideList()
public void initialize()
initialize
in interface com.sas.ComponentInterface
initialize
in class PanelVisualComponent
ComponentInterface.initialize()
public boolean isAddTextToList()
setAddTextToList(boolean)
public boolean isAutoHighlight()
setAutoHighlight(boolean)
public boolean isDefaultModelAttached()
isDefaultModelAttached
in interface com.sas.ViewDefaultModelInterface
public boolean isMatchedEntry()
setMatchedEntry(boolean)
public boolean isResizeToFit()
isResizeToFit
in interface ResizeToFitInterface
setResizeToFit(boolean)
protected com.sas.visuals.ComboButton newComboButton()
public void refresh()
public void refresh(com.sas.ModelInterface model)
refresh
in interface com.sas.ViewInterface
refresh
in class PanelVisualComponent
model
- attached modelViewInterface.refresh(com.sas.ModelInterface)
public void remove(com.sas.Component comp)
comp
- component to be removedpublic void remove(int index)
index
- index of the component to be removedpublic void removeAll()
public void removeAllItems()
public void removeItem(java.lang.String item)
item
- item to be removedpublic void removeItem(java.lang.Object item) throws com.sas.util.transforms.TransformException
item
- item to be removed
com.sas.util.transforms.TransformException
- if there is an error in transformin the item.public void removeItem(int index)
index
- index of the item to be removedpublic void removeItemListener(java.awt.event.ItemListener l)
removeItemListener
in interface java.awt.ItemSelectable
l
- the item listener to removepublic void removeKeyListener(java.awt.event.KeyListener l)
removeKeyListener
in class java.awt.Component
l
- the key listener to removepublic void requestFocus()
requestFocus
in class java.awt.Component
public void replaceItem(java.lang.Object newvalue, int index) throws com.sas.util.transforms.TransformException
newvalue
- replacement textindex
- index of the item to be replaced
com.sas.util.transforms.TransformException
public void setAddTextToList(boolean state)
state
- boolean valuepublic void setAutoHighlight(boolean value)
value
- boolean valuepublic void setBackgroundColor(java.awt.Color color)
setBackgroundColor
in interface VisualInterface
setBackgroundColor
in class PanelVisualComponent
color
- colorVisualInterface.setBackgroundColor(java.awt.Color)
public void setBounds(int x, int y, int width, int height)
setBounds
in interface VisualInterface
setBounds
in class PanelVisualComponent
x
- x coordinatey
- y coordinatewidth
- width of the componentheight
- height of the componentVisualInterface.setBounds(int, int, int, int)
public void setDisplayTransform(com.sas.util.transforms.TransformInterface transform)
transform
- the new value for the displayTransform propertygetDisplayTransform()
public void setEnabled(boolean value)
setEnabled
in interface VisualInterface
setEnabled
in class PanelVisualComponent
value
- boolean indicating whether to enable/disable componentVisualInterface.setEnabled(boolean)
public void setFont(java.awt.Font font)
setFont
in interface VisualInterface
setFont
in class PanelVisualComponent
font
- fontComponent.setFont(java.awt.Font)
public void setForegroundColor(java.awt.Color color)
setForegroundColor
in interface VisualInterface
setForegroundColor
in class PanelVisualComponent
color
- colorComponent.setForeground(java.awt.Color)
public void setForeground(java.awt.Color color)
setForeground
in class java.awt.Component
color
- colorComponent.setForeground(java.awt.Color)
public void setInputTransform(com.sas.util.transforms.TransformInterface transform)
the
- new value for the inputTransform propertygetInputTransform()
public void setOutputTransform(com.sas.util.transforms.TransformInterface transform)
transform
- the new value for the outputTransform propertygetOutputTransform()
public void setDefaultValues()
setDefaultValues
in interface ContainerInterface
setDefaultValues
in interface VisualInterface
setDefaultValues
in interface com.sas.ComponentInterface
setDefaultValues
in class CompositePanel
public void setInitialItems(java.lang.String[] items)
items
- an array of elementspublic void setMatchedEntry(boolean state)
state
- boolean valueisMatchedEntry()
public void setResizeToFit(boolean value)
setResizeToFit
in interface ResizeToFitInterface
value
- boolean valueisResizeToFit()
public void setSelectedIndex(int index)
index
- index of the item to be selectedgetSelectedIndex()
public void selectedItem(java.lang.Object text) throws com.sas.util.transforms.TransformException
text
- item to be selected
com.sas.util.transforms.TransformException
- if there is an error in transformin the item.public void setSelectedItem(java.lang.String text)
text
- item to be selectedgetSelectedItem()
public void setStyle(int cstyle)
cstyle
- comboBox stylegetStyle()
public void setText(java.lang.String text)
setText
in interface com.sas.lang.StringDataInterface
text
- textgetText()
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |