|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
Object
Component
Label
Choice
public class Choice
Choice component gives a user a predefined set of choices
to choose from. Individual choices are given as Label components.
During the selection the choices are placed on Flow component
so normal Component layout rules (width, height and flags) apply.
Use the Component.size() and Component.get(int) to
access the choices after Choice is constructed.
Whenever user changes the selected choice
an ITEM_CHANGED action is performed with
this Choice being the source component.
Choice has following special style customizations:
color: Color of text
font: Font of text
image: Optional icon
label-spacing: Gap between icon and text, in pixels
label-icon-orientation: Position of icon, either
left or right
VISIBLE,
FOCUSABLE,
LINEFEED,
WRAP,
ITEM_CHANGED,
Script.actionPerformed(Shell, Component, int)| Constructor Summary | |
|---|---|
Choice(Style style,
Style popupStyle)
Constructs a new Choice component. |
|
| Method Summary | |
|---|---|
int |
getSelected()
Returns the index of currently selected choice. |
void |
setChoices(List choices,
int selected)
Sets the list of choices. |
void |
setSelected(int selected)
Sets the currently selected choices. |
| Methods inherited from class Component |
|---|
add, appendText, clear, find, first, get, getAction, getData, getElement, getFlags, getImage, getLocation, getParent, getShell, getSize, getStyle, getText, getViewPort, hasLinefeed, indexOf, insert, isFocusable, isShown, isVisible, isWrapping, last, operator_get, operator_set, remove, remove, repaint, set, setAction, setData, setElement, setFlags, setImage, setLocation, setPreferredHeight, setPreferredSize, setPreferredWidth, setStyle, setText, size |
| Methods inherited from class Object |
|---|
toString, equals, hashCode |
| Methods inherited from |
|---|
equals, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Choice(Style style,
Style popupStyle)
setChoices(List, int)
to set up the collection of choices.
style - Style to use, the image-1, if any,
from style will automatically become the
image for this Choice.popupStyle - Style for selection popup window| Method Detail |
|---|
public int getSelected()
public void setSelected(int selected)
selected - Index of selected choice
public void setChoices(List choices,
int selected)
choices - List of Label componentsselected - Index of selected choice
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||