edu.cmu.sun.model
Class ListModel
java.lang.Object
edu.cmu.sun.model.ListModel
public class ListModel
- extends java.lang.Object
A state model of a list of items that each represent a file in the
filesystem.
A ListModel is made up of a list of ItemModel components. This class doesn't
do much except allow for some calls that make the design simpler for the
ItemModel objects.
- Author:
- Braden Kowitz, Jake Pierson, Jessica Smith
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
file
FileNodeModel file
items
java.util.List<ItemModel> items
windowModel
WindowModel windowModel
ListModel
public ListModel(FileNodeModel file)
getFile
public FileNodeModel getFile()
- returns the file that this list is based on.
- Returns:
generateItems
private void generateItems()
- generates ItemModels for this list.
setItemOrder
public void setItemOrder(ListModel.Order itemOrder)
getItems
public java.util.List<ItemModel> getItems()
getItemsWithin
public java.util.List<ItemModel> getItemsWithin(IndexRange range)
- Builds a list from the internal Items
- Parameters:
range -
- Returns:
-
- Throws:
IndexOutOfBoundsExcetion - if the range does not fit in the item list.
setWindowModel
public void setWindowModel(WindowModel model)
getWindowModel
public WindowModel getWindowModel()
- might return null if not set yet.
- Returns:
containsItem
public boolean containsItem(ItemModel parentItemModel)