X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.workbench%2Fsrc%2Forg%2Fsimantics%2Fworkbench%2Finternal%2FSimanticsWorkbenchAdvisor.java;h=d75f1e47672941e9f81eaabf8f7efd8b8d8833d6;hp=2d054eaa7d0d7a1fa2367fce88996772f4023f5a;hb=ffdf83729b496d5afe74c7888075bb17ce1c4bbb;hpb=969bd23cab98a79ca9101af33334000879fb60c5 diff --git a/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchAdvisor.java b/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchAdvisor.java index 2d054eaa7..d75f1e476 100644 --- a/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchAdvisor.java +++ b/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchAdvisor.java @@ -61,7 +61,6 @@ import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IPerspectiveDescriptor; -import org.eclipse.ui.IWorkbench; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.application.IWorkbenchConfigurer; import org.eclipse.ui.application.IWorkbenchWindowConfigurer; @@ -98,7 +97,6 @@ import org.simantics.db.common.Indexing; import org.simantics.db.indexing.DatabaseIndexing; import org.simantics.db.procore.server.environment.RebootRequiredException; import org.simantics.db.procore.server.environment.windows.Product; -import org.simantics.db.procore.ui.ProCoreUserAgent; import org.simantics.internal.TimedSessionCache; import org.simantics.project.IProject; import org.simantics.project.ProjectKeys; @@ -131,11 +129,6 @@ public class SimanticsWorkbenchAdvisor extends WorkbenchAdvisor { */ private static final String INSTALLED_FEATURES = "installedFeatures"; //$NON-NLS-1$ - /** - * Default database ID - */ - private static final String DEFAULT_DATABASE_ID = "procore"; - /** * The arguments received by the application. */ @@ -360,7 +353,7 @@ public class SimanticsWorkbenchAdvisor extends WorkbenchAdvisor { try { platformShutdownRunnable.run(null); } catch (InvocationTargetException e) { - Activator.logError(getClass().getSimpleName() + ".openWindows failed", e); + Activator.logError(getClass().getSimpleName() + ".openWindows failed", e.getCause()); } catch (InterruptedException e) { Activator.logError(getClass().getSimpleName() + ".openWindows failed", e); } @@ -428,17 +421,16 @@ public class SimanticsWorkbenchAdvisor extends WorkbenchAdvisor { throw new PlatformException("Argument not supported: " + SimanticsArguments.SERVER + " " + serverAddress); } - // TODO: Default to procore for now; - String databaseId = DEFAULT_DATABASE_ID; + String databaseDriverId = Simantics.getDefaultDatabaseDriver(); if (args.contains(SimanticsArguments.DATABASE_ID)) { - databaseId = args.get(SimanticsArguments.DATABASE_ID); + databaseDriverId = args.get(SimanticsArguments.DATABASE_ID); + Simantics.setDefaultDatabaseDriver(databaseDriverId); } IProgressMonitor mon = null; if (PROFILE_PLATFORM_STARTUP) mon = new TimingProgressMonitor(); - IWorkbench wb = PlatformUI.getWorkbench(); - SimanticsPlatform.INSTANCE.startUp(databaseId, mon, workspacePolicy, ontologyPolicy, requireSynchronize, new JFaceUserAgent()); + SimanticsPlatform.INSTANCE.startUp(databaseDriverId, mon, workspacePolicy, ontologyPolicy, requireSynchronize, new JFaceUserAgent()); // Make sure that the default perspective comes from the project if // the project has set ProjectKeys#DEFAULT_PERSPECTIVE.