public final class SourceListModel extends Object
SourceList
.Constructor and Description |
---|
SourceListModel() |
Modifier and Type | Method and Description |
---|---|
void |
addCategory(SourceListCategory category)
Adds the given category to the model and fires an event such that
SourceListModelListener s will be notified. |
void |
addCategory(SourceListCategory category,
int index)
Adds the given category to the model at the given index and fires an event such that
SourceListModelListener s will be notified. |
void |
addItemToCategory(SourceListItem item,
SourceListCategory category)
Adds the given item to the given
SourceListCategory . |
void |
addItemToCategory(SourceListItem item,
SourceListCategory category,
int index)
Adds the given item to the given
SourceListCategory at the given index within that
category. |
void |
addItemToItem(SourceListItem childItem,
SourceListItem parentItem)
Adds the given "child" item to the given "parent" item.
|
void |
addItemToItem(SourceListItem childItem,
SourceListItem parentItem,
int index)
Adds the given "child" item to the given "parent" item at the given index.
|
void |
addSourceListModelListener(SourceListModelListener listener)
Adds the given
SourceListModelListener to the list of listeners. |
List<SourceListCategory> |
getCategories()
Gets the
SourceListCategory s associated with this model. |
void |
removeCategory(SourceListCategory category)
Removes the given category from the model and fires an event such that
SourceListModelListener s will be notified. |
void |
removeCategoryAt(int index)
Removes the category at the given index from the model and fires an event such that
SourceListModelListener s will be notified. |
void |
removeItemFromCategory(SourceListItem item,
SourceListCategory category)
Removes the given item from the given category.
|
void |
removeItemFromCategoryAtIndex(SourceListCategory category,
int index)
Removes the item at the given index from the given category.
|
void |
removeItemFromItem(SourceListItem parentItem,
int index)
Removes the given child item at from the given parent item.
|
void |
removeItemFromItem(SourceListItem childItem,
SourceListItem parentItem)
Removes the given child item at from the given parent item.
|
void |
removeSourceListModelListener(SourceListModelListener listener)
Removes the given
SourceListModelListener from the list of listeners. |
void |
validateItemIsInModel(SourceListItem item)
Checks if the given
SourceListItem is in this model. |
public List<SourceListCategory> getCategories()
SourceListCategory
s associated with this model.SourceListCategory
s associated with this model.public void addCategory(SourceListCategory category)
SourceListModelListener
s will be notified.category
- the SourceListCategory
to add.public void addCategory(SourceListCategory category, int index)
SourceListModelListener
s will be notified.category
- the SourceListCategory
to add.index
- the index to add the category at.public void removeCategory(SourceListCategory category)
SourceListModelListener
s will be notified.category
- the SourceListCategory
to remove.IllegalArgumentException
- if the given category is not part of this model.public void removeCategoryAt(int index)
SourceListModelListener
s will be notified.index
- the index of the SourceListCategory
to remove.IllegalArgumentException
- if there is no category at the given index.public void addItemToCategory(SourceListItem item, SourceListCategory category)
SourceListCategory
.item
- the item to add.category
- the category to add the item to.IllegalStateException
- if the given category is not in the model.public void addItemToCategory(SourceListItem item, SourceListCategory category, int index)
SourceListCategory
at the given index within that
category.item
- the item to add.category
- the category to add the item to.index
- the index in the category to add the item.IllegalStateException
- if the given category is not in the model.public void addItemToItem(SourceListItem childItem, SourceListItem parentItem)
childItem
- the item to add to the given parent item.parentItem
- the item to add the child item to.IllegalStateException
- if the given parent item is not in the model.public void addItemToItem(SourceListItem childItem, SourceListItem parentItem, int index)
SourceListItem
will be expanded if it was not a parent but becomes a parent
as a result of this call.childItem
- the item to add to the given parent item.parentItem
- the item to add the child item to.index
- the index of the parent item at which to add the child item.IllegalStateException
- if the given child or parent item is not in the model.public void removeItemFromCategory(SourceListItem item, SourceListCategory category)
item
- the item to remove from the given category.category
- the category form which to remove the given item.IllegalStateException
- if the given category is not in the model.public void removeItemFromCategoryAtIndex(SourceListCategory category, int index)
category
- the category from which to remove the item.index
- the index of the item to remove.IllegalStateException
- if the given category is not in the model.public void removeItemFromItem(SourceListItem childItem, SourceListItem parentItem)
childItem
- the item to remove.parentItem
- the item from which to remove the given child item.IllegalStateException
- if the given child or parent item is not in the model.public void removeItemFromItem(SourceListItem parentItem, int index)
parentItem
- the item from which to remove the given child item.index
- the index of the item to remove.IllegalStateException
- if the given child or parent item is not in the model.public void validateItemIsInModel(SourceListItem item)
SourceListItem
is in this model.item
- the item to check if is in this model.IllegalArgumentException
- if the given item is not part of this model.public void addSourceListModelListener(SourceListModelListener listener)
SourceListModelListener
to the list of listeners.listener
- the listener to add.public void removeSourceListModelListener(SourceListModelListener listener)
SourceListModelListener
from the list of listeners.listener
- the listener to remove.