|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.lwuit.Component
com.sun.lwuit.List
com.sun.lwuit.ComboBox
public class ComboBox
A combo box is a list that allows only one selection at a time, when a user clicks the combo box a popup button with the full list of elements allows the selection of a single element. The combo box is driven by the list model and allows all the renderer features of the List as well.
List
Field Summary |
---|
Fields inherited from class com.sun.lwuit.List |
---|
FIXED_CENTER, FIXED_LEAD, FIXED_NONE, FIXED_NONE_CYCLIC, FIXED_NONE_ONE_ELEMENT_MARGIN_FROM_EDGE, FIXED_TRAIL, HORIZONTAL, VERTICAL |
Fields inherited from class com.sun.lwuit.Component |
---|
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP |
Constructor Summary | |
---|---|
ComboBox()
Constructs an empty combo box |
|
ComboBox(ListModel model)
Creates a new instance of ComboBox |
|
ComboBox(java.lang.Object[] items)
Creates a new instance of ComboBox |
|
ComboBox(java.util.Vector items)
Creates a new instance of ComboBox |
Method Summary | |
---|---|
protected Dimension |
calcPreferredSize()
Calculates the preferred size based on component content. |
protected Dialog |
createPopupDialog(List l)
Subclasses can override this method to change the creation of the dialog |
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. list. |
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(java.lang.String uiid)
This method sets the Component the Unique identifier. |
protected Command |
showPopupDialog(Dialog popupDialog,
List l)
Shows the popup dialog for the combo box and returns the resulting command. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ComboBox(java.util.Vector items)
items
- set of items placed into the combo box modelpublic ComboBox(java.lang.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 selectionMethod Detail |
---|
public void setUIID(java.lang.String uiid)
Component
setUIID
in class Component
public int getBaseline(int width, int height)
Component
getBaseline
in class Component
width
- the component widthheight
- the component height
protected void laidOut()
Component
laidOut
in class List
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 Dialog createPopupDialog(List l)
l
- the list of the popup
protected Command showPopupDialog(Dialog popupDialog, List l)
popupDialog
- the popup dialogl
- the list within
protected 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
paint
in interface Animation
paint
in class List
g
- the component graphicsprotected 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |