Class TreeMasterDetailMenuListener

  • All Implemented Interfaces:
    org.eclipse.jface.action.IMenuListener
    Direct Known Subclasses:
    EcoreEditorMenuListener

    public class TreeMasterDetailMenuListener
    extends java.lang.Object
    implements org.eclipse.jface.action.IMenuListener
    Menu listener added on the tree master detail.
    Author:
    Clemens Elflein
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TreeMasterDetailMenuListener

        public TreeMasterDetailMenuListener​(ChildrenDescriptorCollector childrenDescriptorCollector,
                                            org.eclipse.jface.action.MenuManager menuMgr,
                                            org.eclipse.jface.viewers.TreeViewer treeViewer,
                                            org.eclipse.emf.edit.domain.EditingDomain editingDomain,
                                            java.util.Collection<MasterDetailAction> rightClickActions,
                                            CreateElementCallback createElementCallback,
                                            DeleteActionBuilder deleteActionBuilder)
        Default constructor.
        Parameters:
        childrenDescriptorCollector - the child description collector
        menuMgr - the menu manager
        treeViewer - the treeviewer
        editingDomain - the editing domain
        rightClickActions - the right click actions to show
        createElementCallback - the create element callback
        deleteActionBuilder - the delete action builder
        Since:
        1.8
    • Method Detail

      • menuAboutToShow

        public void menuAboutToShow​(org.eclipse.jface.action.IMenuManager manager)
        Specified by:
        menuAboutToShow in interface org.eclipse.jface.action.IMenuListener
      • createCreateChildAction

        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. Subclasses might override this to customize the action creation (e.g. an action's label).
        Parameters:
        domain - The EditingDomain the element is be created with
        eObject - The parent object the element is added to
        cp - The CommandParameter creating the element when executed
        Returns:
        The action creating a new child when ran
        Since:
        1.20
      • filterDescriptor

        protected boolean filterDescriptor​(org.eclipse.emf.edit.command.CommandParameter cp)
        Allows to prevent adding a create child action for the given CommandParameter.
        Parameters:
        cp - the descriptor
        Returns:
        true if action should be filtered (=not created), false otherwise
        Since:
        1.8