edu.umd.cfar.lamp.apploader.prefs
Class FileHistoryManager

java.lang.Object
  extended byedu.umd.cfar.lamp.apploader.prefs.FileHistoryManager

public class FileHistoryManager
extends java.lang.Object

Manages the file history list.

Since:
May 23, 2003
Author:
davidm

Field Summary
static java.util.Comparator SORT_XSDATE_TIME
          Sorts RDF nodes based on their mru:viewedOn date.
 
Constructor Summary
FileHistoryManager()
           
 
Method Summary
 void clean()
          Removes all older view entries from the file history.
 com.hp.hpl.jena.rdf.model.Resource getActionListenerResource()
          The resource representing the 'open file' bean; this is used to set up the recently used menu items.
static java.lang.String getFileTitle(java.net.URI f)
          Gets the user-friendly title of the given URI.
 int getMRULength()
          Get the number of items to keep in the MRU list.
 com.hp.hpl.jena.rdf.model.Resource getParentResource()
          Gets the resource representing the item (usually an lal:menu or an lal:group) where the MRU menu is to be attached.
 PrefsManager getPrefs()
          Gets the apploader preference manager.
 void resetMostRecentlyViewedList()
          Saves the history list back to the user preference space.
 void setActionListenerResource(com.hp.hpl.jena.rdf.model.Resource resource)
          Sets the action that will be invoked when a user clicks on an item in the MRU menu.
 void setMRULength(int i)
          Sets the number of items to save in the MRU list.
 void setParentResource(com.hp.hpl.jena.rdf.model.Resource resource)
          Sets where in the menu the list should be attached.
 void setPrefs(PrefsManager manager)
          Sets the preference manager.
 void touch(java.net.URI uri)
          Update the file history to indicate that the file at the given URI was visited now.
 void touchFile(java.lang.String fname)
          Touches the file at the given file path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SORT_XSDATE_TIME

public static java.util.Comparator SORT_XSDATE_TIME
Sorts RDF nodes based on their mru:viewedOn date.

Constructor Detail

FileHistoryManager

public FileHistoryManager()
Method Detail

clean

public void clean()
Removes all older view entries from the file history.


getFileTitle

public static java.lang.String getFileTitle(java.net.URI f)
Gets the user-friendly title of the given URI. Basically, this means converting from file: URIs into file names.

Parameters:
f - the URI
Returns:
the pretty name

touch

public void touch(java.net.URI uri)
Update the file history to indicate that the file at the given URI was visited now.

Parameters:
uri - the uri to put a new 'viewed date' on

touchFile

public void touchFile(java.lang.String fname)
Touches the file at the given file path.

Parameters:
fname - the file to mark as touched

resetMostRecentlyViewedList

public void resetMostRecentlyViewedList()
Saves the history list back to the user preference space.


getPrefs

public PrefsManager getPrefs()
Gets the apploader preference manager.

Returns:
the preference manager

setPrefs

public void setPrefs(PrefsManager manager)
Sets the preference manager. This must be set for this to be useful, as that is where the RDF data store is.

Parameters:
manager - the preference manager

getMRULength

public int getMRULength()
Get the number of items to keep in the MRU list.

Returns:
the number of items to keep in the MRU list

setMRULength

public void setMRULength(int i)
Sets the number of items to save in the MRU list.

Parameters:
i - the number of items to keep in the MRU list

getActionListenerResource

public com.hp.hpl.jena.rdf.model.Resource getActionListenerResource()
The resource representing the 'open file' bean; this is used to set up the recently used menu items.

Returns:
the open file bean's uri

getParentResource

public com.hp.hpl.jena.rdf.model.Resource getParentResource()
Gets the resource representing the item (usually an lal:menu or an lal:group) where the MRU menu is to be attached.

Returns:
the attachment point for the menu

setActionListenerResource

public void setActionListenerResource(com.hp.hpl.jena.rdf.model.Resource resource)
Sets the action that will be invoked when a user clicks on an item in the MRU menu.

Parameters:
resource - the file open bean's uri

setParentResource

public void setParentResource(com.hp.hpl.jena.rdf.model.Resource resource)
Sets where in the menu the list should be attached.

Parameters:
resource - the menu, group, or (don't you think about it) root pane container to attach the menu to