|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jmex.bui.BComponent
com.jmex.bui.BTextComponent
com.jmex.bui.BLabel
com.jmex.bui.BComboBox
public class BComboBox
Displays a selected value and allows that value to be changed by selecting from a popup menu.
| Nested Class Summary | |
|---|---|
protected class |
BComboBox.ComboMenuItem
|
protected class |
BComboBox.ComboPopupMenu
|
static class |
BComboBox.Item
Used for displaying a label that is associated with a particular non-displayable value. |
| Nested classes/interfaces inherited from class com.jmex.bui.BLabel |
|---|
BLabel.Fit |
| Field Summary | |
|---|---|
protected int |
_columns
Our preferred number of columns for the popup menu. |
protected ArrayList<BComboBox.ComboMenuItem> |
_items
The list of items in this combo box. |
protected BComboBox.ComboPopupMenu |
_menu
A cached popup menu containing our items. |
protected Dimension |
_psize
Our cached preferred size. |
protected int |
_selidx
The index of the currently selected item. |
| Fields inherited from class com.jmex.bui.BLabel |
|---|
_label |
| Fields inherited from class com.jmex.bui.BTextComponent |
|---|
_effcols, _effsizes, _haligns, _lineSpacings, _teffects, _textfacts, _valigns |
| Fields inherited from class com.jmex.bui.BComponent |
|---|
_alpha, _backgrounds, _bbuf, _borders, _colors, _cursor, _enabled, _height, _hover, _insets, _listeners, _parent, _preferredSize, _properties, _styleClass, _tipmouse, _tipStyle, _tiptext, _valid, _visible, _width, _x, _y, DEFAULT, DISABLED, HOVER, STATE_COUNT, STATE_PCLASSES |
| Fields inherited from interface com.jmex.bui.BConstants |
|---|
BOTTOM, CENTER, DEFAULT_SIZE, DEFAULT_SPACING, GLOW, HORIZONTAL, LEFT, NORMAL, OUTLINE, OVERLAPPING, PLAIN, RIGHT, SHADOW, TOP, VERTICAL |
| Constructor Summary | |
|---|---|
BComboBox()
Creates an empty combo box. |
|
BComboBox(Iterable<?> items)
Creates a combo box with the supplied set of items. |
|
BComboBox(Object[] items)
Creates a combo box with the supplied set of items. |
|
| Method Summary | |
|---|---|
void |
addItem(int index,
Object item)
Inserts an item into our list of items at the specified position (zero being before all other items and so forth). |
void |
addItem(Object item)
Appends an item to our list of items. |
protected void |
clearCache()
|
void |
clearItems()
Removes all items from this combo box. |
protected Dimension |
computePreferredSize(int whint,
int hhint)
Computes and returns a preferred size for this component. |
boolean |
dispatchEvent(BEvent event)
Instructs this component to process the supplied event. |
protected String |
getDefaultStyleClass()
Returns the default stylesheet class to be used for all instances of this component. |
Object |
getItem(int index)
Returns the item at the specified index. |
int |
getItemCount()
Returns the number of items in this combo box. |
int |
getSelectedIndex()
Returns the index of the selected item or -1 if no item is selected. |
Object |
getSelectedItem()
Returns the selected item or null if no item is selected. |
Object |
getSelectedValue()
Requires that the combo box be configured with BComboBox.Item items, returns the BComboBox.Item.value of the currently selected item. |
Object |
getValue(int index)
Returns the value at the specified index, the item must be an instance of BComboBox.Item. |
void |
selectItem(int index)
Selects the item with the specified index. |
protected void |
selectItem(int index,
long when,
int modifiers)
|
void |
selectItem(Object item)
Selects the item with the specified index. |
void |
selectValue(Object value)
Requires that the combo box be configured with BComboBox.Item items, selects the item with a
BComboBox.Item.value equal to the supplied value. |
void |
setItems(Iterable<?> items)
Replaces any existing items in this combo box with the supplied items. |
void |
setItems(Object[] items)
Replaces any existing items in this combo box with the supplied items. |
void |
setPreferredColumns(int columns)
Sets the preferred number of columns in the popup menu. |
| Methods inherited from class com.jmex.bui.BLabel |
|---|
getFit, getIcon, getIconTextGap, getText, layout, renderComponent, setFit, setIcon, setIconTextGap, setOrientation, setText, wasAdded, wasRemoved |
| Methods inherited from class com.jmex.bui.BTextComponent |
|---|
checkNonDefault, checkNonDefaultInt, checkNonDefaultVal, configureStyle, getEffectColor, getEffectSize, getHorizontalAlignment, getLabelConfig, getLineSpacing, getTextEffect, getTextFactory, getTextFactory, getVerticalAlignment |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int _selidx
protected ArrayList<BComboBox.ComboMenuItem> _items
protected BComboBox.ComboPopupMenu _menu
protected Dimension _psize
protected int _columns
| Constructor Detail |
|---|
public BComboBox()
public BComboBox(Object[] items)
Object.toString()
for each item will be displayed in the list.
public BComboBox(Iterable<?> items)
Object.toString()
for each item will be displayed in the list.
| Method Detail |
|---|
public void addItem(Object item)
Object.toString() for the item
will be displayed in the list.
public void addItem(int index,
Object item)
Object.toString() for the item will be
displayed in the list.
public void setItems(Iterable<?> items)
public void setItems(Object[] items)
public int getSelectedIndex()
public Object getSelectedItem()
public Object getSelectedValue()
BComboBox.Item items, returns the BComboBox.Item.value of the currently selected item.
public void selectItem(int index)
public void selectItem(Object item)
Object.equals(java.lang.Object).
public void selectValue(Object value)
BComboBox.Item items, selects the item with a
BComboBox.Item.value equal to the supplied value.
public int getItemCount()
public Object getItem(int index)
public Object getValue(int index)
BComboBox.Item.
public void clearItems()
public void setPreferredColumns(int columns)
public boolean dispatchEvent(BEvent event)
BComponentsuper.dispatchEvent for events that they did not "consume".
dispatchEvent in class BComponentprotected String getDefaultStyleClass()
BComponent
getDefaultStyleClass in class BLabel
protected Dimension computePreferredSize(int whint,
int hhint)
BComponent
computePreferredSize in class BLabel
protected void selectItem(int index,
long when,
int modifiers)
protected void clearCache()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||