|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.pivot.wtk.Component
org.apache.pivot.wtk.ListView
@DefaultProperty(value="listData") public class ListView
Component that displays a sequence of items, optionally allowing a user to select or check one or more items.
| Nested Class Summary | |
|---|---|
static interface |
ListView.ItemBindMapping
Translates between item position and bind context data during data binding. |
static interface |
ListView.ItemEditor
List view item editor interface. |
static interface |
ListView.ItemRenderer
Renderer interface to customize the appearance of items in a ListView. |
static interface |
ListView.ListDataBindMapping
Translates between list and bind context data during data binding. |
static class |
ListView.SelectMode
Enumeration defining supported selection modes. |
static interface |
ListView.Skin
List view skin interface. |
| Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component |
|---|
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary |
| Constructor Summary | |
|---|---|
ListView()
Creates a list view populated with an empty array list. |
|
ListView(org.apache.pivot.collections.List<?> listData)
Creates a list view populated with the given list data. |
|
| Method Summary | |
|---|---|
boolean |
addSelectedIndex(int index)
Adds a single index to the selection. |
org.apache.pivot.collections.Sequence<Span> |
addSelectedRange(int start,
int end)
Adds a range of indexes to the selection. |
org.apache.pivot.collections.Sequence<Span> |
addSelectedRange(Span range)
Adds a range of indexes to the selection. |
void |
clear()
Clears any bound values in the component. |
void |
clearCheckmarks()
Clears the checked state of all checked items. |
void |
clearSelection()
Clears the selection. |
org.apache.pivot.collections.immutable.ImmutableList<Integer> |
getCheckedIndexes()
Returns the indexes of currently checked items. |
ListView.ItemBindMapping |
getCheckedItemsBindMapping()
|
BindType |
getCheckedItemsBindType()
|
String |
getCheckedItemsKey()
|
boolean |
getCheckmarksEnabled()
Returns the current check mode. |
org.apache.pivot.util.Filter<?> |
getDisabledCheckmarkFilter()
Returns the disabled checkmark filter, which determines which checkboxes are interactive and which are not. |
org.apache.pivot.util.Filter<?> |
getDisabledItemFilter()
Returns the disabled item filter. |
int |
getFirstSelectedIndex()
Returns the first selected index. |
int |
getItemAt(int y)
Returns the index of the item at a given location. |
Bounds |
getItemBounds(int index)
Returns the bounding area of a given item. |
ListView.ItemEditor |
getItemEditor()
Returns the editor used to edit items in this list. |
int |
getItemIndent()
Returns the item indent. |
ListView.ItemRenderer |
getItemRenderer()
Returns the item renderer used for items in this list. |
int |
getLastSelectedIndex()
Returns the last selected index. |
org.apache.pivot.collections.List<?> |
getListData()
Returns the list data. |
ListView.ListDataBindMapping |
getListDataBindMapping()
|
BindType |
getListDataBindType()
|
String |
getListDataKey()
|
org.apache.pivot.util.ListenerList<ListViewBindingListener> |
getListViewBindingListeners()
|
org.apache.pivot.util.ListenerList<ListViewItemListener> |
getListViewItemListeners()
Returns the list view item listener list. |
org.apache.pivot.util.ListenerList<ListViewItemStateListener> |
getListViewItemStateListeners()
Returns the list view item state listener list. |
org.apache.pivot.util.ListenerList<ListViewListener> |
getListViewListeners()
Returns the list view listener list. |
org.apache.pivot.util.ListenerList<ListViewSelectionListener> |
getListViewSelectionListeners()
Returns the list view selection detail listener list. |
int |
getSelectedIndex()
When in single-select mode, returns the currently selected index. |
Object |
getSelectedItem()
|
ListView.ItemBindMapping |
getSelectedItemBindMapping()
|
BindType |
getSelectedItemBindType()
|
String |
getSelectedItemKey()
|
org.apache.pivot.collections.Sequence<?> |
getSelectedItems()
|
ListView.ItemBindMapping |
getSelectedItemsBindMapping()
|
BindType |
getSelectedItemsBindType()
|
String |
getSelectedItemsKey()
|
org.apache.pivot.collections.immutable.ImmutableList<Span> |
getSelectedRanges()
Returns the currently selected ranges. |
ListView.SelectMode |
getSelectMode()
Returns the current selection mode. |
boolean |
isCheckmarkDisabled(int index)
Tells whether or not an item's checkmark is disabled. |
boolean |
isItemChecked(int index)
Returns an item's checked state. |
boolean |
isItemDisabled(int index)
Returns an item's disabled state. |
boolean |
isItemSelected(int index)
Returns the selection state of a given index. |
void |
load(Object context)
Copies bound values from the bind context to the component. |
boolean |
removeSelectedIndex(int index)
Removes a single index from the selection. |
org.apache.pivot.collections.Sequence<Span> |
removeSelectedRange(int start,
int end)
Removes a range of indexes from the selection. |
org.apache.pivot.collections.Sequence<Span> |
removeSelectedRange(Span range)
Removes a range of indexes from the selection. |
void |
selectAll()
Selects all items in the list. |
void |
setCheckedItemsBindMapping(ListView.ItemBindMapping checkedItemsBindMapping)
|
void |
setCheckedItemsBindType(BindType checkedItemsBindType)
|
void |
setCheckedItemsKey(String checkedItemsKey)
|
void |
setCheckmarksEnabled(boolean checkmarksEnabled)
Enables or disabled checkmarks. |
void |
setDisabledCheckmarkFilter(org.apache.pivot.util.Filter<?> disabledCheckmarkFilter)
Sets the disabled checkmark filter, which determines which checkboxes are interactive and which are not. |
void |
setDisabledItemFilter(org.apache.pivot.util.Filter<?> disabledItemFilter)
Sets the disabled item filter. |
void |
setItemChecked(int index,
boolean checked)
Sets an item's checked state. |
void |
setItemEditor(ListView.ItemEditor itemEditor)
Sets the editor used to edit items in this list. |
void |
setItemRenderer(ListView.ItemRenderer itemRenderer)
Sets the item renderer to be used for items in this list. |
void |
setListData(org.apache.pivot.collections.List<?> listData)
Sets the list data. |
void |
setListData(String listData)
Sets the list data. |
void |
setListData(URL listData)
Sets the list data. |
void |
setListDataBindMapping(ListView.ListDataBindMapping listDataBindMapping)
|
void |
setListDataBindType(BindType listDataBindType)
|
void |
setListDataKey(String listDataKey)
|
void |
setSelectedIndex(int index)
Sets the selection to a single index. |
void |
setSelectedItem(Object item)
|
void |
setSelectedItemBindMapping(ListView.ItemBindMapping selectedItemBindMapping)
|
void |
setSelectedItemBindType(BindType selectedItemBindType)
|
void |
setSelectedItemKey(String selectedItemKey)
|
void |
setSelectedItems(org.apache.pivot.collections.Sequence<Object> items)
|
void |
setSelectedItemsBindMapping(ListView.ItemBindMapping selectedItemsBindMapping)
|
void |
setSelectedItemsBindType(BindType selectedItemsBindType)
|
void |
setSelectedItemsKey(String selectedItemsKey)
|
void |
setSelectedRange(int start,
int end)
Sets the selection to a single range. |
org.apache.pivot.collections.Sequence<Span> |
setSelectedRanges(org.apache.pivot.collections.Sequence<Span> selectedRanges)
Sets the selection to the given range sequence. |
org.apache.pivot.collections.Sequence<Span> |
setSelectedRanges(String selectedRanges)
Sets the selection to the given range sequence. |
void |
setSelectMode(ListView.SelectMode selectMode)
Sets the selection mode. |
protected void |
setSkin(Skin skin)
Sets the skin, replacing any previous skin. |
void |
store(Object context)
Copies bound values from the component to the bind context. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ListView()
public ListView(org.apache.pivot.collections.List<?> listData)
listData - | Method Detail |
|---|
public org.apache.pivot.collections.List<?> getListData()
public void setListData(org.apache.pivot.collections.List<?> listData)
listData - The data to be presented by the list view.public final void setListData(String listData)
listData - A JSON string (must begin with [ and end with ])
denoting the data to be presented by the list view.public void setListData(URL listData)
listData - A URL referring to a JSON file containing the data to be presented by
the list view.protected void setSkin(Skin skin)
Component
setSkin in class Componentskin - The new skin.public ListView.ItemRenderer getItemRenderer()
public void setItemRenderer(ListView.ItemRenderer itemRenderer)
itemRenderer - The item renderer for the list.public ListView.ItemEditor getItemEditor()
public void setItemEditor(ListView.ItemEditor itemEditor)
itemEditor - The item editor for the list.public int getSelectedIndex()
public void setSelectedIndex(int index)
index - The index to select, or -1 to clear the selection.
public void setSelectedRange(int start,
int end)
start - end - public org.apache.pivot.collections.immutable.ImmutableList<Span> getSelectedRanges()
public org.apache.pivot.collections.Sequence<Span> setSelectedRanges(org.apache.pivot.collections.Sequence<Span> selectedRanges)
selectedRanges -
public final org.apache.pivot.collections.Sequence<Span> setSelectedRanges(String selectedRanges)
selectedRanges - A JSON-formatted string containing the ranges to select.
setSelectedRanges(Sequence)public int getFirstSelectedIndex()
public int getLastSelectedIndex()
public boolean addSelectedIndex(int index)
index - The index to add.
public org.apache.pivot.collections.Sequence<Span> addSelectedRange(int start,
int end)
start - The first index in the range.end - The last index in the range.
public org.apache.pivot.collections.Sequence<Span> addSelectedRange(Span range)
range - The range to add.
public boolean removeSelectedIndex(int index)
index - The index to remove.
public org.apache.pivot.collections.Sequence<Span> removeSelectedRange(int start,
int end)
start - The start of the range to remove.end - The end of the range to remove.
public org.apache.pivot.collections.Sequence<Span> removeSelectedRange(Span range)
range - The range to remove.
public void selectAll()
public void clearSelection()
public boolean isItemSelected(int index)
index - The index whose selection state is to be tested.
public Object getSelectedItem()
public void setSelectedItem(Object item)
public org.apache.pivot.collections.Sequence<?> getSelectedItems()
public void setSelectedItems(org.apache.pivot.collections.Sequence<Object> items)
public ListView.SelectMode getSelectMode()
public void setSelectMode(ListView.SelectMode selectMode)
selectMode - The new selection mode.public boolean getCheckmarksEnabled()
public void setCheckmarksEnabled(boolean checkmarksEnabled)
checkmarksEnabled - public boolean isItemChecked(int index)
index -
public void setItemChecked(int index,
boolean checked)
index - checked - public org.apache.pivot.collections.immutable.ImmutableList<Integer> getCheckedIndexes()
public void clearCheckmarks()
public boolean isCheckmarkDisabled(int index)
index - The index of the item whose disabled checkmark state is to be tested.
public org.apache.pivot.util.Filter<?> getDisabledCheckmarkFilter()
Note: this filter is only relavent if
checkmarksEnabled is set to true.
public void setDisabledCheckmarkFilter(org.apache.pivot.util.Filter<?> disabledCheckmarkFilter)
Note: this filter is only relavent if
checkmarksEnabled is set to true.
enabled.
disabledCheckmarkFilter - The disabled checkmark filter, or null for no disabled
checkmark filterpublic boolean isItemDisabled(int index)
index - The index of the item whose disabled state is to be tested.
public org.apache.pivot.util.Filter<?> getDisabledItemFilter()
public void setDisabledItemFilter(org.apache.pivot.util.Filter<?> disabledItemFilter)
disabledItemFilter - The disabled item filter, or null for no disabled item filter.public String getListDataKey()
public void setListDataKey(String listDataKey)
public BindType getListDataBindType()
public void setListDataBindType(BindType listDataBindType)
public ListView.ListDataBindMapping getListDataBindMapping()
public void setListDataBindMapping(ListView.ListDataBindMapping listDataBindMapping)
public String getSelectedItemKey()
public void setSelectedItemKey(String selectedItemKey)
public BindType getSelectedItemBindType()
public void setSelectedItemBindType(BindType selectedItemBindType)
public ListView.ItemBindMapping getSelectedItemBindMapping()
public void setSelectedItemBindMapping(ListView.ItemBindMapping selectedItemBindMapping)
public String getSelectedItemsKey()
public void setSelectedItemsKey(String selectedItemsKey)
public BindType getSelectedItemsBindType()
public void setSelectedItemsBindType(BindType selectedItemsBindType)
public ListView.ItemBindMapping getSelectedItemsBindMapping()
public void setSelectedItemsBindMapping(ListView.ItemBindMapping selectedItemsBindMapping)
public String getCheckedItemsKey()
public void setCheckedItemsKey(String checkedItemsKey)
public BindType getCheckedItemsBindType()
public void setCheckedItemsBindType(BindType checkedItemsBindType)
public ListView.ItemBindMapping getCheckedItemsBindMapping()
public void setCheckedItemsBindMapping(ListView.ItemBindMapping checkedItemsBindMapping)
public void load(Object context)
Component
load in class Componentpublic void store(Object context)
Component
store in class Componentpublic void clear()
Component
clear in class Componentpublic int getItemAt(int y)
y - The y-coordinate of the item to identify.
public Bounds getItemBounds(int index)
index - The item index.
public int getItemIndent()
public org.apache.pivot.util.ListenerList<ListViewListener> getListViewListeners()
public org.apache.pivot.util.ListenerList<ListViewItemListener> getListViewItemListeners()
public org.apache.pivot.util.ListenerList<ListViewItemStateListener> getListViewItemStateListeners()
public org.apache.pivot.util.ListenerList<ListViewSelectionListener> getListViewSelectionListeners()
public org.apache.pivot.util.ListenerList<ListViewBindingListener> getListViewBindingListeners()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||