|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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 |
java.lang.String[] |
getPropertyNames()
A component may expose mutable property names for a UI designer to manipulate, this API is designed for usage internally by the GUI builder code |
java.lang.Class[] |
getPropertyTypes()
Matches the property names method (see that method for further details). |
java.lang.Object |
getPropertyValue(java.lang.String name)
Returns the current value of the property name, this method is used by the GUI builder |
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 |
java.lang.String |
setPropertyValue(java.lang.String name,
java.lang.Object value)
Sets a new value to the given property, returns an error message if failed and null if successful. |
void |
setRenderer(CellRenderer r)
The renderer used to draw the container list elements |
Methods inherited from class java.lang.Object |
---|
equals, 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()
public 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()
public java.lang.String[] getPropertyNames()
Component
getPropertyNames
in class Component
public java.lang.Class[] getPropertyTypes()
Component
getPropertyTypes
in class Component
public java.lang.Object getPropertyValue(java.lang.String name)
Component
getPropertyValue
in class Component
name
- the name of the property
public java.lang.String setPropertyValue(java.lang.String name, java.lang.Object value)
Component
setPropertyValue
in class Component
name
- the name of the propertyvalue
- new value for the property
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |