From 8507ce2f8078528dab1f6b942d825f339f6b22d0 Mon Sep 17 00:00:00 2001 From: jsimomaa Date: Tue, 18 Jul 2017 13:51:43 +0300 Subject: [PATCH] Change default "Eclipse Launcher" shell title from workspace launcher refs #7358 Change-Id: I4919b533cb980dd6730fa7915507ddaac2cafab4 --- .../SimanticsWorkbenchApplication.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchApplication.java b/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchApplication.java index 8b0431f38..d31914fd0 100644 --- a/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchApplication.java +++ b/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchApplication.java @@ -33,6 +33,8 @@ import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.osgi.service.datalocation.Location; import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.MessageBox; import org.eclipse.swt.widgets.Shell; @@ -373,6 +375,20 @@ public class SimanticsWorkbenchApplication implements IApplication, IExecutableE return args.containsKey("-pdelaunch"); //$NON-NLS-1$ } + private static class ChooseSimanticsWorkspaceDialog extends ChooseWorkspaceDialog { + + public ChooseSimanticsWorkspaceDialog(Shell parentShell, ChooseWorkspaceData launchData, boolean suppressAskAgain, boolean centerOnMonitor) { + super(parentShell, launchData, suppressAskAgain, centerOnMonitor); + } + + @Override + protected void configureShell(Shell shell) { + super.configureShell(shell); + // Use product name in shell title instead of generic "Eclipse Launcher" + shell.setText(getWindowTitle()); + } + } + /** * Open a workspace selection dialog on the argument shell, populating the * argument data with the user's selection. Perform first level validation @@ -392,7 +408,8 @@ public class SimanticsWorkbenchApplication implements IApplication, IExecutableE URL url = null; do { // okay to use the shell now - this is the splash shell - new ChooseWorkspaceDialog(shell, launchData, suppressAskAgain, true).prompt(force); + new ChooseSimanticsWorkspaceDialog(shell, launchData, suppressAskAgain, true).prompt(force); + String instancePath = launchData.getSelection(); if (instancePath == null) { return null; -- 2.47.1