org.eclipse.weaver.editors
Class GlobalWeaverEditorContributor

java.lang.Object
  extended by org.eclipse.ui.part.EditorActionBarContributor
      extended by org.eclipse.ui.part.MultiPageEditorActionBarContributor
          extended by org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor
              extended by org.eclipse.weaver.editors.GlobalWeaverEditorContributor
All Implemented Interfaces:
org.eclipse.jface.action.IMenuListener, org.eclipse.jface.viewers.ISelectionChangedListener, org.eclipse.ui.IEditorActionBarContributor, org.eclipse.ui.IPropertyListener

public class GlobalWeaverEditorContributor
extends org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor
implements org.eclipse.jface.viewers.ISelectionChangedListener

Manages the installation/deinstallation of global actions for multi-page editors. Responsible for the redirection of global actions to the active editor. Multi-page contributor replaces the contributors for the individual editors in the multi-page editor.

Since:
1.0
Author:
- Marcos Didonet Del Fabro (LINA Labs, INRIA team)
- Guillaume Gueltas (Sodifrance)

Field Summary
protected  org.eclipse.ui.IEditorPart activeEditorPart
           
protected  java.util.Collection createChildActions
           
protected  org.eclipse.jface.action.IMenuManager createChildMenuManager
           
protected  java.util.Collection createSiblingActions
           
protected  org.eclipse.jface.action.IMenuManager createSiblingMenuManager
           
protected  org.eclipse.jface.action.IAction executeGeneralMatch
           
protected  org.eclipse.jface.action.IAction saveEcoreMetamodelAction
          Action to save the weaving metamodel as ecore
protected  org.eclipse.jface.action.IAction saveKm3MetamodelAction
          Action to save the weaving metamodel as ecore
protected  org.eclipse.jface.viewers.ISelectionProvider selectionProvider
           
protected  org.eclipse.jface.action.IAction setParentNameAction
          Action to set the parent name equals to the selected child
protected  org.eclipse.jface.action.IAction showPropertiesViewAction
          Action for display the property view
protected  IWeaverMenuAdapter wMenuAdapter
           
 
Fields inherited from class org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor
activeEditor, ADDITIONS_LAST_STYLE, controlAction, copyAction, cutAction, deleteAction, loadResourceAction, pasteAction, redoAction, style, undoAction, validateAction
 
Constructor Summary
GlobalWeaverEditorContributor()
          This creates an instance the contributor.
 
Method Summary
protected  void addGlobalActions(org.eclipse.jface.action.IMenuManager menuManager)
          This inserts global actions before the "additions-end" separator.
 void contributeToMenu(org.eclipse.jface.action.IMenuManager menuManager)
           
protected  void createAction(TransformationConfig tc, org.eclipse.jface.action.IMenuManager menuManager)
           
protected  void depopulateManager(org.eclipse.jface.action.IContributionManager manager, java.util.Collection actions)
          This removes from the specified manager all ActionContributionItems based on the IActions contained in the actions collection
protected  java.util.Collection generateCreateChildActions(java.util.Collection descriptors, org.eclipse.jface.viewers.ISelection selection)
          This generates a CreateChildAction for each object in descriptors, and returns the collection of these actions.
protected  java.util.Collection generateCreateSiblingActions(java.util.Collection descriptors, org.eclipse.jface.viewers.ISelection selection)
          This generates a CreateSiblingAction for each object in descriptors, and returns the collection of these actions.
 void menuAboutToShow(org.eclipse.jface.action.IMenuManager menuManager)
          This populates the pop-up menu before it appears
protected  void populateManager(org.eclipse.jface.action.IContributionManager manager, java.util.Collection actions, java.lang.String contributionID)
          This populates the specified manager with ActionContributionItems based on the IActions contained in the actions collection, by inserting them before the specified contribution item contributionID.
 void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
           
 void setActiveEditor(org.eclipse.ui.IEditorPart part)
           
 
Methods inherited from class org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor
activate, contributeToStatusLine, contributeToToolBar, deactivate, getActiveEditor, init, propertyChanged, removeAllReferencesOnDelete, setActivePage, setActiveView, shareGlobalActions, update
 
