sk.uniba.euromath.editor.xmlEditor.actions
Class XMLActionContributor

java.lang.Object
  extended by sk.uniba.euromath.editor.actions.AbstractActionContributor
      extended by sk.uniba.euromath.editor.xmlEditor.actions.XMLActionContributor
All Implemented Interfaces:
IActionContributor
Direct Known Subclasses:
TextActionContributor

public class XMLActionContributor
extends AbstractActionContributor
implements IActionContributor

Contributor for XMLEditor. Creates and fills context menu with actions for selecting and editing.

Author:
Tomáš Studva Sep 19, 2005

Constructor Summary
XMLActionContributor(EditorSite site, org.eclipse.gef.GraphicalViewer viewer)
          Constructor.
 
Method Summary
protected  void configureFactory()
          Configures factory.
 void contributeCoolBar(ICoolBarManager manager)
          Contribute to global cool bar by modifying passed manager.
protected  void contributeToContextMenu(IMenuManager manager)
          Fills context menu.
 void contributeToMenu(IMenuManager manager)
          Contribute to global menu by modifying passed manager.
 void contributeToStatusLine(IStatusLineManager manager)
          Contribute to status line by modifying passed manager.
 void contributeToToolBar(IToolBarManager manager)
          Contribute to global tool bar by modifying passed manager.
protected  void createContextMenu()
          Creates context menu on GraphicalViewer's control.
 org.eclipse.gef.ui.actions.ActionRegistry getActionRegistry()
          Returns action registry in which created actions are registered.
protected  EMMenuManager getAttributeMenu()
           
protected  EMMenuManager getContextMenuManager()
           
protected  EMMenuManager getDeleteMenu()
           
 EditorSite getEditorSite()
           
 org.eclipse.gef.ui.actions.ActionRegistry getGlobalActionRegistry()
          Global registry for all IEditors.
 org.eclipse.gef.GraphicalViewer getGraphicalViewer()
           
protected  EMMenuManager getInsertAfterMenu()
           
protected  EMMenuManager getInsertBeforeMenu()
           
protected  EMMenuManager getInsertChildMenu()
           
 IWorkbenchPart getWorkbenchPart()
          Returns workbench part for which actions are created.
 void init(org.eclipse.gef.ui.actions.ActionRegistry actionRegistry)
          Initialization of this contributor with access to global registry.
protected  void populateAttributeMenu(IMenuManager manager)
          Fills up attribute menu to right content.
protected  void populateDeleteMenu(IMenuManager manager)
          Fills delete menu with actions.
protected  void populateElementMenu(IMenuManager manager)
          Fills up element menu to right content.
protected  void populateInsertPositionMenu(IMenuManager manager, short position)
          Fills up insert before/child/after menu to right content.
 void setEditorSite(EditorSite editorSite)
           
 void setGlobalActionRegistry(org.eclipse.gef.ui.actions.ActionRegistry globalActionRegistry)
           
 void setGraphicalViewer(org.eclipse.gef.GraphicalViewer graphicalViewer)
           
 
Methods inherited from class sk.uniba.euromath.editor.actions.AbstractActionContributor
checkOrCreateAction, checkOrCreateActions, getActionFactory, getDocumentModifyHelper, getSelectionActions, getXMLAccess, selectionChangedHandle, setActionFactory, setSelectionActions, setXMLAccess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLActionContributor

public XMLActionContributor(EditorSite site,
                            org.eclipse.gef.GraphicalViewer viewer)
Constructor.

Parameters:
site - EditorSite instance
viewer - GraphicalViewer from XMLEditor, to which this contributor contributes context menu
Method Detail

configureFactory

protected void configureFactory()
Description copied from class: AbstractActionContributor
Configures factory. Registers action in factory by their ids to their classes.

Specified by:
configureFactory in class AbstractActionContributor

createContextMenu

protected void createContextMenu()
Creates context menu on GraphicalViewer's control.


init

public void init(org.eclipse.gef.ui.actions.ActionRegistry actionRegistry)
Initialization of this contributor with access to global registry.

Specified by:
init in interface IActionContributor
Parameters:
actionRegistry - global action registry

populateDeleteMenu

