public class Picker extends Button
STATE_DEFAULT, STATE_PRESSED, STATE_ROLLOVER
BASELINE, BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_POSSIBLE_DRAG_Y, LEFT, RIGHT, TOP
Constructor and Description |
---|
Picker()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
Date |
getDate()
Returns the date, this value is used both for type date/date and time.
|
Object |
getRenderingPrototype()
When using a lightweight spinner this will be used as the rendering prototype
|
String |
getSelectedString()
Returns the current string
|
String[] |
getStrings()
Returns the String array matching the metadata
|
int |
getTime()
This value is only used for time type and is ignored in the case of date and time where
both are embedded within the date.
|
int |
getType()
Returns the type of the picker
|
boolean |
isShowMeridiem()
Indicates whether hours should be rendered as AM/PM or 24hr format
|
void |
setDate(Date d)
Sets the date, this value is used both for type date/date and time.
|
void |
setRenderingPrototype(Object renderingPrototype)
When using a lightweight spinner this will be used as the rendering prototype
|
void |
setSelectedString(String str)
Sets the current value in a string array picker
|
void |
setShowMeridiem(boolean showMeridiem)
Indicates whether hours should be rendered as AM/PM or 24hr format
|
void |
setStrings(String[] strs)
Sets the string entries for the string picker
|
void |
setTime(int time)
This value is only used for time type and is ignored in the case of date and time where
both are embedded within the date.
|
void |
setTime(int hour,
int minute)
Convenience method equivalent to invoking setTime(hour * 60 + minute);
|
void |
setType(int type)
Sets the type of the picker to one of Display.PICKER_TYPE_DATE, Display.PICKER_TYPE_DATE_AND_TIME, Display.PICKER_TYPE_STRINGS or
Display.PICKER_TYPE_TIME
|
protected void |
updateValue()
Updates the display value of the picker, subclasses can override this to invoke
set text with the right value
|
addActionListener, animate, calcPreferredSize, dragInitiated, fireClicked, getActionListeners, getBorder, getCommand, getDisabledIcon, getIconFromState, getListeners, getPressedIcon, getReleaseRadius, getRolloverIcon, getRolloverPressedIcon, getState, isOppositeSide, isSelectableInteraction, isSelected, isToggle, keyPressed, keyReleased, keyRepeated, paint, pointerDragged, pointerHover, pointerHoverReleased, pointerPressed, pointerReleased, pressed, released, released, removeActionListener, resetFocusable, setAlignment, setCommand, setDisabledIcon, setPressedIcon, setReleaseRadius, setRolloverIcon, setRolloverPressedIcon, setToggle
bindProperty, getAlignment, getBaseline, getBaselineResizeBehavior, getBindablePropertyNames, getBindablePropertyTypes, getBoundPropertyValue, getGap, getIcon, getMask, getMaskedIcon, getMaskName, getPropertyNames, getPropertyTypeNames, getPropertyTypes, getPropertyValue, getShiftMillimeters, getShiftText, getText, getTextPosition, getVerticalAlignment, isDefaultTickerEnabled, isEndsWith3Points, isShouldLocalize, isTickerEnabled, isTickerRunning, paramString, setBoundPropertyValue, setDefaultTickerEnabled, setEndsWith3Points, setGap, setIcon, setMask, setMaskName, setPropertyValue, setShiftMillimeters, setShiftText, setShouldLocalize, setText, setTextPosition, setTickerEnabled, setVerticalAlignment, shouldTickerStart, startTicker, startTicker, stopTicker, unbindProperty
addDragOverListener, addDropListener, addFocusListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, calcScrollSize, cancelRepaints, clearClientProperties, contains, deinitialize, deinitializeCustomStyle, dragEnter, dragExit, draggingOver, drawDraggedImage, drop, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getBottomGap, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentForm, getComponentState, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragRegionStatus, getDragSpeed, getGridPosX, getGridPosY, getHeight, getLabelForComponent, getName, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getParent, getPreferredH, getPreferredSize, getPreferredW, getPressedStyle, getSameHeight, getSameWidth, getScrollable, getScrollAnimationSpeed, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedRect, getSelectedStyle, getSideGap, getStyle, getTensileLength, getUIID, getUIManager, getUnselectedStyle, getVisibleBounds, getWidth, getX, getY, growShrink, handlesInput, hasFocus, initComponent, initCustomStyle, initLaf, installDefaultPainter, isAlwaysTensile, isCellRenderer, isDragActivated, isDragAndDropOperation, isDraggable, isDragRegion, isDropTarget, isEnabled, isFlatten, isFocusable, isGrabsPointerEvents, isHideInPortrait, isInClippingRegion, isInitialized, isRTL, isScrollable, isScrollableX, isScrollableY, isScrollVisible, isSmoothScrolling, isSnapToGrid, isStickyDrag, isTactileTouch, isTactileTouch, isTensileDragEnabled, isVisible, laidOut, longKeyPress, longPointerPress, onScrollX, onScrollY, paintBackground, paintBackgrounds, paintBorder, paintComponent, paintComponent, paintLock, paintLockRelease, paintScrollbars, paintScrollbarX, paintScrollbarY, pinch, pointerDragged, pointerHoverPressed, pointerPressed, pointerReleased, putClientProperty, refreshTheme, refreshTheme, refreshTheme, removeDragOverListener, removeDropListener, removeFocusListener, removePointerDraggedListener, removePointerPressedListener, removePointerReleasedListener, removeScrollListener, repaint, repaint, requestFocus, scrollRectToVisible, scrollRectToVisible, setAlwaysTensile, setCellRenderer, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setDirtyRegion, setDisabledStyle, setDraggable, setDropTarget, setEnabled, setFlatten, setFocus, setFocusable, setGrabsPointerEvents, setHandlesInput, setHeight, setHideInPortrait, setInitialized, setIsScrollVisible, setLabelForComponent, setName, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setPreferredH, setPreferredSize, setPreferredW, setPressedStyle, setRTL, setSameHeight, setSameWidth, setScrollAnimationSpeed, setScrollOpacityChangeSpeed, setScrollSize, setScrollVisible, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setShouldCalcPreferredSize, setSize, setSmoothScrolling, setSnapToGrid, setTactileTouch, setTensileDragEnabled, setTensileLength, setUIID, setUnselectedStyle, setVisible, setWidth, setX, setY, shouldBlockSideSwipe, styleChanged, toString
public void setType(int type)
type
- the typepublic int getType()
public Date getDate()
public void setDate(Date d)
d
- the new datepublic void setStrings(String[] strs)
strs
- string arraypublic String[] getStrings()
public void setSelectedString(String str)
str
- the current valuepublic String getSelectedString()
protected void updateValue()
public void setTime(int time)
time
- the time value as minutes since midnight e.g. 630 is 10:30ampublic void setTime(int hour, int minute)
hour
- the hour in 24hr formatminute
- the minute within the hourpublic int getTime()
public boolean isShowMeridiem()
public void setShowMeridiem(boolean showMeridiem)
showMeridiem
- the showMeridiem to setpublic Object getRenderingPrototype()
public void setRenderingPrototype(Object renderingPrototype)
renderingPrototype
- the renderingPrototype to set