public class ComboBox extends List
List
FIXED_CENTER, FIXED_LEAD, FIXED_NONE, FIXED_NONE_CYCLIC, FIXED_NONE_ONE_ELEMENT_MARGIN_FROM_EDGE, FIXED_TRAIL, HORIZONTAL, VERTICAL
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP
Constructor and Description |
---|
ComboBox()
Constructs an empty combo box
|
ComboBox(ListModel model)
Creates a new instance of ComboBox
|
ComboBox(Object[] items)
Creates a new instance of ComboBox
|
ComboBox(Vector items)
Creates a new instance of ComboBox
|
Modifier and Type | Method and Description |
---|---|
protected Dimension |
calcPreferredSize()
Calculates the preferred size based on component content.
|
protected List |
createPopupList()
Creates the list object used within the popup dialog.
|
protected void |
fireClicked()
When working in 3 softbutton mode "fire" key (center softbutton) is sent to this method
in order to allow 3 button devices to work properly.
|
int |
getBaseline(int width,
int height)
The baseline for the component text according to which it should be aligned
with other components for best visual look.
|
int |
getOrientation()
Returns the list orientation
|
protected Rectangle |
getVisibleBounds()
Returns the component bounds for scrolling which might differ from the getBounds for large components
e.g.
|
static boolean |
isDefaultIncludeSelectCancel()
Indicates whethe the soft buttons for select/cancel should appear for the combo box by default
|
boolean |
isIncludeSelectCancel()
Indicates whethe the soft buttons for select/cancel should appear for the combo box
|
void |
keyReleased(int keyCode)
If this Component is focused, the key released event
will call this method
|
protected void |
laidOut()
This is a callback method to inform the Component when it's been laidout
on the parent Container
|
void |
paint(Graphics g)
This method paints the Component on the screen, it should be overriden
by subclasses to perform custom drawing or invoke the UI API's to let
the PLAF perform the rendering.
|
void |
pointerHover(int[] x,
int[] y)
Invoked for devices where the pointer can hover without actually clicking
the display.
|
void |
pointerHoverReleased(int[] x,
int[] y)
Invoked for devices where the pointer can hover without actually clicking
the display.
|
void |
pointerPressed(int x,
int y)
If this Component is focused, the pointer pressed event
will call this method
|
void |
pointerReleased(int x,
int y)
If this Component is focused, the pointer released event
will call this method
|
static void |
setDefaultIncludeSelectCancel(boolean aDefaultIncludeSelectCancel)
Indicates whethe the soft buttons for select/cancel should appear for the combo box by default
|
void |
setIncludeSelectCancel(boolean includeSelectCancel)
Indicates whethe the soft buttons for select/cancel should appear for the combo box
|
void |
setSelectedIndex(int selection)
Sets the current selected offset in the list, by default this implementation
will scroll the list to the selection if the selection is outside of the screen
|
void |
setSelectedIndex(int selection,
boolean scroll)
Sets the current selected offset in the list
|
void |
setUIID(String uiid)
This method sets the Component the Unique identifier.
|
addActionListener, addItem, addSelectionListener, animate, fireActionEvent, getBorderGap, getFixedSelection, getItemGap, getMinElementHeight, getModel, getRenderer, getRenderingPrototype, getSelectedIndex, getSelectedItem, isCommandList, isIgnoreFocusComponentWhenUnfocused, isMutableRendererBackgrounds, isNumericKeyActions, isScrollableX, isScrollableY, isSelectableInteraction, isTactileTouch, keyPressed, listSelectionChanged, longPointerPress, modelChanged, paramString, pointerDragged, refreshTheme, removeActionListener, removeSelectionListener, scrollRectToVisible, setBorderGap, setCommandList, setFireOnClick, setFixedSelection, setHandlesInput, setIgnoreFocusComponentWhenUnfocused, setInputOnFocus, setItemGap, setListCellRenderer, setMinElementHeight, setModel, setMutableRendererBackgrounds, setNumericKeyActions, setOrientation, setPaintFocusBehindList, setRenderingPrototype, setScrollToSelected, setSelectedItem, setShouldCalcPreferredSize, size
addFocusListener, calcScrollSize, contains, deinitialize, deinitializeCustomStyle, dragInitiated, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getBaselineResizeBehavior, getBorder, getBottomGap, getBounds, getClientProperty, getComponentForm, getDirtyRegion, getHeight, getLabelForComponent, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getParent, getPreferredH, getPreferredSize, getPreferredW, getScrollAnimationSpeed, getScrollDimension, getScrollX, getScrollY, getSelectCommandText, getSelectedStyle, getSideGap, getStyle, getUIID, getUnselectedStyle, getWidth, getX, getY, handlesInput, hasFocus, initComponent, initCustomStyle, isBorderPainted, isDragActivated, isEnabled, isFocusable, isFocusPainted, isInitialized, isRTL, isScrollable, isScrollVisible, isSmoothScrolling, isTactileTouch, isTensileDragEnabled, isVisible, keyRepeated, longKeyPress, paintBackground, paintBackgrounds, paintBorder, paintComponent, paintComponent, paintScrollbars, paintScrollbarX, paintScrollbarY, pointerDragged, pointerPressed, pointerReleased, putClientProperty, refreshTheme, removeFocusListener, repaint, repaint, requestFocus, scrollRectToVisible, scrollRectToVisible, setBorderPainted, setCellRenderer, setDirtyRegion, setEnabled, setFocus, setFocusable, setFocusPainted, setHeight, setInitialized, setIsScrollVisible, setLabelForComponent, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setPreferredH, setPreferredSize, setPreferredW, setRTL, setScrollAnimationSpeed, setScrollSize, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setSize, setSmoothScrolling, setStyle, setTactileTouch, setTensileDragEnabled, setUnselectedStyle, setUnSelectedStyle, setVisible, setWidth, setX, setY, styleChanged, toString
public ComboBox(Vector items)
items
- set of items placed into the combo box modelpublic ComboBox(Object[] items)
items
- set of items placed into the combo box modelpublic ComboBox()
public ComboBox(ListModel model)
model
- the model for the combo box elements and selectionpublic void setUIID(String uiid)
Component
public int getBaseline(int width, int height)
Component
getBaseline
in class Component
width
- the component widthheight
- the component heightprotected void laidOut()
Component
protected Rectangle getVisibleBounds()
Component
getVisibleBounds
in class List
Component.getX()
,
Component.getY()
public void setSelectedIndex(int selection)
List
setSelectedIndex
in class List
selection
- the current selected offset in the listpublic void setSelectedIndex(int selection, boolean scroll)
List
setSelectedIndex
in class List
selection
- the current selected offset in the listscroll
- indicates whether scrolling to selection should
occur if the selection is outside of viewpublic void pointerHover(int[] x, int[] y)
Component
pointerHover
in class List
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerHoverReleased(int[] x, int[] y)
Component
pointerHoverReleased
in class List
x
- the pointer x coordinatey
- the pointer y coordinateprotected void fireClicked()
Component
fireClicked
in class List
protected List createPopupList()
public void keyReleased(int keyCode)
Component
keyReleased
in class List
keyCode
- the key code value to indicate a physical key.public void pointerPressed(int x, int y)
Component
pointerPressed
in class List
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerReleased(int x, int y)
Component
pointerReleased
in class List
x
- the pointer x coordinatey
- the pointer y coordinatepublic void paint(Graphics g)
Component
protected Dimension calcPreferredSize()
Component
calcPreferredSize
in class List
public int getOrientation()
List
getOrientation
in class List
List.HORIZONTAL
,
List.VERTICAL
public boolean isIncludeSelectCancel()
public void setIncludeSelectCancel(boolean includeSelectCancel)
includeSelectCancel
- the new valuepublic static boolean isDefaultIncludeSelectCancel()
public static void setDefaultIncludeSelectCancel(boolean aDefaultIncludeSelectCancel)
aDefaultIncludeSelectCancel
- the new value