X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.procore.ui%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fprocore%2Fui%2FProCoreUserAgent.java;h=54b892070e70e4e0c28f534fe3ec98e5e13018eb;hb=96bb7ef9cbe42d82eb58306d8f9b62392cc29ba8;hp=dc93b2f9d9a45918a546a42383fa396523104422;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.procore.ui/src/org/simantics/db/procore/ui/ProCoreUserAgent.java b/bundles/org.simantics.db.procore.ui/src/org/simantics/db/procore/ui/ProCoreUserAgent.java index dc93b2f9d..54b892070 100644 --- a/bundles/org.simantics.db.procore.ui/src/org/simantics/db/procore/ui/ProCoreUserAgent.java +++ b/bundles/org.simantics.db.procore.ui/src/org/simantics/db/procore/ui/ProCoreUserAgent.java @@ -2,28 +2,21 @@ package org.simantics.db.procore.ui; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchWindow; import org.simantics.db.DatabaseUserAgent; import org.simantics.db.exception.InternalException; import org.simantics.db.procore.ProCoreDriver; public final class ProCoreUserAgent implements DatabaseUserAgent { - private static Shell getShell(IWorkbench workbench) { - IWorkbenchWindow wbw = workbench.getActiveWorkbenchWindow(); + private static Shell getShell() { Shell shell = null; - if (null != wbw) { - shell = wbw.getShell(); - } else { - Display d = getDisplay(); - if (d == null) - return null; - shell = d.getActiveShell(); - if (null == shell) { - Shell[] shells = d.getShells(); - if (null != shells && shells.length > 0) - shell = shells[0]; - } + Display d = getDisplay(); + if (d == null) + return null; + shell = d.getActiveShell(); + if (null == shell) { + Shell[] shells = d.getShells(); + if (null != shells && shells.length > 0) + shell = shells[0]; } return shell; } @@ -33,13 +26,6 @@ public final class ProCoreUserAgent implements DatabaseUserAgent { d = Display.getDefault(); return d; } - private IWorkbench workbench; - public ProCoreUserAgent(IWorkbench workbench) { - this.workbench = workbench; - } - private Shell getShell() { - return getShell(workbench); - } @Override public boolean handleStart(InternalException exception) { Shell shell = getShell();