Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(898)

Unified Diff: dart/editor/tools/plugins/com.google.dart.tools.debug.ui/src/com/google/dart/tools/debug/ui/internal/dialogs/ManageLaunchesDialog.java

Issue 321583008: Merge to trunk cl - fixes/features for mobile support in the editor (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: dart/editor/tools/plugins/com.google.dart.tools.debug.ui/src/com/google/dart/tools/debug/ui/internal/dialogs/ManageLaunchesDialog.java
===================================================================
--- dart/editor/tools/plugins/com.google.dart.tools.debug.ui/src/com/google/dart/tools/debug/ui/internal/dialogs/ManageLaunchesDialog.java (revision 37106)
+++ dart/editor/tools/plugins/com.google.dart.tools.debug.ui/src/com/google/dart/tools/debug/ui/internal/dialogs/ManageLaunchesDialog.java (working copy)
@@ -63,6 +63,7 @@
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
@@ -80,6 +81,21 @@
public class ManageLaunchesDialog extends TitleAreaDialog implements ILaunchConfigurationDialog,
ILaunchConfigurationListener {
+ /**
+ * Asynchronously open the manage launches dialog with the given launch automatically selected.
+ */
+ public static void openAsync(final IWorkbenchWindow window, final ILaunchConfiguration config) {
+ final Display display = Display.getDefault();
+ display.asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ final ManageLaunchesDialog dialog = new ManageLaunchesDialog(window);
+ dialog.selectLaunchOnOpen(config);
+ dialog.open();
+ }
+ });
+ }
+
private IWorkbenchWindow window;
private TableViewer launchesViewer;
@@ -215,6 +231,13 @@
}
}
+ /**
+ * Select the specified launch configuration when the dialog opens.
+ */
+ public void selectLaunchOnOpen(ILaunchConfiguration config) {
+ selectedConfig = config;
+ }
+
@Override
public void setActiveTab(ILaunchConfigurationTab tab) {
if (activeTab != null) {
@@ -585,23 +608,23 @@
}
private void selectLaunchConfigFromPage() {
- IResource resource = LaunchUtils.getSelectedResource(window);
- if (resource != null) {
-
- ILaunchConfiguration config = null;
- List<ILaunchConfiguration> configs = LaunchUtils.getExistingLaunchesFor(resource);
- if (!configs.isEmpty()) {
- config = configs.get(0);
+ ILaunchConfiguration config = selectedConfig;
+ if (config == null) {
+ IResource resource = LaunchUtils.getSelectedResource(window);
+ if (resource != null) {
+ List<ILaunchConfiguration> configs = LaunchUtils.getExistingLaunchesFor(resource);
+ if (!configs.isEmpty()) {
+ config = configs.get(0);
+ }
}
+ }
- if (config != null) {
- launchesViewer.setSelection(new StructuredSelection(config));
- return;
- }
+ if (config != null) {
+ launchesViewer.setSelection(new StructuredSelection(config));
+ } else {
+ selectFirstLaunchConfig();
}
-
- selectFirstLaunchConfig();
}
private void show(ILaunchConfiguration config) {
@@ -671,5 +694,4 @@
}
}
}
-
}

Powered by Google App Engine
This is Rietveld 408576698