public class Roller extends Widget
Modifier and Type | Field and Description |
---|---|
static int |
MODE_INFINITE
Infinite mode
|
static int |
MODE_NORMAL
Normal mode
|
SCROLL_DIR_ALL, SCROLL_DIR_BOTTOM, SCROLL_DIR_HORIZONTAL, SCROLL_DIR_LEFT, SCROLL_DIR_NONE, SCROLL_DIR_RIGHT, SCROLL_DIR_TOP, SCROLL_DIR_VERTICAL, SCROLLBAR_MODE_ACTIVE, SCROLLBAR_MODE_AUTO, SCROLLBAR_MODE_OFF, SCROLLBAR_MODE_ON, STATE_CHECKED, STATE_DEFAULT, STATE_DISABLED, STATE_SCROLLED
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_TOP, objImpl, SIDE_BOTTOM, SIDE_FULL, SIDE_LEFT, SIDE_RIGHT, SIDE_TOP, SIZE_CONTENT, TEXT_DECOR_NONE, TEXT_DECOR_STRIKETHROUGH, TEXT_DECOR_UNDERLINE
Constructor and Description |
---|
Roller()
Constructs a Roller
|
Roller(int mode)
Constructs a Roller with given mode
|
Modifier and Type | Method and Description |
---|---|
void |
addOption(String option)
Adds an option to the end of the roller
|
String[] |
getOptions()
Returns an array contains all options of the roller
|
int |
getSelected()
Gets the index of the selected option
|
void |
insertOption(int index,
String option)
Inserts an option to the roller at the specified index.
|
int |
optionSize()
Returns the number of options of the roller
|
void |
removeOption(String option)
Removes an option from the roller
|
void |
setSelected(int index)
Selects an option of the roller
|
getContainer
getObjectOfState, getScrollbar, getScrollbarMode, getScrollbarOfState, getScrollBottom, getScrollDirection, getScrollLeft, getScrollRight, getScrollTop, getScrollX, getScrollY, isChecked, isClickable, isDisabled, isFloating, isHidden, isIgnoreLayout, isScrollable, isScrolled, resetAllListeners, scrollToView, scrollToView, scrollToX, scrollToX, scrollToY, scrollToY, setCancelListener, setChecked, setClickable, setClickedListener, setDisabled, setFloating, setHidden, setIgnoreLayout, setReadyListener, setScrollable, setScrollbarMode, setScrollDirection, setScrollListener, setValueChangedListener
enableClipCorner, forceNewTrack, getBackgroundColor, getBorderColor, getBorderWidth, getColumnPadding, getCoordinates, getFlexGrow, getHeight, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getName, getPadding, getParent, getPropertyBooleanValue, getPropertyIntValue, getRadius, getRowPadding, getShadowColor, getShadowOffsetX, getShadowOffsetY, getShadowWidth, getTextColor, getTextLetterSpace, getTextLineSpace, getTranslateX, getTranslateY, getUserData, getWidth, getX, getY, isClipCornerEnabled, setAlign, setBackgroundColor, setBorderColor, setBorderWidth, setColumnPadding, setFlexGrow, setHeight, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setName, setPadding, setPadding, setParent, setPos, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setRadius, setRecolor, setRowPadding, setShadowColor, setShadowOffsetX, setShadowOffsetY, setShadowWidth, setSize, setTextAlign, setTextColor, setTextDecor, setTextFont, setTextLetterSpace, setTextLineSpace, setTranslateX, setTranslateY, setUserData, setWidth, setX, setY
public static final int MODE_NORMAL
Roller ends at the end of the options
public static final int MODE_INFINITE
Roller can be scrolled forever
public Roller()
public Roller(int mode)
mode
- MODE_NORMAL
or MODE_INFINITE
public void addOption(String option)
option
- a stringpublic void removeOption(String option)
option
- a stringpublic void insertOption(int index, String option)
Each option in the roller with an index greater or equal to the specified
index
is shifted upward to have an index one greater than
the value it had previously.
The index must be a value greater than or equal to 0
and
less than or equal to the current number of options of the roller.
index
- where to insert the new optionoption
- a stringpublic int optionSize()
public String[] getOptions()
public void setSelected(int index)
index
- the index of the optionpublic int getSelected()