Methods inherited from class org.eclipse.ui.part.EditorActionBarContributor
contributeToCoolBar, dispose, getActionBars, getPage, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

activeEditorPart

protected org.eclipse.ui.IEditorPart activeEditorPart

selectionProvider

protected org.eclipse.jface.viewers.ISelectionProvider selectionProvider

createChildActions

protected java.util.Collection createChildActions

createChildMenuManager

protected org.eclipse.jface.action.IMenuManager createChildMenuManager

createSiblingActions

protected java.util.Collection createSiblingActions

createSiblingMenuManager

protected org.eclipse.jface.action.IMenuManager createSiblingMenuManager

wMenuAdapter

protected IWeaverMenuAdapter wMenuAdapter

showPropertiesViewAction

protected org.eclipse.jface.action.IAction showPropertiesViewAction
Action for display the property view


setParentNameAction

protected org.eclipse.jface.action.IAction setParentNameAction
Action to set the parent name equals to the selected child


saveKm3MetamodelAction

protected org.eclipse.jface.action.IAction saveKm3MetamodelAction
Action to save the weaving metamodel as ecore


saveEcoreMetamodelAction

protected org.eclipse.jface.action.IAction saveEcoreMetamodelAction
Action to save the weaving metamodel as ecore


executeGeneralMatch

protected org.eclipse.jface.action.IAction executeGeneralMatch
Constructor Detail

GlobalWeaverEditorContributor

public GlobalWeaverEditorContributor()
This creates an instance the contributor.

Method Detail

setActiveEditor

public void setActiveEditor(org.eclipse.ui.IEditorPart part)
Specified by:
setActiveEditor in interface org.eclipse.ui.IEditorActionBarContributor
Overrides:
setActiveEditor in class org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor

contributeToMenu

public void contributeToMenu(org.eclipse.jface.action.IMenuManager menuManager)
Overrides:
contributeToMenu in class org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor

selectionChanged

public void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
Specified by:
selectionChanged in interface org.eclipse.jface.viewers.ISelectionChangedListener

depopulateManager

protected void depopulateManager(org.eclipse.jface.action.IContributionManager manager,
                                 java.util.Collection actions)
This removes from the specified manager all ActionContributionItems based on the IActions contained in the actions collection

Parameters:
manager -
actions -
contributionID -

populateManager

protected void populateManager(org.eclipse.jface.action.IContributionManager manager,
                               java.util.Collection actions,
                               java.lang.String contributionID)
This populates the specified manager with ActionContributionItems based on the IActions contained in the actions collection, by inserting them before the specified contribution item contributionID. If ID is null, they are simply added.

Parameters:
manager -
actions -
contributionID -

menuAboutToShow

public void menuAboutToShow(org.eclipse.jface.action.IMenuManager menuManager)
This populates the pop-up menu before it appears

Specified by:
menuAboutToShow in interface org.eclipse.jface.action.IMenuListener
Overrides:
menuAboutToShow in class org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor
Parameters:
menuManager -

addGlobalActions

protected void addGlobalActions(org.eclipse.jface.action.IMenuManager menuManager)
This inserts global actions before the "additions-end" separator.

Overrides:
addGlobalActions in class org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor
Parameters:
menuManager -

createAction

protected void createAction(TransformationConfig tc,
                            org.eclipse.jface.action.IMenuManager menuManager)

generateCreateChildActions

protected java.util.Collection generateCreateChildActions(java.util.Collection descriptors,
                                                          org.eclipse.jface.viewers.ISelection selection)
This generates a CreateChildAction for each object in descriptors, and returns the collection of these actions.

Parameters:
descriptors -
selection -
Returns:

generateCreateSiblingActions

protected java.util.Collection generateCreateSiblingActions(java.util.Collection descriptors,
                                                            org.eclipse.jface.viewers.ISelection selection)
This generates a CreateSiblingAction for each object in descriptors, and returns the collection of these actions.

Parameters:
descriptors -
selection -
Returns: