1 package org.simantics.db.procore.ui;
3 import org.eclipse.swt.widgets.Display;
4 import org.eclipse.swt.widgets.Shell;
5 import org.simantics.db.DatabaseUserAgent;
6 import org.simantics.db.exception.InternalException;
7 import org.simantics.db.procore.ProCoreDriver;
9 public final class ProCoreUserAgent implements DatabaseUserAgent {
10 private static Shell getShell() {
12 Display d = getDisplay();
15 shell = d.getActiveShell();
17 Shell[] shells = d.getShells();
18 if (null != shells && shells.length > 0)
23 private static Display getDisplay() {
24 Display d = Display.getCurrent();
26 d = Display.getDefault();
30 public boolean handleStart(InternalException exception) {
31 Shell shell = getShell();
33 return false; // no can do
35 return Auxiliary.handleStart(shell, exception);
36 } catch (InternalException e) {
37 return false; // no could do
42 public String getId() {
43 return ProCoreDriver.ProCoreDriverName;