sk.uniba.euromath.editor.actions
Class MultiViewActionFactory

java.lang.Object
  extended by sk.uniba.euromath.editor.actions.MultiViewActionFactory

public class MultiViewActionFactory
extends Object

Author:
Tomáš Studva 28.11.2005

Field Summary
protected  Map<String,Class<? extends IMultiViewAction>> actionClasses
          Map holding registered action classes.
 
Constructor Summary
MultiViewActionFactory()
          Contructor.
 
Method Summary
 IMultiViewAction createAction(Class<? extends IMultiViewAction> clz)
          Creates instance of action.
 IMultiViewAction createAction(String key, IWorkbenchPart part)
          Creates instance of action.
protected  List<IMultiViewAction> createActions(String[] ids, IWorkbenchPart part)
          Creates list of instances of actions.
protected  Class<? extends IMultiViewAction> getActionClass(String key)
          Returns CLass registered in this factory.
 Map<String,Class<? extends IMultiViewAction>> getActionClasses()
           
 void registerAction(String id, Class<? extends IMultiViewAction> cls)
          Registers action id to class for creation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

actionClasses

protected final Map<String,Class<? extends IMultiViewAction>> actionClasses
Map holding registered action classes.

Constructor Detail

MultiViewActionFactory

public MultiViewActionFactory()
Contructor.

Method Detail

getActionClass

protected Class<? extends IMultiViewAction> getActionClass(String key)
Returns CLass registered in this factory.

Parameters:
key - registration key
Returns:
Class of action registered under key key

createAction

public IMultiViewAction createAction(Class<? extends IMultiViewAction> clz)
Creates instance of action.

Parameters:
clz - of action
Returns:
new instance IMultiViewAction of class clz

createAction

public IMultiViewAction createAction(String key,
                                     IWorkbenchPart part)
Creates instance of action. Sets workbench for it.

Parameters:
key - of action to create, by which is registered in factory.
part - workbench part to be set to created action
Returns:
new instance of class registered under key key.

createActions

protected List<IMultiViewAction> createActions(String[] ids,
                                               IWorkbenchPart part)
Creates list of instances of actions. Action classes are specified by ids. Sets workbench for them.

Parameters:
ids - of actions to create, by which are registered in factory.
part - workbench part to be set to created action
Returns:
List of newly created actions specified by ids

registerAction

public void registerAction(String id,
                           Class<? extends IMultiViewAction> cls)
Registers action id to class for creation. If for id is already another action class registered, throws IllegalArgumentException.

Parameters:
id - id of action
cls - class of action, must extends IMultiViewAction class

getActionClasses

public Map<String,Class<? extends IMultiViewAction>> getActionClasses()
Returns:
Returns the actionClasses.


Copyright © 2003-2006 null. All Rights Reserved.