summaryrefslogtreecommitdiff
path: root/qpid/java
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2008-12-03 12:18:18 +0000
committerMartin Ritchie <ritchiem@apache.org>2008-12-03 12:18:18 +0000
commite997fa8d551e46afad33777ee486464f9e4885e9 (patch)
tree1ce7495a25e5566316b7f7f03cb0143cc4f02d08 /qpid/java
parentfbd22edcea01168ba2e6be188d03901f72f08387 (diff)
downloadqpid-python-e997fa8d551e46afad33777ee486464f9e4885e9.tar.gz
QPID-1011 : Patch provided by Senaka Fernando to prevent MC being used as a plugin in eclipse in difference Perspectives.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@722857 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
-rw-r--r--qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java b/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java
index 53aa927299..f74ab54cc3 100644
--- a/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java
+++ b/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java
@@ -46,7 +46,9 @@ public class AbstractAction
public static final String RMI_SASL_ERROR = "non-JRMP server";
public static final String SECURITY_FAILURE = "User authentication has failed";
public static final String SERVER_UNAVAILABLE = "Qpid server is not running";
-
+ public static final String INVALID_PERSPECTIVE = "Invalid Perspective";
+ public static final String CHANGE_PERSPECTIVE = "Please use the Qpid Management Perspective";
+
/**
* We will cache window object in order to
* be able to provide parent shell for the message dialog.
@@ -75,6 +77,14 @@ public class AbstractAction
protected void handleException(Throwable ex, String title, String msg)
{
MBeanUtility.printStackTrace(ex);
+ NavigationView view = (NavigationView)_window.getActivePage().findView(NavigationView.ID);
+ if (view == null)
+ {
+ IStatus status = new Status(IStatus.WARNING, ApplicationWorkbenchAdvisor.PERSPECTIVE_ID,
+ IStatus.OK, CHANGE_PERSPECTIVE, null);
+ ErrorDialog.openError(_window.getShell(), "Warning", INVALID_PERSPECTIVE, status);
+ return;
+ }
if (msg == null)
{
if (ex instanceof IOException)