|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.borg.model.Model
net.sf.borg.model.CategoryModel
public class CategoryModel
The Class CategoryModel manages Categories. Categories are not entities, they are plain text strings. Categories do not exist outside of other Entities. This class maintains a cache of category information in memory but does not persist it. It recreates this information from the category-aware models as needed.
Nested Class Summary | |
---|---|
(package private) static interface |
CategoryModel.CategorySource
interface implemented by Models whose entities contain categories |
Nested classes/interfaces inherited from class net.sf.borg.model.Model |
---|
Model.Listener |
Field Summary | |
---|---|
(package private) Collection<CategoryModel.CategorySource> |
sources
The set of category source models |
static String |
UNCATEGORIZED
a non-null value to represent the lack of a category |
Constructor Summary | |
---|---|
CategoryModel()
|
Method Summary | |
---|---|
void |
addCategory(String cat)
Add a category to the cache. |
void |
addSource(CategoryModel.CategorySource s)
Add a category source. |
Collection<String> |
getCategories()
Get all categories. |
static CategoryModel |
getReference()
Gets the singleton reference. |
Collection<String> |
getShownCategories()
Get the shown categories. |
boolean |
isShown(String cat)
Checks if a category is being shown. |
void |
remove()
Removes the listeners. |
void |
setShownCategories(Collection<String> cats)
Sets the set of shown categories. |
void |
showAll()
Show all categories. |
void |
showCategory(String cat)
Show a particular category. |
void |
syncCategories()
Sync categories with the sources (clears the cache and re-reads the list of categories). |
Methods inherited from class net.sf.borg.model.Model |
---|
addListener, refreshListeners, removeListener, removeListeners |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String UNCATEGORIZED
Collection<CategoryModel.CategorySource> sources
Constructor Detail |
---|
public CategoryModel()
Method Detail |
---|
public static CategoryModel getReference()
public void addCategory(String cat)
cat
- the categoriespublic void addSource(CategoryModel.CategorySource s)
s
- the sourcepublic Collection<String> getCategories() throws Exception
Exception
- the exceptionpublic Collection<String> getShownCategories()
public boolean isShown(String cat)
cat
- the cat
public void remove()
Model
remove
in class Model
public void setShownCategories(Collection<String> cats)
cats
- the shown categoriespublic void showAll()
public void showCategory(String cat)
cat
- the category to showpublic void syncCategories() throws Exception
Exception
- the exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |