tmf: Update copyright headers in tmf.ui
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / SDView.java
old mode 100755 (executable)
new mode 100644 (file)
index d3b6b0f..9631704
@@ -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;
 
 import java.util.Iterator;
@@ -755,7 +754,7 @@ public class SDView extends ViewPart {
      * @param resetPosition boolean Flag whether to reset the position or not.
      */
     protected void setFrame(Frame frame, boolean resetPosition) {
-        if (fSdWidget == null) {
+        if (getSDWidget() == null) {
             return;
         }
 
@@ -765,27 +764,30 @@ public class SDView extends ViewPart {
         }
 
         IUml2SDLoader loader = LoadersManager.getInstance().getCurrentLoader(getViewSite().getId(), this);
+        if (loader == null) {
+            return;
+        }
 
-        if ((loader != null) && (loader.getTitleString() != null)) {
+        if (loader.getTitleString() != null) {
             setContentDescription(loader.getTitleString());
         }
 
-        if (getSDWidget() != null) {
-            getSDWidget().setFrame(frame, resetPosition);
-        }
+        getSDWidget().setFrame(frame, resetPosition);
 
         if (fTimeCompressionBar != null) {
             fTimeCompressionBar.setFrame(frame);
         }
         updateCoolBar();
-        if (!frame.hasTimeInfo()) {
-            Composite parent = fTimeCompressionBar.getParent();
-            fTimeCompressionBar.setVisible(false);
-            parent.layout(true);
-        } else {
-            Composite parent = fTimeCompressionBar.getParent();
-            fTimeCompressionBar.setVisible(true);
-            parent.layout(true);
+        if (fTimeCompressionBar != null) {
+            if (!frame.hasTimeInfo()) {
+                Composite parent = fTimeCompressionBar.getParent();
+                fTimeCompressionBar.setVisible(false);
+                parent.layout(true);
+            } else {
+                Composite parent = fTimeCompressionBar.getParent();
+                fTimeCompressionBar.setVisible(true);
+                parent.layout(true);
+            }
         }
         IContributionItem shortKeysMenu = getViewSite().getActionBars().getMenuManager().find("org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers");//$NON-NLS-1$
         MenuManager shortKeys = (MenuManager) shortKeysMenu;
@@ -836,7 +838,8 @@ public class SDView extends ViewPart {
         getSDWidget().getDisplay().syncExec(new Runnable() {
             @Override
             public void run() {
-                if (getSDWidget() == null || getSDWidget().isDisposed()) {
+                if (getSDWidget() == null || getSDWidget().isDisposed() ||
+                        ((fTimeCompressionBar != null) && fTimeCompressionBar.isDisposed())) {
                     return;
                 }
                 setFrame(frame);
@@ -982,9 +985,7 @@ public class SDView extends ViewPart {
         if (getSDWidget() != null) {
             return getSDWidget().getFrame();
         }
-        else {
-            return null;
-        }
+        return null;
     }
 
     /**
@@ -1003,10 +1004,9 @@ public class SDView extends ViewPart {
         if ((loader != null)) {// &&( LoadersManager.getLoadersManager().getViewer(l)==this)){
             loader.setViewer(this);
             return false;
-        } else {
-            loadBlank();
-            return true;
         }
+        loadBlank();
+        return true;
     }
 
     /**
@@ -1060,7 +1060,6 @@ public class SDView extends ViewPart {
      * (non-Javadoc)
      * @see org.eclipse.ui.part.WorkbenchPart#getAdapter(java.lang.Class)
      */
-    @SuppressWarnings("rawtypes")
     @Override
     public Object getAdapter(Class adapter) {
         Object obj = super.getAdapter(adapter);
This page took 0.025565 seconds and 5 git commands to generate.