Package org.apache.pivot.wtk
Interface ListView.ItemRenderer
-
- All Superinterfaces:
ConstrainedVisual
,Renderer
,Visual
- All Known Implementing Classes:
ListViewColorItemRenderer
,ListViewItemRenderer
,TerraFileBrowserSkin.ListViewDriveRenderer
,TerraFileBrowserSkin.ListViewFileRenderer
,TerraVFSBrowserSkin.ListViewDriveRenderer
,TerraVFSBrowserSkin.ListViewFileRenderer
- Enclosing class:
- ListView
public static interface ListView.ItemRenderer extends Renderer
Renderer
interface to customize the appearance of items in a ListView.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
render(java.lang.Object item, int index, ListView listView, boolean selected, Button.State state, boolean highlighted, boolean disabled)
Prepares the renderer for layout or paint.java.lang.String
toString(java.lang.Object item)
Converts a list item to a string representation.-
Methods inherited from interface org.apache.pivot.wtk.ConstrainedVisual
getBaseline, getPreferredHeight, getPreferredSize, getPreferredWidth, setSize, setSize
-
-
-
-
Method Detail
-
render
void render(java.lang.Object item, int index, ListView listView, boolean selected, Button.State state, boolean highlighted, boolean disabled)
Prepares the renderer for layout or paint.- Parameters:
item
- The item to render, ornull
if called to calculate preferred height for skins that assume a fixed renderer height.index
- The index of the item being rendered, or-1
ifitem
isnull
.listView
- The host component.selected
- Iftrue
, the item is selected. the item.state
- The selected, unselected or mixed state for the checkmark. If tri-state checkmarks are not enabled, this value will either be selected or unselected.highlighted
- Iftrue
, the item is highlighted.disabled
- Iftrue
, the item is disabled.
-
toString
java.lang.String toString(java.lang.Object item)
Converts a list item to a string representation.- Parameters:
item
- The particular list item.- Returns:
- The item's string representation, or
null
if the item does not have a string representation.Note that this method may be called often during keyboard navigation, so implementations should avoid unnecessary string allocations.
-
-