]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.procore.ui/src/org/simantics/db/procore/ui/ProCoreUserAgent.java
migrated to svn revision 33108
[simantics/platform.git] / bundles / org.simantics.db.procore.ui / src / org / simantics / db / procore / ui / ProCoreUserAgent.java
index dc93b2f9d9a45918a546a42383fa396523104422..54b892070e70e4e0c28f534fe3ec98e5e13018eb 100644 (file)
@@ -2,28 +2,21 @@ package org.simantics.db.procore.ui;
 \r
 import org.eclipse.swt.widgets.Display;\r
 import org.eclipse.swt.widgets.Shell;\r
-import org.eclipse.ui.IWorkbench;\r
-import org.eclipse.ui.IWorkbenchWindow;\r
 import org.simantics.db.DatabaseUserAgent;\r
 import org.simantics.db.exception.InternalException;\r
 import org.simantics.db.procore.ProCoreDriver;\r
 \r
 public final class ProCoreUserAgent implements DatabaseUserAgent {\r
-    private static Shell getShell(IWorkbench workbench) {\r
-        IWorkbenchWindow wbw = workbench.getActiveWorkbenchWindow();\r
+    private static Shell getShell() {\r
         Shell shell = null;\r
-        if (null != wbw) {\r
-            shell = wbw.getShell();\r
-        } else {\r
-            Display d = getDisplay();\r
-            if (d == null)\r
-                return null;\r
-            shell = d.getActiveShell();\r
-            if (null == shell) {\r
-                Shell[] shells = d.getShells();\r
-                if (null != shells && shells.length > 0)\r
-                    shell = shells[0];\r
-            }\r
+        Display d = getDisplay();\r
+        if (d == null)\r
+            return null;\r
+        shell = d.getActiveShell();\r
+        if (null == shell) {\r
+            Shell[] shells = d.getShells();\r
+            if (null != shells && shells.length > 0)\r
+                shell = shells[0];\r
         }\r
         return shell;\r
     }\r
@@ -33,13 +26,6 @@ public final class ProCoreUserAgent implements DatabaseUserAgent {
             d = Display.getDefault();\r
         return d;\r
     }\r
-    private IWorkbench workbench;\r
-    public ProCoreUserAgent(IWorkbench workbench) {\r
-        this.workbench = workbench;\r
-    }\r
-    private Shell getShell() {\r
-        return getShell(workbench);\r
-    }\r
     @Override\r
     public boolean handleStart(InternalException exception) {\r
         Shell shell = getShell();\r