Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[Dltk-dev] OutlineView popup menu.

Hi,

i think i asked this before at one point, dont know when but in my code i enabled the popup menu
from the ScriptOutlinePage, see patch below

I can enable it again ofcourse, works for use just fine, we want to contribute an item to it.
But why was it disabled in the first place? Is there somehow a problem with it?

johan


### Eclipse Workspace Patch 1.0
#P org.eclipse.dltk.ui
Index: src/org/eclipse/dltk/internal/ui/editor/ScriptOutlinePage.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.dltk/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/editor/ScriptOutlinePage.java,v
retrieving revision 1.9
diff -u -r1.9 ScriptOutlinePage.java
--- src/org/eclipse/dltk/internal/ui/editor/ScriptOutlinePage.java    27 Feb 2008 11:51:34 -0000    1.9
+++ src/org/eclipse/dltk/internal/ui/editor/ScriptOutlinePage.java    29 Apr 2008 14:24:18 -0000
@@ -56,9 +56,11 @@
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.GroupMarker;
 import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuListener;
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.action.IStatusLineManager;
 import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.action.Separator;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.text.ITextSelection;
@@ -983,7 +985,7 @@
             // menu.add(new Separator(IContextMenuConstants.GROUP_GENERATE));
             menu.add(new Separator(IContextMenuConstants.GROUP_SEARCH));
             // menu.add(new Separator(IContextMenuConstants.GROUP_BUILD));
-            // menu.add(new Separator(IContextMenuConstants.GROUP_ADDITIONS));
+            menu.add(new Separator(IContextMenuConstants.GROUP_ADDITIONS));
             // menu.add(new
             // Separator(IContextMenuConstants.GROUP_VIEWER_SETUP));
             menu.add(new Separator(IContextMenuConstants.GROUP_PROPERTIES));
@@ -1036,22 +1038,18 @@
                     .addPostSelectionChangedListener((ISelectionChangedListener) listeners[i]);
         }
 
-        // MenuManager manager = new MenuManager(fContextMenuID,
-        // fContextMenuID);
-        // manager.setRemoveAllWhenShown(true);
-        // manager.addMenuListener(new IMenuListener() {
-        // public void menuAboutToShow(IMenuManager m) {
-        // contextMenuAboutToShow(m);
-        // }
-        // });
-        // fMenu = manager.createContextMenu(tree);
-        // tree.setMenu(fMenu);
+         MenuManager manager = new MenuManager(DLTKUIPlugin.getPluginId() + ".outline",DLTKUIPlugin.getPluginId() + ".outline");
+         manager.setRemoveAllWhenShown(true);
+         manager.addMenuListener(new IMenuListener() {
+         public void menuAboutToShow(IMenuManager m) {
+         contextMenuAboutToShow(m);
+         }
+         });
+         fMenu = manager.createContextMenu(tree);
+         tree.setMenu(fMenu);
 
         IPageSite site = getSite();
-        // site
-        // .registerContextMenu(
-        // DLTKUIPlugin.getPluginId() + ".outline", manager, fOutlineViewer);
-        // //$NON-NLS-1$
+        site.registerContextMenu(DLTKUIPlugin.getPluginId() + ".outline", manager, fOutlineViewer); //$NON-NLS-1$
 
         updateSelectionProvider(site);
 


Back to the top