@Override
  public void buildContextMenu(IMenuManager menu) {
    final MenuManager createMenuManager =
        new MenuManager("New", "com.mentor.nucleus.bp.ui.newroot"); // $NON-NLS-2$
    final MenuManager openMenuManager =
        new MenuManager("Open With", "com.mentor.nucleus.bp.ui.openroot"); // $NON-NLS-2$
    final MenuManager classesMenu =
        new MenuManager("Classes", "com.mentor.nucleus.bp.ui.classroot"); // $NON-NLS-2$
    final MenuManager componentsMenu =
        new MenuManager("Components", "com.mentor.nucleus.bp.ui.componentroot"); // $NON-NLS-2$
    final MenuManager externalMenu =
        new MenuManager("External", "com.mentor.nucleus.bp.ui.externalroot"); // $NON-NLS-2$
    final MenuManager interactionMenu =
        new MenuManager("Interaction", "com.mentor.nucleus.bp.ui.interactionroot"); // $NON-NLS-2$
    final MenuManager activityMenu =
        new MenuManager("Activity", "com.mentor.nucleus.bp.ui.activityroot"); // $NON-NLS-2$
    final MenuManager typesMenu =
        new MenuManager("Types", "com.mentor.nucleus.bp.ui.typeroot"); // $NON-NLS-2$
    final MenuManager useCaseMenu =
        new MenuManager("Usecase", "com.mentor.nucleus.bp.ui.usecaseroot"); // $NON-NLS-2$

    menu.add(createMenuManager);
    createMenuManager.removeAll();
    createMenuManager.add(new GroupMarker("com.mentor.nucleus.bp.ui.newmenu")); // $NON-NLS-1$

    createMenuManager.add(activityMenu);
    activityMenu.removeAll();
    activityMenu.add(new GroupMarker("com.mentor.nucleus.bp.ui.newactivitymenu"));

    createMenuManager.add(classesMenu);
    classesMenu.removeAll();
    classesMenu.add(new GroupMarker("com.mentor.nucleus.bp.ui.newclassmenu"));

    createMenuManager.add(componentsMenu);
    componentsMenu.removeAll();
    componentsMenu.add(new GroupMarker("com.mentor.nucleus.bp.ui.newcomponentmenu"));

    createMenuManager.add(externalMenu);
    externalMenu.removeAll();
    externalMenu.add(new GroupMarker("com.mentor.nucleus.bp.ui.newexternalmenu"));

    createMenuManager.add(interactionMenu);
    interactionMenu.removeAll();
    interactionMenu.add(new GroupMarker("com.mentor.nucleus.bp.ui.newinteractionmenu"));

    createMenuManager.add(typesMenu);
    typesMenu.removeAll();
    typesMenu.add(new GroupMarker("com.mentor.nucleus.bp.ui.newtypemenu"));

    createMenuManager.add(useCaseMenu);
    useCaseMenu.removeAll();
    useCaseMenu.add(new GroupMarker("com.mentor.nucleus.bp.ui.newusecasemenu"));

    menu.add(fEditor.getOpenAction());
    menu.add(openMenuManager);
    openMenuManager.removeAll();
    openMenuManager.add(new GroupMarker("com.mentor.nucleus.bp.ui.openmenu")); // $NON-NLS-1$
    menu.add(new Separator("com.mentor.nucleus.bp.ui.context-internal")); // $NON-NLS-1$
    menu.add(new Separator("com.mentor.nucleus.bp.ui.context-internal-end")); // $NON-NLS-1$
    menu.add(new Separator());
    menu.add(fEditor.getUndoAction());
    menu.add(fEditor.getRedoAction());
    menu.add(new Separator());
    menu.add(fEditor.getCutAction());
    // for some reason we must specifically set enabled here
    fEditor.getCutAction().setEnabled(fEditor.getCutAction().isEnabled());
    menu.add(fEditor.getCopyAction());
    fEditor.getCopyAction().setEnabled(fEditor.getCopyAction().isEnabled());

    menu.add(fEditor.getPasteAction());
    fEditor.getPasteAction().setEnabled(fEditor.getPasteAction().isEnabled());
    menu.add(new Separator());
    menu.add(fEditor.getSelectAllAction());
    fEditor
        .getDeleteAction()
        .setEnabled(
            enableDelete(
                (IStructuredSelection) fEditor.getSite().getSelectionProvider().getSelection()));
    menu.add(fEditor.getDeleteAction());
    fEditor.getRenameAction().setEnabled(RenameAction.canRenameAction());
    menu.add(fEditor.getRenameAction());
    menu.add(new Separator());
    menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    menu.add(new Separator());
    menu.add(CorePlugin.getResourceImportAction());
    menu.add(CorePlugin.getResourceExportAction());
  }
 private void createActions() {
   expandAll = new ExpandAllAction(this);
   expandAll.setText("Expand All"); // $NON-NLS-1$
   collapseAll = new CollapseAllAction(this);
   collapseAll.setText("Collapse All"); // $NON-NLS-1$
   open =
       new Action(OPEN) {
         public void run() {
           handleOpen();
         }
       };
   open.setText("Open");
   open.setToolTipText("Open this model Element");
   cut = new ExplorerCutAction(this);
   copy = new ExplorerCopyAction(this);
   paste = new ExplorerPasteAction();
   moveUp = new MoveUpAction(this);
   moveUp.setText("Move Up");
   moveDown = new MoveDownAction(this);
   moveDown.setText("Move Down");
   // Delete and Rename are retargetable actions defined by core.
   //
   //		delete = new DeleteAction(CorePlugin.getImageDescriptor("delete_edit.gif")) { //$NON-NLS-1$
   //
   // @Override
   // public void run() {
   // Transaction transaction = mergeViewer
   // .getCompareTransactionManager()
   // .startCompareTransaction();
   // super.run();
   // mergeViewer.getCompareTransactionManager().endTransaction(
   // transaction);
   // mergeViewer
   // .markLeftDirty(SynchronizedTreeViewer.this == mergeViewer
   // .getLeftViewer());
   // mergeViewer
   // .markRightDirty(SynchronizedTreeViewer.this == mergeViewer
   // .getRightViewer());
   // }
   //
   // };
   // ((DeleteAction) delete).setStartTransaction(false);
   // rename = new RenameAction(this) {
   //
   // @Override
   // public void saveChangesAndDispose(Object selection) {
   // final Transaction transaction = mergeViewer
   // .getCompareTransactionManager()
   // .startCompareTransaction();
   // super.saveChangesAndDispose(selection);
   // // need to wait on rename as it is asynchronously called
   // PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
   //
   // @Override
   // public void run() {
   // mergeViewer.getCompareTransactionManager().endTransaction(
   // transaction);
   // mergeViewer
   // .markLeftDirty(SynchronizedTreeViewer.this == mergeViewer
   // .getLeftViewer());
   // mergeViewer
   // .markRightDirty(SynchronizedTreeViewer.this == mergeViewer
   // .getRightViewer());
   // }
   // });
   // }
   //
   // };
   //
   fileImport = CorePlugin.getResourceImportAction();
   fileExport = CorePlugin.getResourceExportAction();
 }