Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java
index 1b09da346..fffbdd2bc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java
@@ -56,26 +56,25 @@ public class EditWatchExpressinInPlaceAction extends Action implements ISelectio
return;
}
-
// Always edit multi-line expressions in dialog. Otherwise try to find the expression
// column and activate cell editor there.
int expressionColumn = getExpressionColumnIndex();
- if (expressionColumn != -1 || isWatchExpressionWithNewLine()) {
+ IWatchExpression[] expressions = fEditActionDelegate.getSelectedExpressions();
+ if (expressionColumn != -1 && !isWatchExpressionWithNewLine(expressions)) {
fViewer.editElement(selelection.getFirstElement(), expressionColumn);
- } else {
+ } else if (expressions.length == 1) {
fEditActionDelegate.run(this);
}
}
- private boolean isWatchExpressionWithNewLine() {
- IWatchExpression[] expressions = fEditActionDelegate.getSelectedExpressions();
+ private boolean isWatchExpressionWithNewLine(IWatchExpression[] expressions) {
return expressions.length == 1 &&
- expressions[0].getExpressionText().indexOf('\n') == -1;
+ expressions[0].getExpressionText().indexOf('\n') != -1;
}
private int getExpressionColumnIndex() {
Object[] columnProperties = fViewer.getColumnProperties();
- for (int i = 0; i < columnProperties.length; i++) {
+ for (int i = 0; columnProperties != null && i < columnProperties.length; i++) {
if (VariableColumnPresentation.COLUMN_VARIABLE_NAME.equals(columnProperties[i])) {
return i;
}

Back to the top