ides.api.plugin.presentation
Class ToolsetManager

java.lang.Object
  extended by ides.api.plugin.presentation.ToolsetManager

public class ToolsetManager
extends java.lang.Object

Manager of the Toolsets available to IDES. A plug-in which wants to provide the GUI elements for a specific DESModel perspective, e.g., FSAModel, should register itself for this specific perspective. When the user creates a new model or opens a model, IDES will use the registered Toolset for the model's "main" perspective to obtain the relevant GUI elements.

Author:
Lenko Grigorov
See Also:
Toolset, registerToolset(Class, Toolset)

Field Summary
protected  java.util.Hashtable<java.lang.Class<?>,Toolset> class2Toolset
          The table with the registered Toolsets.
 
Method Summary
 java.lang.Object clone()
           
 Toolset getToolset(java.lang.Class<?> perspective)
          Returns the Toolset registered for the given DESModel perspective.
 Toolset getToolset(DESModel model)
          Returns the Toolset registered for the "main" perspective of the given DESModel.
static ToolsetManager instance()
          Provides access to the instance of the manager.
 void registerToolset(java.lang.Class<?> perspective, Toolset ts)
          Registers a Toolset to handle a specific kind of DESModel perspective.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

class2Toolset

protected java.util.Hashtable<java.lang.Class<?>,Toolset> class2Toolset
The table with the registered Toolsets. The key is a DESModel perspective and the value is the corresponding Toolset.

Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

instance

public static ToolsetManager instance()
Provides access to the instance of the manager.

Returns:
the toolset manager

getToolset

public Toolset getToolset(DESModel model)
Returns the Toolset registered for the "main" perspective of the given DESModel.

Parameters:
model - the DESModel for which a Toolset is needed
Returns:
the Toolset registered for the "main" perspective of the given DESModel; null if no Toolset is registered for this perspective

getToolset

public Toolset getToolset(java.lang.Class<?> perspective)
Returns the Toolset registered for the given DESModel perspective.

Parameters:
perspective - the DESModel perspective for which a Toolset is needed
Returns:
the Toolset registered for the given DESModel perspective; null if no Toolset is registered for this perspective

registerToolset

public void registerToolset(java.lang.Class<?> perspective,
                            Toolset ts)
Registers a Toolset to handle a specific kind of DESModel perspective.

Parameters:
perspective - the DESModel perspective which will be handled by the Toolset
ts - the Toolset to handle the given DESModel perspective