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 XMLAccessModifyAction>> actionClasses
          Map holding registered action classes.
 
Constructor Summary
MultiViewActionFactory()
          Contructor.
 
Method Summary
 XMLAccessModifyAction createAction(Class<? extends XMLAccessModifyAction> clz, IWorkbenchPart part)
          Creates instance of action.
 XMLAccessModifyAction createAction(String key, IWorkbenchPart part)
          Creates instance of action.
protected  List<XMLAccessModifyAction> createActions(String[] ids, IWorkbenchPart part)
          Creates list of instances of actions.
protected  Class<? extends XMLAccessModifyAction> getActionClass(String key)
          Returns CLass registered in this factory.
 void registerAction(String id, Class<? extends XMLAccessModifyAction> 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 XMLAccessModifyAction>> actionClasses
Map holding registered action classes.

Constructor Detail

MultiViewActionFactory

public MultiViewActionFactory()
Contructor.

Method Detail

getActionClass

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

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

createAction

public XMLAccessModifyAction createAction(Class<? extends XMLAccessModifyAction> clz,
                                          IWorkbenchPart part)
Creates instance of action.

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

createAction

public XMLAccessModifyAction 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<XMLAccessModifyAction> 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 XMLAccessModifyAction> 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


Copyright © 2003-2006 null. All Rights Reserved.