Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationSelectionDialog.java17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationTabGroup.java24
4 files changed, 36 insertions, 11 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java
index 8839fa73c..49e6ab536 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java
@@ -255,6 +255,8 @@ public class DebugUIMessages extends NLS {
public static String GroupLaunchConfigurationSelectionDialog_7;
public static String GroupLaunchConfigurationSelectionDialog_8;
public static String GroupLaunchConfigurationSelectionDialog_9;
+ public static String GroupLaunchConfigurationSelectionDialog_adoptText;
+ public static String GroupLaunchConfigurationSelectionDialog_adoptTooltip;
public static String GroupLaunchConfigurationTabGroup_1;
public static String GroupLaunchConfigurationTabGroup_10;
public static String GroupLaunchConfigurationTabGroup_12;
@@ -268,6 +270,7 @@ public class DebugUIMessages extends NLS {
public static String GroupLaunchConfigurationTabGroup_5;
public static String GroupLaunchConfigurationTabGroup_6;
public static String GroupLaunchConfigurationTabGroup_7;
+ public static String GroupLaunchConfigurationTabGroup_lblAdopt;
//
// Blocks
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties
index 7d396fc92..912758da5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties
@@ -128,6 +128,8 @@ GroupLaunchConfigurationSelectionDialog_12=Add Launch Configuration
GroupLaunchConfigurationSelectionDialog_13=Edit Launch Configuration
GroupLaunchConfigurationSelectionDialog_14=Add one or more launch configurations to the launch group
GroupLaunchConfigurationSelectionDialog_15=Edit an existing entry in the launch group
+GroupLaunchConfigurationSelectionDialog_adoptText=Adopt launch if already running
+GroupLaunchConfigurationSelectionDialog_adoptTooltip=Instead of launching a new process, adds the running launch to the group.
GroupLaunchConfigurationTabGroup_1=&Up
GroupLaunchConfigurationTabGroup_2=Do&wn
GroupLaunchConfigurationTabGroup_3=&Edit...
@@ -141,6 +143,7 @@ GroupLaunchConfigurationTabGroup_13=Delay {0} seconds
GroupLaunchConfigurationTabGroup_14=Launch {0} does not exist.
GroupLaunchConfigurationTabGroup_15=Launch {0} is filtered.
GroupLaunchConfigurationTabGroup_16=Must have at least one valid enabled launch.
+GroupLaunchConfigurationTabGroup_lblAdopt=\ (adopt if running)
CodePagesPrefDialog_1=Select Codepages
CodePagesPrefDialog_2=Memory to ASCII strings:
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationSelectionDialog.java
index 6db551d82..8ae809995 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationSelectionDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationSelectionDialog.java
@@ -77,6 +77,7 @@ class GroupLaunchConfigurationSelectionDialog extends TitleAreaDialog implements
private String mode;
private GroupElementPostLaunchAction action = GroupElementPostLaunchAction.NONE;
private Object actionParam;
+ private boolean adoptIfRunning;
private ViewerFilter emptyTypeFilter;
private IStructuredSelection fInitialSelection;
private ComboControlledStackComposite fStackComposite;
@@ -210,6 +211,17 @@ class GroupLaunchConfigurationSelectionDialog extends TitleAreaDialog implements
}
});
+ Button chkAdopt = new Button(comp, SWT.CHECK);
+ chkAdopt.setText(DebugUIMessages.GroupLaunchConfigurationSelectionDialog_adoptText);
+ chkAdopt.setToolTipText(DebugUIMessages.GroupLaunchConfigurationSelectionDialog_adoptTooltip);
+ chkAdopt.setSelection(adoptIfRunning);
+ chkAdopt.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ adoptIfRunning = chkAdopt.getSelection();
+ }
+ });
+
createPostLaunchControl(comp);
return comp;
}
@@ -288,6 +300,10 @@ class GroupLaunchConfigurationSelectionDialog extends TitleAreaDialog implements
return action;
}
+ public boolean getAdoptIfRunning() {
+ return adoptIfRunning;
+ }
+
public Object getActionParam() {
return actionParam;
}
@@ -406,6 +422,7 @@ class GroupLaunchConfigurationSelectionDialog extends TitleAreaDialog implements
public void setInitialSelection(GroupLaunchElement el) {
action = el.action;
actionParam = el.actionParam;
+ adoptIfRunning = el.adoptIfRunning;
fInitialSelection = new StructuredSelection(el.data);
fSelection = fInitialSelection;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationTabGroup.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationTabGroup.java
index 183ce1e39..692c681a8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationTabGroup.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationTabGroup.java
@@ -148,7 +148,7 @@ public class GroupLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
// launch mode
if (columnIndex == 1) {
- return el.mode;
+ return el.mode + (el.adoptIfRunning ? DebugUIMessages.GroupLaunchConfigurationTabGroup_lblAdopt : ""); //$NON-NLS-1$
}
// launch post action
@@ -309,11 +309,7 @@ public class GroupLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
input.add(el);
el.index = input.size() - 1;
el.enabled = true;
- el.name = config.getName();
- el.data = config;
- el.mode = dialog.getMode();
- el.action = dialog.getAction();
- el.actionParam = dialog.getActionParam();
+ applyFromDialog(el, dialog, config);
treeViewer.refresh(true);
treeViewer.setChecked(el, el.enabled);
}
@@ -351,16 +347,22 @@ public class GroupLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
return;
}
assert confs.length == 1 : "invocation of the dialog for editing an entry sholdn't allow OK to be hit if the user chooses multiple launch configs in the dialog"; //$NON-NLS-1$
- el.name = confs[0].getName();
- el.data = confs[0];
- el.mode = dialog.getMode();
- el.action = dialog.getAction();
- el.actionParam = dialog.getActionParam();
+ applyFromDialog(el, dialog, confs[0]);
treeViewer.refresh(true);
updateWidgetEnablement();
updateLaunchConfigurationDialog();
}
}
+
+ private void applyFromDialog(GroupLaunchElement el, GroupLaunchConfigurationSelectionDialog dialog, ILaunchConfiguration config) {
+ el.name = config.getName();
+ el.data = config;
+ el.mode = dialog.getMode();
+ el.action = dialog.getAction();
+ el.adoptIfRunning = dialog.getAdoptIfRunning();
+ el.actionParam = dialog.getActionParam();
+ }
+
@Override
protected void deletePressed() {
int[] indices = getMultiSelectionIndices();

Back to the top