|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.opengl.gui.Component
com.threerings.opengl.gui.TextComponent
com.threerings.opengl.gui.Label
com.threerings.opengl.gui.ComboBox
public class ComboBox
Displays a selected value and allows that value to be changed by selecting from a popup menu.
| Nested Class Summary | |
|---|---|
static class |
ComboBox.Item
Used for displaying a label that is associated with a particular non-displayable value. |
| Nested classes/interfaces inherited from class com.threerings.opengl.gui.Label |
|---|
Label.Fit |
| Field Summary |
|---|
| Fields inherited from class com.threerings.opengl.gui.Component |
|---|
DEFAULT, DISABLED, HOVER |
| Fields inherited from interface com.threerings.opengl.gui.Selectable |
|---|
SELECT |
| Fields inherited from interface com.threerings.opengl.gui.UIConstants |
|---|
BOTTOM, CENTER, DEFAULT_SIZE, DEFAULT_SPACING, GLOW, HORIZONTAL, LEFT, NORMAL, OUTLINE, OVERLAPPING, PLAIN, RIGHT, SHADOW, TOP, VERTICAL |
| Constructor Summary | |
|---|---|
ComboBox(GlContext ctx)
Creates an empty combo box. |
|
ComboBox(GlContext ctx,
Iterable<?> items)
Creates a combo box with the supplied set of items. |
|
ComboBox(GlContext ctx,
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. |
void |
clearItems()
Removes all items from this combo box. |
boolean |
dispatchEvent(Event event)
Instructs this component to process the supplied event. |
Object |
getItem(int index)
Returns the item at the specified index. |
int |
getItemCount()
Returns the number of items in this combo box. |
Object |
getSelected()
Get the selected item, if any. |
int |
getSelectedIndex()
Get the index of the selected item, or -1. |
Object |
getSelectedItem()
Deprecated. |
Object |
getSelectedValue()
Requires that the combo box be configured with ComboBox.Item items, returns the ComboBox.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 ComboBox.Item. |
void |
selectItem(int index)
Deprecated. |
void |
selectItem(Object item)
Deprecated. |
void |
selectValue(Object value)
Requires that the combo box be configured with ComboBox.Item items, selects the item with a
ComboBox.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 |
setPreferredDimensions(int rows,
int columns)
Sets the preferred number of columns in the popup menu. |
void |
setSelected(Object item)
Set the selected item. |
void |
setSelectedIndex(int index)
Set the index of the selected item. |
| Methods inherited from class com.threerings.opengl.gui.Label |
|---|
getFit, getIcon, getIconTextGap, getLabelRenderer, getText, setFit, setIcon, setIconTextGap, setOrientation, setPreferredWidth, setText, setTextRotation |
| Methods inherited from class com.threerings.opengl.gui.TextComponent |
|---|
getEffectColor, getEffectSize, getHorizontalAlignment, getLineSpacing, getTextEffect, getTextFactory, getVerticalAlignment |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ComboBox(GlContext ctx)
public ComboBox(GlContext ctx,
Object[] items)
Object.toString()
for each item will be displayed in the list.
public ComboBox(GlContext ctx,
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 Object getSelected()
Selectable
getSelected in interface Selectable<Object>public void setSelected(Object item)
Selectable
setSelected in interface Selectable<Object>public int getSelectedIndex()
Selectable
getSelectedIndex in interface Selectable<Object>public void setSelectedIndex(int index)
Selectable
setSelectedIndex in interface Selectable<Object>@Deprecated public Object getSelectedItem()
public Object getSelectedValue()
ComboBox.Item items, returns the ComboBox.Item.value of the currently selected item.
@Deprecated public void selectItem(int index)
@Deprecated public void selectItem(Object item)
public void selectValue(Object value)
ComboBox.Item items, selects the item with a
ComboBox.Item.value equal to the supplied value.
public int getItemCount()
public Object getItem(int index)
public Object getValue(int index)
ComboBox.Item.
public void clearItems()
public void setPreferredDimensions(int rows,
int columns)
public boolean dispatchEvent(Event event)
Componentsuper.dispatchEvent for events that they did not "consume".
dispatchEvent in class Component
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||