frysk.gui.srcwin.tags
Class TagsetManager

java.lang.Object
  extended by frysk.gui.srcwin.tags.TagsetManager

public class TagsetManager
extends Object

The TagsetManager keeps track of the tagsets available for frysk, as well as maintaining the association between tagsets and what executable command they are applicable to.


Field Summary
static TagsetManager manager
           
private  UniqueHashMap nameHash
           
private  ObservableLinkedList tagsets
           
private static File TAGSETS_DIR
           
private  File tagsetsDir
           
 
Constructor Summary
TagsetManager(File tagsetsDir)
          Create a new TagsetManager
 
Method Summary
 void addTagset(Tagset toAdd)
          Adds the tagset to the manager.
 boolean containsTagset(Tagset set)
          Checks for the presence of the given tagset in the TagsetManager
 ObservableLinkedList getListTagsets()
           
 Tagset getTagsetByName(String name)
          Returns the tagset that matches the name
 Iterator getTagsets()
           
 Iterator getTagsets(String command)
          Returns all of the tagsets applicable to the provided command
 void load()
          Loads tag sets from disk and registers loaded tag sets with the manager.
 void removeTagset(Tagset tagSet)
          Removes the tagset from the manager.
 void save()
          Saves the registered tag sets in the manager to disk
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

manager

public static TagsetManager manager

TAGSETS_DIR

private static final File TAGSETS_DIR

tagsets

private ObservableLinkedList tagsets

nameHash

private UniqueHashMap nameHash

tagsetsDir

private File tagsetsDir
Constructor Detail

TagsetManager

public TagsetManager(File tagsetsDir)
Create a new TagsetManager

Method Detail

save

public void save()
Saves the registered tag sets in the manager to disk


load

public void load()
Loads tag sets from disk and registers loaded tag sets with the manager.


addTagset

public void addTagset(Tagset toAdd)
Adds the tagset to the manager. If the tagset already exists in the manager an IllegalArgumentException is thrown.

Parameters:
toAdd - The tagset to store.

removeTagset

public void removeTagset(Tagset tagSet)
Removes the tagset from the manager.

Parameters:
tagSet - The tagset to remove.

getTagsets

public Iterator getTagsets(String command)
Returns all of the tagsets applicable to the provided command

Parameters:
command - The command to get the tagsets for
Returns:
The tagsets applicable to command.

getTagsets

public Iterator getTagsets()
Returns:
An iterator to all tagsets in the manager

getListTagsets

public ObservableLinkedList getListTagsets()
Returns:
ObserverableLinkedList with all tagsets in the manager

getTagsetByName

public Tagset getTagsetByName(String name)
Returns the tagset that matches the name

Parameters:
name - The name of the tagset
Returns:
The tagset applicable to name.

containsTagset

public boolean containsTagset(Tagset set)
Checks for the presence of the given tagset in the TagsetManager

Parameters:
set - The Tagset to look for
Returns:
True iff the tagset is registered with the manager