diff --git a/org.eclipse.dartboard.dart/src/org/eclipse/dartboard/dart/launch/LaunchConfigTab.java b/org.eclipse.dartboard.dart/src/org/eclipse/dartboard/dart/launch/LaunchConfigTab.java index 80366c7..e581d43 100644 --- a/org.eclipse.dartboard.dart/src/org/eclipse/dartboard/dart/launch/LaunchConfigTab.java +++ b/org.eclipse.dartboard.dart/src/org/eclipse/dartboard/dart/launch/LaunchConfigTab.java @@ -83,7 +83,7 @@ public void createControl(Composite parent) { labelSdkLocation.setText(Messages.Preference_SDKLocation_Dart); GridDataFactory.swtDefaults().applyTo(labelSdkLocation); - textSdkLocation = new Text(comp, SWT.NONE); + textSdkLocation = new Text(comp, SWT.BORDER); textSdkLocation.setMessage(Messages.Launch_SDKLocation_Message); GridDataFactory.fillDefaults().grab(true, false).applyTo(textSdkLocation); textSdkLocation.addModifyListener(event -> updateLaunchConfigurationDialog()); @@ -92,7 +92,7 @@ public void createControl(Composite parent) { labelMainClass.setText(Messages.Launch_MainClass); GridDataFactory.swtDefaults().applyTo(labelMainClass); - textMainClass = new Text(comp, SWT.NONE); + textMainClass = new Text(comp, SWT.BORDER); textMainClass.setMessage(Messages.Launch_MainClass_Message); GridDataFactory.fillDefaults().grab(true, false).applyTo(textMainClass); textMainClass.addModifyListener(event -> updateLaunchConfigurationDialog()); diff --git a/org.eclipse.dartboard.dart/src/org/eclipse/dartboard/dart/launch/LaunchShortcut.java b/org.eclipse.dartboard.dart/src/org/eclipse/dartboard/dart/launch/LaunchShortcut.java index d32886c..64c2edc 100644 --- a/org.eclipse.dartboard.dart/src/org/eclipse/dartboard/dart/launch/LaunchShortcut.java +++ b/org.eclipse.dartboard.dart/src/org/eclipse/dartboard/dart/launch/LaunchShortcut.java @@ -19,6 +19,7 @@ import org.eclipse.core.runtime.ILog; import org.eclipse.core.runtime.Platform; import org.eclipse.dartboard.dart.Constants; +import org.eclipse.dartboard.dart.stagehand.StagehandGenerator; import org.eclipse.dartboard.logging.DartLog; import org.eclipse.dartboard.messages.Messages; import org.eclipse.dartboard.util.PlatformUIUtil; @@ -102,6 +103,7 @@ private void launchProject(IProject project, String mode) { LaunchConfigurationsMessages.CreateLaunchConfigurationAction_New_configuration_2)); copy.setAttribute(Constants.LAUNCH_SELECTED_PROJECT, project.getName()); + copy.setAttribute(Constants.LAUNCH_MAIN_CLASS, project.getPersistentProperty(StagehandGenerator.QN_ENTRYPOINT)); int result = DebugUITools.openLaunchConfigurationDialog(PlatformUIUtil.getActiveShell(), copy, Constants.LAUNCH_GROUP, null); diff --git a/org.eclipse.dartboard.dart/src/org/eclipse/dartboard/dart/stagehand/StagehandGenerator.java b/org.eclipse.dartboard.dart/src/org/eclipse/dartboard/dart/stagehand/StagehandGenerator.java index 9c2df51..fca34b6 100644 --- a/org.eclipse.dartboard.dart/src/org/eclipse/dartboard/dart/stagehand/StagehandGenerator.java +++ b/org.eclipse.dartboard.dart/src/org/eclipse/dartboard/dart/stagehand/StagehandGenerator.java @@ -10,9 +10,11 @@ import org.eclipse.core.runtime.ILog; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.QualifiedName; import org.eclipse.core.runtime.jobs.IJobChangeEvent; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.jobs.JobChangeAdapter; +import org.eclipse.dartboard.dart.Constants; import org.eclipse.dartboard.dart.util.PubUtil; import org.eclipse.dartboard.logging.DartLog; import org.eclipse.dartboard.messages.Messages; @@ -25,6 +27,7 @@ public class StagehandGenerator { private static final ILog LOG = Platform.getLog(StagehandGenerator.class); + public static final QualifiedName QN_ENTRYPOINT = new QualifiedName(Constants.PLUGIN_ID, "entryPoint"); public static void generate(StagehandTemplate generator, IProject project) { if (project == null) { @@ -71,6 +74,7 @@ public static void generate(StagehandTemplate generator, IProject project) { public void done(IJobChangeEvent event) { try { project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor()); + project.setPersistentProperty(QN_ENTRYPOINT, generator.getEntrypoint()); } catch (CoreException e) { LOG.log(DartLog.createError("Could not refresh project", e)); //$NON-NLS-1$ }