public class EcoreEditorMenuListener extends TreeMasterDetailMenuListener
TreeMasterDetailMenuListener
for the Ecore Editor. Filters generic features.Constructor and Description |
---|
EcoreEditorMenuListener(ChildrenDescriptorCollector childrenDescriptorCollector,
org.eclipse.jface.action.MenuManager menuMgr,
org.eclipse.jface.viewers.TreeViewer treeViewer,
org.eclipse.emf.edit.domain.EditingDomain editingDomain,
Collection<MasterDetailAction> rightClickActions,
CreateElementCallback createElementCallback)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected org.eclipse.jface.action.IAction |
createCreateChildAction(org.eclipse.emf.edit.domain.EditingDomain domain,
org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.edit.command.CommandParameter cp)
Creates a new child creation action based on the given
CommandParameter . |
protected boolean |
filterDescriptor(org.eclipse.emf.edit.command.CommandParameter cp)
Allows to prevent adding a create child action for the given
CommandParameter . |
menuAboutToShow
public EcoreEditorMenuListener(ChildrenDescriptorCollector childrenDescriptorCollector, org.eclipse.jface.action.MenuManager menuMgr, org.eclipse.jface.viewers.TreeViewer treeViewer, org.eclipse.emf.edit.domain.EditingDomain editingDomain, Collection<MasterDetailAction> rightClickActions, CreateElementCallback createElementCallback)
childrenDescriptorCollector
- the child description collectormenuMgr
- the menu managertreeViewer
- the treeviewereditingDomain
- the editing domainrightClickActions
- the right click actions to showcreateElementCallback
- the create element callbackprotected org.eclipse.jface.action.IAction createCreateChildAction(org.eclipse.emf.edit.domain.EditingDomain domain, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.edit.command.CommandParameter cp)
TreeMasterDetailMenuListener
CommandParameter
. Subclasses might override this
to customize the action creation (e.g. an action's label).createCreateChildAction
in class TreeMasterDetailMenuListener
domain
- The EditingDomain
the element is be created witheObject
- The parent object the element is added tocp
- The CommandParameter
creating the element when executedprotected boolean filterDescriptor(org.eclipse.emf.edit.command.CommandParameter cp)
TreeMasterDetailMenuListener
CommandParameter
.filterDescriptor
in class TreeMasterDetailMenuListener
cp
- the descriptortrue
if action should be filtered (=not created), false
otherwiseCopyright © 2019. All rights reserved.