Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'visualizer')
-rwxr-xr-xvisualizer/org.eclipse.cdt.visualizer.ui/META-INF/MANIFEST.MF2
-rw-r--r--visualizer/org.eclipse.cdt.visualizer.ui/pom.xml2
-rw-r--r--visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/VisualizerView.java67
3 files changed, 61 insertions, 10 deletions
diff --git a/visualizer/org.eclipse.cdt.visualizer.ui/META-INF/MANIFEST.MF b/visualizer/org.eclipse.cdt.visualizer.ui/META-INF/MANIFEST.MF
index e000583f504..ef9765a1280 100755
--- a/visualizer/org.eclipse.cdt.visualizer.ui/META-INF/MANIFEST.MF
+++ b/visualizer/org.eclipse.cdt.visualizer.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin.name
Bundle-SymbolicName: org.eclipse.cdt.visualizer.ui;singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.2.0.qualifier
Bundle-Activator: org.eclipse.cdt.visualizer.ui.plugin.CDTVisualizerUIPlugin
Bundle-Vendor: %provider.name
Require-Bundle: org.eclipse.ui,
diff --git a/visualizer/org.eclipse.cdt.visualizer.ui/pom.xml b/visualizer/org.eclipse.cdt.visualizer.ui/pom.xml
index c55e076d135..ad644893461 100644
--- a/visualizer/org.eclipse.cdt.visualizer.ui/pom.xml
+++ b/visualizer/org.eclipse.cdt.visualizer.ui/pom.xml
@@ -11,7 +11,7 @@
<relativePath>../../pom.xml</relativePath>
</parent>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.visualizer.ui</artifactId>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/VisualizerView.java b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/VisualizerView.java
index c9a81be1a2c..9806fc00df3 100644
--- a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/VisualizerView.java
+++ b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/VisualizerView.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Tilera Corporation and others.
+ * Copyright (c) 2012, 2014 Tilera Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
* Contributors:
* William R. Swanson (Tilera Corporation)
* Marc Dumais (Ericsson) - bug 436095
+ * Marc Dumais (Ericsson) - bug 453227
*******************************************************************************/
// Package declaration
@@ -135,6 +136,7 @@ public class VisualizerView
m_viewer.addVisualizerViewerListener(this);
m_viewer.addSelectionChangedListener(this);
updateUI();
+ populateMenu();
}
}
@@ -164,6 +166,9 @@ public class VisualizerView
// set up context menu support
initializeContextMenu();
+ // setup the view menu
+ initializeMenu();
+
// set up selection handling
initializeSelectionHandling();
@@ -355,23 +360,69 @@ public class VisualizerView
toolBarManager.add(m_openNewViewAction);
toolBarManager.update(true);
- // Allow presentation to set the toolbar's menu content, if any
- IMenuManager menuManager = actionBars.getMenuManager();
- menuManager.removeAll();
- m_viewer.populateMenu(menuManager);
- menuManager.update(true);
-
// Note: when context menu is invoked,
- // the poplateContextMenu() method is called by the view,
+ // the populateContextMenu() method is called by the view,
// which in turn delegates to the current visualizer
// to populate the context menu.
+ // Note2: when view menu is invoked,
+ // the populateMenu() method is called by the view,
+ // which in turn delegates to the current visualizer
+ // to populate the view menu.
+
// Propagate the changes
actionBars.updateActionBars();
}
}
+ // --- view menu support ---
+
+ /** Utility method that returns the menu manager for the view menu
+ * @since 1.2*/
+ protected IMenuManager getViewMenuManager() {
+ IActionBars actionBars = getViewSite().getActionBars();
+ return actionBars.getMenuManager();
+ }
+
+ /** Initialize the view menu
+ * @since 1.2*/
+ protected void initializeMenu() {
+ IMenuManager menuManager = getViewMenuManager();
+ menuManager.addMenuListener(new IMenuListener2() {
+ public void menuAboutToShow(IMenuManager m) {
+ viewMenuShow(m);
+ }
+ public void menuAboutToHide(IMenuManager m) {
+ viewMenuHide(m);
+ }
+ });
+ }
+
+ /** Invoked when the viewer is set to do an initial populating of the view
+ * menu. Without this, the view menu would not appear.
+ * @since 1.2*/
+ protected void populateMenu() {
+ IMenuManager menuManager = getViewMenuManager();
+ viewMenuShow(menuManager);
+ }
+
+ /** Invoked when view menu is about to be shown.
+ * @since 1.2*/
+ protected void viewMenuShow(IMenuManager m)
+ {
+ m.removeAll();
+ m_viewer.populateMenu(m);
+ m.update();
+ }
+
+ /** Invoked when view menu is about to be hidden.
+ * @since 1.2*/
+ protected void viewMenuHide(IMenuManager m)
+ {
+ }
+
+
// --- context menu support ---
/** Sets up context menu support. */

Back to the top