sk.uniba.euromath.editor.actions
Class AbstractActionContributor

java.lang.Object
  extended by sk.uniba.euromath.editor.actions.AbstractActionContributor
Direct Known Subclasses:
XMLActionContributor, XMLOutlineActionContributor

public abstract class AbstractActionContributor
extends Object

Generic abstract action contributor for ations of type IMultiViewAction interface. Can be used anywhere.

Author:
Tomáš Studva 16.10.2005

Constructor Summary
AbstractActionContributor(IDOMSelectionProvider selectionProvider)
          Constructor.
 
Method Summary
protected  IMultiViewAction checkOrCreateAction(String key)
          Checks for action with id key in registry.
protected  List<IMultiViewAction> checkOrCreateActions(String[] keys)
          Checks for action with id key in registry.
protected abstract  void configureFactory()
          Configures factory.
 MultiViewActionFactory getActionFactory()
           
abstract  org.eclipse.gef.ui.actions.ActionRegistry getActionRegistry()
          Returns action registry in which created actions are registered.
protected  DocumentModifyHelper getDocumentModifyHelper()
          Getter for document modifier.
 List<org.eclipse.gef.ui.actions.SelectionAction> getSelectionActions()
           
abstract  IWorkbenchPart getWorkbenchPart()
          Returns workbench part for which actions are created.
 XMLAccess getXMLAccess()
          Returns XMLAccess instance.
protected  void selectionChangedHandle(DOMSelectionChangedEvent event)
          Handler for selection changes.
 void setActionFactory(MultiViewActionFactory actionFactory)
          Setter for action factory.
 void setSelectionActions(List<org.eclipse.gef.ui.actions.SelectionAction> selectionActions)
           
 void setXMLAccess(XMLAccess xmlAccess)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractActionContributor

public AbstractActionContributor(IDOMSelectionProvider selectionProvider)
Constructor.

Parameters:
selectionProvider - selection provider
Method Detail

selectionChangedHandle

protected void selectionChangedHandle(DOMSelectionChangedEvent event)
Handler for selection changes. Updates all selection actions.

Parameters:
event -

configureFactory

protected abstract void configureFactory()
Configures factory. Registers action in factory by their ids to their classes.


checkOrCreateAction

protected IMultiViewAction checkOrCreateAction(String key)
Checks for action with id key in registry. If exist - is registered, than is returned. Otherwise is created by action factory. SelectionActions are added to selectionAction list for selection change update.

Parameters:
key - to identify action, must be IAction.getId()
Returns:
desired action

checkOrCreateActions

protected List<IMultiViewAction> checkOrCreateActions(String[] keys)
Checks for action with id key in registry. If is registered, than is added to result list. Otherwise is created by action factory and added to result list.

Parameters:
keys - to identify action, must be IAction.getId()
Returns:
desired actions

getDocumentModifyHelper

protected DocumentModifyHelper getDocumentModifyHelper()
Getter for document modifier.

Returns:
document modifier.

setXMLAccess

public void setXMLAccess(XMLAccess xmlAccess)
Parameters:
xmlAccess - The xmlAccess to set.

getXMLAccess

public XMLAccess getXMLAccess()
Returns XMLAccess instance.

Returns:
XMLAccess instance

getActionFactory

public MultiViewActionFactory getActionFactory()
Returns:
Returns the xmlActionFactory.

setActionFactory

public void setActionFactory(MultiViewActionFactory actionFactory)
Setter for action factory.

Parameters:
actionFactory - to set.

getSelectionActions

public List<org.eclipse.gef.ui.actions.SelectionAction> getSelectionActions()
Returns:
Returns the selectionActions.

setSelectionActions

public void setSelectionActions(List<org.eclipse.gef.ui.actions.SelectionAction> selectionActions)
Parameters:
selectionActions - The updateActions to set.

getWorkbenchPart

public abstract IWorkbenchPart getWorkbenchPart()
Returns workbench part for which actions are created.

Returns:
workbech part

getActionRegistry

public abstract org.eclipse.gef.ui.actions.ActionRegistry getActionRegistry()
Returns action registry in which created actions are registered.

Returns:
action registry


Copyright © 2003-2006 null. All Rights Reserved.