public class TreeMasterDetailMenuListener extends Object implements org.eclipse.jface.action.IMenuListener
Menu listener
added on the tree master detail.Constructor and Description |
---|
TreeMasterDetailMenuListener(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,
DeleteActionBuilder deleteActionBuilder)
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 . |
void |
menuAboutToShow(org.eclipse.jface.action.IMenuManager manager) |
public TreeMasterDetailMenuListener(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, DeleteActionBuilder deleteActionBuilder)
childrenDescriptorCollector
- the child description collectormenuMgr
- the menu managertreeViewer
- the treeviewereditingDomain
- the editing domainrightClickActions
- the right click actions to showcreateElementCallback
- the create element callbackdeleteActionBuilder
- the delete action builderpublic void menuAboutToShow(org.eclipse.jface.action.IMenuManager manager)
menuAboutToShow
in interface org.eclipse.jface.action.IMenuListener
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)
CommandParameter
. Subclasses might override this
to customize the action creation (e.g. an action's label).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)
CommandParameter
.cp
- the descriptortrue
if action should be filtered (=not created), false
otherwiseCopyright © 2019. All rights reserved.