|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.swing.visuals.ComboBox
public class ComboBox
This class subclasses JComboBox to provide general extensions and corrections to behavior that are useful to applications at SAS.
Some keystrokes are currently missing from JComboBox, and so this class processes them appropriately. Specifically, spacebar opens/closes the popup list. Down arrow opens the popup list if necessary. Alt + down arrow opens the popup list while Alt + up arrow closes the popup list.
This class also includes an overloaded addItem method that takes a tool tip parameter, and will display tool tips for the items in the drop-down list.
Separators are also supported as items that can be added to the combo box.
If an item is added to the combo box and it's an instance of java.awt.Window, selecting the item from the combo box will cause the window item to be launched on screen, appearing adjacent to the combo box.
This class was originally pulled from Information Map Studio (MapCenter) and was originally written by Greg Thorne. It has been relocated here and expanded for use across other applications.
Field Summary | |
---|---|
protected java.util.HashMap |
displayNameMap
|
protected java.lang.Object |
previousSelection
|
static java.lang.String |
SEPARATOR
|
protected java.util.HashMap |
toolTipMap
|
Constructor Summary | |
---|---|
ComboBox()
|
|
ComboBox(javax.swing.ComboBoxModel aModel)
|
|
ComboBox(java.lang.Object[] items)
|
|
ComboBox(java.util.Vector items)
|
Method Summary | |
---|---|
void |
addItem(java.lang.Object item,
java.lang.String toolTip)
Adds an item to the item list. |
protected void |
alignAndShowWindow(java.awt.Window window)
|
protected void |
init()
|
protected void |
processComponentKeyEvent(java.awt.event.KeyEvent event)
Overrides the processing of key events to provide additional functionality. |
Field Detail |
---|
protected java.util.HashMap displayNameMap
protected java.util.HashMap toolTipMap
public static java.lang.String SEPARATOR
protected java.lang.Object previousSelection
Constructor Detail |
---|
public ComboBox()
public ComboBox(java.lang.Object[] items)
public ComboBox(java.util.Vector items)
public ComboBox(javax.swing.ComboBoxModel aModel)
Method Detail |
---|
protected void init()
protected void alignAndShowWindow(java.awt.Window window)
protected void processComponentKeyEvent(java.awt.event.KeyEvent event)
processComponentKeyEvent
in class javax.swing.JComponent
public void addItem(java.lang.Object item, java.lang.String toolTip)
You can specify ComboBox.SEPARATOR as the item to have a horizontal line separator appear in the list.
item
- The item to add to the combobox.toolTip
- The item's tooltip which will appear when the user hovers over the item in the list.
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |