qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ritch...@apache.org
Subject svn commit: r722857 - /incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java
Date Wed, 03 Dec 2008 12:18:19 GMT
Author: ritchiem
Date: Wed Dec  3 04:18:18 2008
New Revision: 722857

URL: http://svn.apache.org/viewvc?rev=722857&view=rev
Log:
QPID-1011 : Patch provided by Senaka Fernando to prevent MC being used as a plugin in eclipse
in difference Perspectives.

Modified:
    incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java

Modified: incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java?rev=722857&r1=722856&r2=722857&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java
(original)
+++ incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java
Wed Dec  3 04:18:18 2008
@@ -46,7 +46,9 @@
     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 @@
     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)



Mime
View raw message