|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.list.GenericListCellRenderer
public class GenericListCellRenderer
The generic list cell renderer can display containers or arbitrary LWUIT components as items in a list. It generally relies on the source data being either a hashtable or a list of Strings. It extracts values from the hashtable using the component name as an indication to the hashtable key lookup. This renderer supports label tickering, check boxes/radio buttons etc. seamlessly. Please notice that you must use at least two distinguished instances of the component to render, reusing the same instance WILL NOT WORK. Also the renderer instance cannot be reused for multiple lists, each list will need a new instance of this renderer!
Field Summary | |
---|---|
static java.lang.String |
ENABLED
If this flag exists in a hashtable of data the renderer will enable/disable the entries, the flag assumes either Boolean.TRUE or Boolean.FALSE. |
static java.lang.String |
SELECT_ALL_FLAG
Put this flag as a hashtable key to indicate that a checkbox entry rendered by this renderer should act as a "select all" entry and toggle all other entries. |
Constructor Summary | |
---|---|
GenericListCellRenderer(Component selected,
Component unselected)
Constructs a generic renderer with the given selected/unselected components |
|
GenericListCellRenderer(Component odd,
Component oddUnselected,
Component even,
Component evenUnselected)
Constructs a generic renderer with the given selected/unselected components for odd/even values allowing a "pinstripe" effect |
Method Summary | |
---|---|
Button |
extractLastClickedComponent()
Allows partitioning the renderer into "areas" that can be clicked. |
Component |
getCellRendererComponent(Component list,
java.lang.Object model,
java.lang.Object value,
int index,
boolean isSelected)
Returns a component instance that is already set to render "value". |
Component |
getFocusComponent(Component list)
Returns a component instance that is painted under the currently focused renderer and is animated to provide smooth scrolling. |
Component |
getListCellRendererComponent(List list,
java.lang.Object value,
int index,
boolean isSelected)
Returns a component instance that is already set to render "value". |
Component |
getListFocusComponent(List list)
Returns a component instance that is painted under the currently focused renderer and is animated to provide smooth scrolling. |
Component |
getSelected()
|
Component |
getSelectedEven()
|
Component |
getUnselected()
|
Component |
getUnselectedEven()
|
boolean |
isFisheye()
In fisheye rendering mode the renderer maintains selected component drawing |
boolean |
isSelectionListener()
|
protected void |
setComponentValue(Component cmp,
java.lang.Object value)
Initializes the given component with the given value |
void |
setFisheye(boolean fisheye)
In fisheye rendering mode the renderer maintains selected component drawing |
void |
setSelectionListener(boolean selectionListener)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ENABLED
public static final java.lang.String SELECT_ALL_FLAG
Constructor Detail |
---|
public GenericListCellRenderer(Component selected, Component unselected)
selected
- indicates the selected value for the rendererunselected
- indicates the unselected value for the rendererpublic GenericListCellRenderer(Component odd, Component oddUnselected, Component even, Component evenUnselected)
odd
- indicates the selected value for the rendereroddUnselected
- indicates the unselected value for the renderereven
- indicates the selected value for the rendererevenUnselected
- indicates the unselected value for the rendererMethod Detail |
---|
public Button extractLastClickedComponent()
public Component getCellRendererComponent(Component list, java.lang.Object model, java.lang.Object value, int index, boolean isSelected)
CellRenderer
getCellRendererComponent
in interface CellRenderer
list
- the list componentmodel
- the model behind the rendervalue
- the value to renderindex
- the index in the listisSelected
- whether the entry is selected
public Component getListCellRendererComponent(List list, java.lang.Object value, int index, boolean isSelected)
ListCellRenderer
getListCellRendererComponent
in interface ListCellRenderer
list
- the list componentvalue
- the value to renderindex
- the index in the listisSelected
- whether the entry is selected
protected void setComponentValue(Component cmp, java.lang.Object value)
cmp
- one of the components that is or is a part of the renderervalue
- the value to install into the componentpublic Component getListFocusComponent(List list)
ListCellRenderer
getListFocusComponent
in interface ListCellRenderer
list
- the parent list
Component.setSmoothScrolling(boolean)
public Component getFocusComponent(Component list)
CellRenderer
getFocusComponent
in interface CellRenderer
list
- the parent list
Component.setSmoothScrolling(boolean)
public boolean isSelectionListener()
public void setSelectionListener(boolean selectionListener)
selectionListener
- the selectionListener to setpublic Component getSelected()
public Component getUnselected()
public Component getSelectedEven()
public Component getUnselectedEven()
public boolean isFisheye()
public void setFisheye(boolean fisheye)
fisheye
- the fisheye to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |