|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.baka.ambient.activity.main.cb.CategoryManager
final class CategoryManager
Performs the criteria selection.
Constructor Summary | |
---|---|
CategoryManager(CategoryEnum[] categories)
Creates new manager. |
Method Summary | |
---|---|
boolean |
canReturnTracks()
Checks if this manager can provide a list of tracks. |
CategoryEnum |
getCurrent()
Returns currently shown category. |
List<String> |
getDisplayableContent()
Returns string representation of items contained in this manager. |
int |
getIndexOfPreviouslyActivatedItem(IContentManager contentManager)
When activating an item, the manager should keep track of this item so that it can return its index when going back. |
String |
getSelectedItemName()
Returns selected item as a displayable string. |
List<TrackMetadataBean> |
getTracks(Interval highlight)
Computes a list of tracks. |
IContentManager |
goBack()
Returns a content manager which will handle contents after a back operation. |
boolean |
initialize(boolean isYear,
ICollection collection)
Initialize this manager and fetch the data. |
IContentManager |
itemActivated(int i)
User activated given item. |
void |
uninitialize()
This manager will not be used for a while. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
CategoryManager(CategoryEnum[] categories)
categories
- browse through these categories.Method Detail |
---|
public boolean canReturnTracks()
IContentManager
canReturnTracks
in interface IContentManager
true
if the manager is able to provide a list of
tracks.public List<String> getDisplayableContent()
IContentManager
Returns string representation of items contained in this manager.
This method is run in handler's thread.
getDisplayableContent
in interface IContentManager
null
, may be empty.public List<TrackMetadataBean> getTracks(Interval highlight) throws CollectionException, InterruptedException
IContentManager
IContentManager.canReturnTracks()
returns
true
. This method is not run in handler's thread.
getTracks
in interface IContentManager
highlight
- the selection
CollectionException
- if the underlying collection throws an exception.
InterruptedException
- if interrupted.public void uninitialize()
IContentManager
uninitialize
in interface IContentManager
public IContentManager goBack()
IContentManager
Returns a content manager which will handle contents after a back operation.
This method is run in handler's thread.
goBack
in interface IContentManager
null
if the back
operation is not allowed. Returned manager instance is
uninitialized.public boolean initialize(boolean isYear, ICollection collection) throws CollectionException, InterruptedException
IContentManager
Initialize this manager and fetch the data. This method will not be
invoked in handler's thread. This is the first method invoked on a new
manager (or managers retrieved by IContentManager.goBack()
and
IContentManager.itemActivated(int)
methods).
The manager may be initialized multiple times with different values of
the isYear
. The manager should simply do nothing if its
previous contents does not change.
initialize
in interface IContentManager
isYear
- true
if year is displayed, false
otherwise.collection
- the collection to poll data from.
CollectionException
- if the underlying collection throws an exception.
InterruptedException
- if interrupted.public IContentManager itemActivated(int i)
IContentManager
User activated given item. Return a new manager which will handle new contents.
This method is run in handler's thread.
itemActivated
in interface IContentManager
i
- the item index.
null
if we cannot move
forward. Returned manager instance is uninitialized.public CategoryEnum getCurrent()
public int getIndexOfPreviouslyActivatedItem(IContentManager contentManager)
IContentManager
getIndexOfPreviouslyActivatedItem
in interface IContentManager
contentManager
- the other manager on the same level.
public String getSelectedItemName()
IContentManager
getSelectedItemName
in interface IContentManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |