de.cau.cs.kieler.sim.kiem.config.managers
Class EditorManager

java.lang.Object
  extended by de.cau.cs.kieler.sim.kiem.config.managers.AbstractManager
      extended by de.cau.cs.kieler.sim.kiem.config.managers.EditorManager

public final class EditorManager
extends AbstractManager

Manages the editors including editor names and editor ids.

Rating proposed yellow
(2010-01-27)

Field Summary
static String CODED_DEFAULT_EDITOR_ID
          the default editor id.
static String DEFAULT_EDITOR_NAME
          the default editor name.
 
Method Summary
 EditorDefinition addEditor(EditorDefinition newDefinition)
          Add a new editor to the list.
 EditorDefinition findEditorById(EditorIdWrapper editorId)
          Get the matching editor definition containing the specified editorId.
 EditorDefinition findEditorByName(String name)
          Find an editor based on the editors name.
 EditorDefinition getDefaultEditor()
          Get the default editor.
 EditorIdWrapper getDefaultEditorId()
          Get the default editor id.
 String getDefaultEditorName()
          Get the default editor name.
 List<EditorDefinition> getEditors()
          Getter for the list of all editors.
static EditorManager getInstance()
          Getter for the singleton instance.
 void load()
          Load the saved data from the plugin's preference store.
 void removeEditor(EditorDefinition editor)
          Remove an editor from the list.
 void save()
          Saves the data inside the manager into the plugin's preference store.
 void setDefaultEditor(EditorDefinition defaultEditor)
          Set the default editor.
 
Methods inherited from class de.cau.cs.kieler.sim.kiem.config.managers.AbstractManager
addEventListener, load, notifyListeners, remove, removeEventListener, save, saveAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CODED_DEFAULT_EDITOR_ID

public static final String CODED_DEFAULT_EDITOR_ID
the default editor id.

See Also:
Constant Field Values

DEFAULT_EDITOR_NAME

public static final String DEFAULT_EDITOR_NAME
the default editor name.

See Also:
Constant Field Values
Method Detail

getInstance

public static EditorManager getInstance()
Getter for the singleton instance.

Returns:
the instance

addEditor

public EditorDefinition addEditor(EditorDefinition newDefinition)
Add a new editor to the list.

If a definition with the same name is already present the method returns that definition instead of the one passed to it.

Parameters:
newDefinition - the definition to add.
Returns:
the added definition

findEditorById

public EditorDefinition findEditorById(EditorIdWrapper editorId)
Get the matching editor definition containing the specified editorId.

Parameters:
editorId - the id to look for
Returns:
the matching editor, or null if none was found.

findEditorByName

public EditorDefinition findEditorByName(String name)
Find an editor based on the editors name.

Parameters:
name - the name of the editor to look for
Returns:
the editor that was found or null

removeEditor

public void removeEditor(EditorDefinition editor)
Remove an editor from the list.

Removes the editor support from all schedules as well.

Parameters:
editor - the editor to remove

getDefaultEditorId

public EditorIdWrapper getDefaultEditorId()
Get the default editor id.

Returns:
the default editors id

getDefaultEditorName

public String getDefaultEditorName()
Get the default editor name.

Returns:
the default editors name

getDefaultEditor

public EditorDefinition getDefaultEditor()
Get the default editor.

Returns:
the default editor.

setDefaultEditor

public void setDefaultEditor(EditorDefinition defaultEditor)
Set the default editor.

Parameters:
defaultEditor - the new default editor.

getEditors

public List<EditorDefinition> getEditors()
Getter for the list of all editors.

Returns:
The list of all editors.

load

public void load()
Load the saved data from the plugin's preference store. Usually not necessary as data is loaded on demand.

Specified by:
load in class AbstractManager

save

public void save()
Saves the data inside the manager into the plugin's preference store.

Specified by:
save in class AbstractManager