diff --git a/cave/com.raytheon.uf.viz.d2d.ui/plugin.xml b/cave/com.raytheon.uf.viz.d2d.ui/plugin.xml
index 5dd403a1b2..2d363f2a90 100644
--- a/cave/com.raytheon.uf.viz.d2d.ui/plugin.xml
+++ b/cave/com.raytheon.uf.viz.d2d.ui/plugin.xml
@@ -2170,4 +2170,11 @@
value="purge">
+
+
+
+
diff --git a/cave/com.raytheon.uf.viz.ui.menus/plugin.xml b/cave/com.raytheon.uf.viz.ui.menus/plugin.xml
index 21f28a2f0d..a9cb64e917 100644
--- a/cave/com.raytheon.uf.viz.ui.menus/plugin.xml
+++ b/cave/com.raytheon.uf.viz.ui.menus/plugin.xml
@@ -1,6 +1,7 @@
+
+
+
+
+
+
+
+
+ [Enter description of this extension point.]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Enter the first release in which this extension point appears.]
+
+
+
+
+
+
+
+
+ [Enter extension point usage example here.]
+
+
+
+
+
+
+
+
+ [Enter API information here.]
+
+
+
+
+
+
+
+
+ [Enter information about supplied implementation of this extension point.]
+
+
+
+
+
diff --git a/cave/com.raytheon.uf.viz.ui.menus/src/com/raytheon/uf/viz/ui/menus/widgets/tearoff/TearOffMenuListener.java b/cave/com.raytheon.uf.viz.ui.menus/src/com/raytheon/uf/viz/ui/menus/widgets/tearoff/TearOffMenuListener.java
index f486955279..45b0814f5c 100644
--- a/cave/com.raytheon.uf.viz.ui.menus/src/com/raytheon/uf/viz/ui/menus/widgets/tearoff/TearOffMenuListener.java
+++ b/cave/com.raytheon.uf.viz.ui.menus/src/com/raytheon/uf/viz/ui/menus/widgets/tearoff/TearOffMenuListener.java
@@ -23,6 +23,11 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.ContributionItem;
@@ -43,6 +48,7 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.viz.ui.VizWorkbenchManager;
+import com.raytheon.viz.ui.perspectives.VizPerspectiveListener;
/**
* Menu listener that adds item to menu which will open dialog which is the menu
@@ -72,14 +78,35 @@ public class TearOffMenuListener implements IMenuListener2 {
public static final String TEAROFF_PREFERENCE_ID = "tearoffmenus";
+ private static final String TEAROFF_DISABLED_PERSPECTIVES = "com.raytheon.uf.viz.ui.menus.tearoffperspective";
+
private static final IUFStatusHandler statusHandler = UFStatus
- .getHandler(TearOffMenuListener.class);
+ .getHandler(TearOffMenuListener.class);
private static boolean enabled;
+
+ private static List enabledPerspectives;
static {
final IPreferenceStore store = com.raytheon.uf.viz.core.Activator
.getDefault().getPreferenceStore();
enabled = store.getBoolean(TEAROFF_PREFERENCE_ID);
+ enabledPerspectives = new ArrayList();
+
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint point = registry
+ .getExtensionPoint(TEAROFF_DISABLED_PERSPECTIVES);
+ if (point != null) {
+ IExtension[] extensions = point.getExtensions();
+ for (IExtension extension : extensions) {
+ for (IConfigurationElement element : extension
+ .getConfigurationElements()) {
+ if (Boolean.valueOf(element.getAttribute("enabled"))) {
+ enabledPerspectives.add(element
+ .getAttribute("perspectiveId"));
+ }
+ }
+ }
+ }
store.addPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
@@ -149,9 +176,12 @@ public class TearOffMenuListener implements IMenuListener2 {
private Object getPerspectiveKey(IMenuManager manager) {
String perspectiveId = "";
try {
- perspectiveId = VizWorkbenchManager.getInstance().getCurrentWindow().getActivePage().getPerspective().getId();
+ perspectiveId = VizWorkbenchManager.getInstance()
+ .getCurrentWindow().getActivePage().getPerspective()
+ .getId();
} catch (Exception e) {
- statusHandler.handle(Priority.EVENTA, "Failed to get current perspective ID", e);
+ statusHandler.handle(Priority.EVENTA,
+ "Failed to get current perspective ID", e);
}
return perspectiveId + "::" + getKey(manager);
}
@@ -210,7 +240,13 @@ public class TearOffMenuListener implements IMenuListener2 {
*/
@Override
public boolean isVisible() {
- return super.isVisible() && enabled;
+ String currPerspective = VizPerspectiveListener
+ .getCurrentPerspectiveManager().getPerspectiveId();
+ boolean currPerspectiveEnabled = false;
+ if (enabledPerspectives.contains(currPerspective)) {
+ currPerspectiveEnabled = true;
+ }
+ return super.isVisible() && enabled && currPerspectiveEnabled;
}
}
diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/ui/GFEEditAreaMenu.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/ui/GFEEditAreaMenu.java
index f4169f07b0..eae4785929 100644
--- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/ui/GFEEditAreaMenu.java
+++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/ui/GFEEditAreaMenu.java
@@ -30,7 +30,6 @@ import org.eclipse.ui.actions.CompoundContributionItem;
import org.eclipse.ui.menus.CommandContributionItem;
import org.eclipse.ui.menus.CommandContributionItemParameter;
-import com.raytheon.uf.viz.ui.menus.widgets.tearoff.TearOffMenuListener;
import com.raytheon.viz.gfe.GFEPreference;
import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.IReferenceSetManager;
@@ -81,7 +80,7 @@ public class GFEEditAreaMenu extends CompoundContributionItem {
MenuManager mm = new MenuManager(group);
menuMgr.add(mm);
- mm.addMenuListener(new TearOffMenuListener(mm));
+ // mm.addMenuListener(new TearOffMenuListener(mm));
int count = 0;
for (String ref : refMgr.getGroupData(group)) {
Map parms = new HashMap();
diff --git a/cave/com.raytheon.viz.hydro/plugin.xml b/cave/com.raytheon.viz.hydro/plugin.xml
index df50a8766f..85be1165d6 100644
--- a/cave/com.raytheon.viz.hydro/plugin.xml
+++ b/cave/com.raytheon.viz.hydro/plugin.xml
@@ -990,4 +990,11 @@
key="hydroTimeSeries">
+
+
+
+
diff --git a/cave/com.raytheon.viz.mpe.ui/plugin.xml b/cave/com.raytheon.viz.mpe.ui/plugin.xml
index cee551b58d..e894623e47 100644
--- a/cave/com.raytheon.viz.mpe.ui/plugin.xml
+++ b/cave/com.raytheon.viz.mpe.ui/plugin.xml
@@ -1916,4 +1916,11 @@
key="autodqc">
+
+
+
+