tmf: Update copyright headers in tmf.ui
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / load / LoadersManager.java
old mode 100755 (executable)
new mode 100644 (file)
index 447a9c8..ea7d60d
@@ -1,16 +1,15 @@
 /**********************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * Copyright (c) 2011, 2012 Ericsson.
- *
+ * Copyright (c) 2005, 2012 IBM Corporation, Ericsson
  * 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
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- * IBM - Initial API and implementation
- * Bernd Hufmann - Updated for TMF
+ *     IBM - Initial API and implementation
+ *     Bernd Hufmann - Updated for TMF
  **********************************************************************/
+
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.load;
 
 import java.util.ArrayList;
@@ -29,6 +28,8 @@ import org.eclipse.linuxtools.internal.tmf.ui.Activator;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
 import org.eclipse.ui.IViewReference;
 import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
 
 /**
  * Manager class for the UML2SD extension point.
@@ -161,7 +162,13 @@ public class LoadersManager {
             return null;
         }
 
-        IWorkbenchPage persp = Activator.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+        IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+        // During Eclipse shutdown the active workbench window is null
+        if (window == null) {
+            return null;
+        }
+
+        IWorkbenchPage persp = window.getActivePage();
 
         SDView sdView = view;
 
@@ -233,7 +240,12 @@ public class LoadersManager {
 
         if ((currentLoader != null) && (currentLoader != loader)) {
             if (loader != null) {
-                IWorkbenchPage persp = Activator.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+                IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+                // During Eclipse shutdown the active workbench window is null
+                if (window == null) {
+                    return;
+                }
+                IWorkbenchPage persp = window.getActivePage();
                 try {
                     // Search view corresponding to the viewId
                     SDView sdview = null;
This page took 0.02445 seconds and 5 git commands to generate.