protected void populateDeleteMenu(IMenuManager manager)
Fills delete menu with actions. In this case delete menu is filled only in init.

Parameters:
manager - deleteMenu manager

contributeToToolBar

public void contributeToToolBar(IToolBarManager manager)
Description copied from interface: IActionContributor
Contribute to global tool bar by modifying passed manager.

Specified by:
contributeToToolBar in interface IActionContributor

contributeToStatusLine

public void contributeToStatusLine(IStatusLineManager manager)
Description copied from interface: IActionContributor
Contribute to status line by modifying passed manager.

Specified by:
contributeToStatusLine in interface IActionContributor

contributeCoolBar

public void contributeCoolBar(ICoolBarManager manager)
Description copied from interface: IActionContributor
Contribute to global cool bar by modifying passed manager.

Specified by:
contributeCoolBar in interface IActionContributor

contributeToMenu

public void contributeToMenu(IMenuManager manager)
Description copied from interface: IActionContributor
Contribute to global menu by modifying passed manager.

Specified by:
contributeToMenu in interface IActionContributor

contributeToContextMenu

protected void contributeToContextMenu(IMenuManager manager)
Fills context menu.

Parameters:
manager -

populateElementMenu

protected void populateElementMenu(IMenuManager manager)
Fills up element menu to right content. Prior element menu must be empty.

Parameters:
manager - of element menu

populateInsertPositionMenu

protected void populateInsertPositionMenu(IMenuManager manager,
                                          short position)
Fills up insert before/child/after menu to right content. Insert menu must be empty prior.

Parameters:
manager - of insert before menu
position - one of ActionConsts#BEFORE/ActionConsts#CHILD/ActionConsts#AFTER

populateAttributeMenu

protected void populateAttributeMenu(IMenuManager manager)
Fills up attribute menu to right content. Prior attribute menu must be empty.

Parameters:
manager - of attribute menu

getGlobalActionRegistry

public org.eclipse.gef.ui.actions.ActionRegistry getGlobalActionRegistry()
Global registry for all IEditors.

Specified by:
getGlobalActionRegistry in interface IActionContributor
Returns:
action registry
See Also:
IActionContributor.init(ActionRegistry)

getEditorSite

public EditorSite getEditorSite()
Returns:
Returns the editorSite.

setEditorSite

public void setEditorSite(EditorSite editorSite)
Parameters:
editorSite - The editorSite to set.

getGraphicalViewer

public org.eclipse.gef.GraphicalViewer getGraphicalViewer()
Returns:
Returns the graphicalViewer.

setGraphicalViewer

public void setGraphicalViewer(org.eclipse.gef.GraphicalViewer graphicalViewer)
Parameters:
graphicalViewer - The graphicalViewer to set.

setGlobalActionRegistry

public void setGlobalActionRegistry(org.eclipse.gef.ui.actions.ActionRegistry globalActionRegistry)
Parameters:
globalActionRegistry - The globalActionRegistry to set.

getWorkbenchPart

public IWorkbenchPart getWorkbenchPart()
Description copied from class: AbstractActionContributor
Returns workbench part for which actions are created.

Specified by:
getWorkbenchPart in class AbstractActionContributor
Returns:
workbech part

getActionRegistry

public org.eclipse.gef.ui.actions.ActionRegistry getActionRegistry()
Description copied from class: AbstractActionContributor
Returns action registry in which created actions are registered.

Specified by:
getActionRegistry in class AbstractActionContributor
Returns:
action registry

getAttributeMenu

protected EMMenuManager getAttributeMenu()
Returns:
Returns the attributeMenu.

getContextMenuManager

protected EMMenuManager getContextMenuManager()
Returns:
Returns the contextMenuManager.

getDeleteMenu

protected EMMenuManager getDeleteMenu()
Returns:
Returns the deleteMenu.

getInsertAfterMenu

protected EMMenuManager getInsertAfterMenu()
Returns:
Returns the insertAfterMenu.

getInsertBeforeMenu

protected EMMenuManager getInsertBeforeMenu()
Returns:
Returns the insertBeforeMenu.

getInsertChildMenu

protected EMMenuManager getInsertChildMenu()
Returns:
Returns the insertChildMenu.


Copyright © 2003-2006 null. All Rights Reserved.