public class ExternalKListModel extends DefaultKListModel
KListModel
that obtains its data from
an external data source.Modifier and Type | Field and Description |
---|---|
protected ListDataSource |
source
The data source for this model.
|
data, support
COLUMN_NAMES_PROPERTY, COLUMN_TYPES_PROPERTY
Constructor and Description |
---|
ExternalKListModel(ListDataSource source)
Construct a new
ExternalKListModel with the given
data source. |
Modifier and Type | Method and Description |
---|---|
void |
addItem(Object item)
Add an item to the model.
|
Icon |
getIcon(Object item)
Get the icon for an item.
|
String |
getLabel(Object item)
Get the label for an item.
|
Object |
getValueForProperty(Object item,
String property)
Get the value of an arbitrary property for a given item.
|
void |
insertItemAt(Object item,
int index)
Insert an item at the specified index in the model.
|
void |
reload()
Reload the list model from the data source.
|
void |
removeItem(Object item)
Remove the specified item from the model.
|
void |
removeItemAt(int index)
Remove the item at the specified index from the model.
|
void |
updateItem(Object item)
Indicate to listeners that the specified item has changed.
|
void |
updateItemAt(int index)
Indicate to listeners that the item at the specified index has changed.
|
addListModelListener, clear, getItemAt, getItemCount, getItems, indexOf, isEmpty, removeListModelListener, sort
protected ListDataSource source
public ExternalKListModel(ListDataSource source)
ExternalKListModel
with the given
data source.source
- The data source.public void reload()
public void addItem(Object item)
KListModel
addItem
in interface KListModel
addItem
in class DefaultKListModel
item
- The new item.public void insertItemAt(Object item, int index)
KListModel
insertItemAt
in interface KListModel
insertItemAt
in class DefaultKListModel
item
- The new item.index
- The index.public void removeItemAt(int index)
KListModel
removeItemAt
in interface KListModel
removeItemAt
in class DefaultKListModel
index
- The index.public void removeItem(Object item)
KListModel
removeItem
in interface KListModel
removeItem
in class DefaultKListModel
item
- The item.public void updateItem(Object item)
KListModel
updateItem
in interface KListModel
updateItem
in class DefaultKListModel
item
- The item.public void updateItemAt(int index)
KListModel
updateItemAt
in interface KListModel
updateItemAt
in class DefaultKListModel
index
- The index.public Object getValueForProperty(Object item, String property)
KListModel
getValueForProperty
in interface KListModel
getValueForProperty
in class DefaultKListModel
item
- The item.property
- The name of the property.null
if
there is no value for this property.public String getLabel(Object item)
getLabel
in interface KListModel
getLabel
in class DefaultKListModel
item
- The item.public Icon getIcon(Object item)
getIcon
in interface KListModel
getIcon
in class DefaultKListModel
item
- The item.WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses