|
||||||||||
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.Container
com.sun.lwuit.list.ContainerList
public class ContainerList
This is a "list component" implemented as a container with a layout manager which provides some of the ui advantages of a Container and some of a list while pulling out some of the drawbacks of both. This container uses the model/renderer approach for populating itself, adding/removing entries will probably break it. It still provides most of the large size advantages a list offers since the components within it are very simple and don't contain any actual state other than layout information. The big advantage with this class is the ability to leverage elaborate LWUIT layouts such as Grid, Table & flow layout to provide other ways of rendering the content of a list model.
Field Summary |
---|
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 | |
---|---|
ContainerList()
Default constructor |
|
ContainerList(Layout l,
ListModel m)
Constructs a container list with the given model and layout |
|
ContainerList(ListModel m)
Constructs a container list with the given model |
Method Summary | |
---|---|
void |
addActionListener(ActionListener l)
Allows binding a listener to user selection actions |
java.util.Vector |
getActionListeners()
This method allows extracting the action listeners from the current list |
ListModel |
getModel()
Returns the list model |
CellRenderer |
getRenderer()
The renderer used to draw the container list elements |
java.lang.Object |
getSelectedItem()
Returns the current/last selected item |
protected void |
initComponent()
Allows subclasses to bind functionality that relies on fully initialized and "ready for action" component state |
void |
removeActionListener(ActionListener l)
Allows binding a listener to user selection actions |
void |
setModel(ListModel model)
Set the model for the container list |
void |
setRenderer(CellRenderer r)
The renderer used to draw the container list elements |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ContainerList()
public ContainerList(ListModel m)
m
- the modelpublic ContainerList(Layout l, ListModel m)
l
- layout managerm
- the modelMethod Detail |
---|
public void setRenderer(CellRenderer r)
r
- renderer instancepublic CellRenderer getRenderer()
r
- renderer instancepublic ListModel getModel()
public void addActionListener(ActionListener l)
l
- the action listener to be addedpublic java.util.Vector getActionListeners()
public void removeActionListener(ActionListener l)
l
- the action listener to be removedprotected void initComponent()
Component
initComponent
in class Component
public void setModel(ListModel model)
model
- a model class that is mapped into the internal componentspublic java.lang.Object getSelectedItem()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |