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:
org.eclipse.gef.commands.CommandStackEventListener, IActionContributor, IDOMSelectionChangedListener
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

Field Summary
protected  EMMenuManager attributeMenu
          Insert attribute submenu manager.
protected  EMMenuManager contextMenu
          Menu mamager for context menu.
protected  EMMenuManager insertAfterMenu
          Insert after submenu manager.
protected  EMMenuManager insertBeforeMenu
          Insert before submenu manager.
protected  EMMenuManager insertChildMenu
          Insert child submenu manager.
 
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.
 EditorSite getEditorSite()
           
 Map<String,IAction> getGlobalActionHandlers()
          Return global action handlers, which are registred when associated IEditor is gains focus and removed when losts focus;
 org.eclipse.gef.ui.actions.ActionRegistry getGlobalActionRegistry()
          Global registry for all IEditors.
 org.eclipse.gef.GraphicalViewer getGraphicalViewer()
           
 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 populateElementMenu(IMenuManager manager)
          Fills up element menu to right content.
protected  void populateInsertPositionMenu(IMenuManager manager, InsertPosition position)
          Fills up insert before/child/after/ at caret 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, dispose, getActionFactory, getDocumentModifyHelper, getXMLAccess, selectionChanged, setActionFactory, setXMLAccess, stackChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contextMenu

protected EMMenuManager contextMenu
Menu mamager for context menu.


insertBeforeMenu

protected EMMenuManager insertBeforeMenu
Insert before submenu manager.


insertChildMenu

protected EMMenuManager insertChildMenu
Insert child submenu manager.


insertAfterMenu

protected EMMenuManager insertAfterMenu
Insert after submenu manager.


attributeMenu

protected EMMenuManager attributeMenu
Insert attribute submenu manager.

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

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,
                                          InsertPosition position)
Fills up insert before/child/after/ at caret menu to right content. Insert menu must be empty prior.

Parameters:
manager - of insert before menu
position - any of InsertPosition

populateAttributeMenu

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

Parameters:
manager - of attribute menu

getGlobalActionHandlers

public Map<String,IAction> getGlobalActionHandlers()
Description copied from interface: IActionContributor
Return global action handlers, which are registred when associated IEditor is gains focus and removed when losts focus;

Specified by:
getGlobalActionHandlers in interface IActionContributor
Returns:
Map

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


Copyright © 2003-2006 null. All Rights Reserved.