Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Duft2016-11-25 08:41:41 -0500
committerSarika Sinha2017-01-12 22:30:26 -0500
commit1c1d17b82a223fb8fcc69b4883a71b8744899ccb (patch)
treec202e984d42407b607ac29cf95168bd6c04ffc29 /org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui
parentfb136251cd02ed0b4812d1c65923b3abe79a1d40 (diff)
downloadeclipse.platform.debug-1c1d17b82a223fb8fcc69b4883a71b8744899ccb.tar.gz
eclipse.platform.debug-1c1d17b82a223fb8fcc69b4883a71b8744899ccb.tar.xz
eclipse.platform.debug-1c1d17b82a223fb8fcc69b4883a71b8744899ccb.zip
Launch Groups: Support to wait for output on child stdout
This adds support to listen for output on the console of the launched item before continuing the launch. Bug: 508420 Change-Id: I84027592c82b546ddf60c415bcc7047d9bc5490a Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui')
-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.java53
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationTabGroup.java21
4 files changed, 52 insertions, 28 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 49e6ab536..4cb94c20b 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
@@ -257,6 +257,9 @@ public class DebugUIMessages extends NLS {
public static String GroupLaunchConfigurationSelectionDialog_9;
public static String GroupLaunchConfigurationSelectionDialog_adoptText;
public static String GroupLaunchConfigurationSelectionDialog_adoptTooltip;
+ public static String GroupLaunchConfigurationSelectionDialog_errorNoRegexp;
+ public static String GroupLaunchConfigurationSelectionDialog_regexp;
+ public static String GroupLaunchConfigurationTabGroup_0;
public static String GroupLaunchConfigurationTabGroup_1;
public static String GroupLaunchConfigurationTabGroup_10;
public static String GroupLaunchConfigurationTabGroup_12;
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 912758da5..e082ca5a5 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
@@ -130,6 +130,9 @@ GroupLaunchConfigurationSelectionDialog_14=Add one or more launch configurations
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.
+GroupLaunchConfigurationSelectionDialog_errorNoRegexp=Enter a regular expression to wait for
+GroupLaunchConfigurationSelectionDialog_regexp=Regular Expression:
+GroupLaunchConfigurationTabGroup_0=Wait for output matching "{0}"
GroupLaunchConfigurationTabGroup_1=&Up
GroupLaunchConfigurationTabGroup_2=Do&wn
GroupLaunchConfigurationTabGroup_3=&Edit...
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 8ae809995..d79565184 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
@@ -39,6 +39,7 @@ import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.ILaunchGroup;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -81,8 +82,8 @@ class GroupLaunchConfigurationSelectionDialog extends TitleAreaDialog implements
private ViewerFilter emptyTypeFilter;
private IStructuredSelection fInitialSelection;
private ComboControlledStackComposite fStackComposite;
- private Label fDelayAmountLabel;
- private Text fDelayAmountWidget; // in seconds
+ private Label fActionParamLabel;
+ private Text fActionParamWidget; // in seconds
private boolean fForEditing; // true if dialog was opened to edit an entry,
// otherwise it was opened to add one
private ILaunchConfigurationType groupType;
@@ -236,6 +237,7 @@ class GroupLaunchConfigurationSelectionDialog extends TitleAreaDialog implements
combo.add(GroupElementPostLaunchAction.NONE.getDescription());
combo.add(GroupElementPostLaunchAction.WAIT_FOR_TERMINATION.getDescription());
combo.add(GroupElementPostLaunchAction.DELAY.getDescription());
+ combo.add(GroupElementPostLaunchAction.OUTPUT_REGEXP.getDescription());
combo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -247,36 +249,46 @@ class GroupLaunchConfigurationSelectionDialog extends TitleAreaDialog implements
});
combo.setText(action.getDescription());
- fDelayAmountLabel = new Label(comp, SWT.NONE);
- fDelayAmountLabel.setText(DebugUIMessages.GroupLaunchConfigurationSelectionDialog_9);
-
- fDelayAmountWidget = new Text(comp, SWT.SINGLE | SWT.BORDER);
- GridData gridData = new GridData();
- gridData.widthHint = convertWidthInCharsToPixels(8);
- fDelayAmountWidget.setLayoutData(gridData);
- fDelayAmountWidget.addModifyListener(new ModifyListener() {
+ fActionParamLabel = new Label(comp, SWT.NONE);
+ fActionParamWidget = new Text(comp, SWT.SINGLE | SWT.BORDER);
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(fActionParamWidget);
+ fActionParamWidget.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
String text = ((Text) e.widget).getText();
- try {
- actionParam = Integer.valueOf(text);
- } catch (NumberFormatException exc) {
- actionParam = null;
+ if (action == GroupElementPostLaunchAction.DELAY) {
+ try {
+ actionParam = Integer.valueOf(text);
+ } catch (NumberFormatException exc) {
+ actionParam = null;
+ }
+ } else if (action == GroupElementPostLaunchAction.OUTPUT_REGEXP) {
+ actionParam = text;
}
validate();
}
});
if (actionParam instanceof Integer) {
- fDelayAmountWidget.setText(((Integer) actionParam).toString());
+ fActionParamWidget.setText(((Integer) actionParam).toString());
+ } else if (actionParam instanceof String) {
+ fActionParamWidget.setText(actionParam.toString());
}
showHideDelayAmountWidgets();
}
private void showHideDelayAmountWidgets() {
- final boolean visible = action == GroupElementPostLaunchAction.DELAY;
- fDelayAmountLabel.setVisible(visible);
- fDelayAmountWidget.setVisible(visible);
+ final boolean visible = (action == GroupElementPostLaunchAction.DELAY || action == GroupElementPostLaunchAction.OUTPUT_REGEXP);
+ fActionParamLabel.setVisible(visible);
+ fActionParamWidget.setVisible(visible);
+
+ if (action == GroupElementPostLaunchAction.DELAY) {
+ fActionParamLabel.setText(DebugUIMessages.GroupLaunchConfigurationSelectionDialog_9);
+ } else if (action == GroupElementPostLaunchAction.OUTPUT_REGEXP) {
+ fActionParamLabel.setText(DebugUIMessages.GroupLaunchConfigurationSelectionDialog_regexp);
+ }
+
+ fActionParamLabel.getParent().layout();
}
public ILaunchConfiguration[] getSelectedLaunchConfigurations() {
@@ -389,6 +401,11 @@ class GroupLaunchConfigurationSelectionDialog extends TitleAreaDialog implements
isValid = (actionParam instanceof Integer) && ((Integer) actionParam > 0);
setErrorMessage(isValid ? null : DebugUIMessages.GroupLaunchConfigurationSelectionDialog_10);
}
+
+ if (action == GroupElementPostLaunchAction.OUTPUT_REGEXP) {
+ isValid = actionParam instanceof String && !((String) actionParam).isEmpty();
+ setErrorMessage(isValid ? null : DebugUIMessages.GroupLaunchConfigurationSelectionDialog_errorNoRegexp);
+ }
}
if (ok_button != null) {
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 692c681a8..2dca579c2 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
@@ -155,17 +155,18 @@ public class GroupLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
if (columnIndex == 2) {
GroupElementPostLaunchAction action = el.action;
switch (action) {
- case NONE:
- return ""; //$NON-NLS-1$
- case WAIT_FOR_TERMINATION:
+ case NONE:
+ return ""; //$NON-NLS-1$
+ case WAIT_FOR_TERMINATION:
return action.getDescription();
- case DELAY:
- final Object actionParam = el.actionParam;
- return NLS.bind(DebugUIMessages.GroupLaunchConfigurationTabGroup_13,
- actionParam instanceof Integer ? Integer.toString((Integer) actionParam) : "?"); //$NON-NLS-1$
- default:
- assert false : "new post launch action missing logic here"; //$NON-NLS-1$
- return ""; //$NON-NLS-1$
+ case DELAY:
+ final Object actionParam = el.actionParam;
+ return NLS.bind(DebugUIMessages.GroupLaunchConfigurationTabGroup_13, actionParam instanceof Integer ? Integer.toString((Integer) actionParam) : "?"); //$NON-NLS-1$
+ case OUTPUT_REGEXP:
+ return NLS.bind(DebugUIMessages.GroupLaunchConfigurationTabGroup_0, el.actionParam);
+ default:
+ assert false : "new post launch action missing logic here"; //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
}
}
return null;

Back to the top