1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

[233111] - [expressions] Changing an expression name in the view should not accept an empty expression

This commit is contained in:
Pawel Piech 2008-10-09 05:32:50 +00:00
parent 2821634b7d
commit 43456f1f7f

View file

@ -54,12 +54,17 @@ public class WatchExpressionCellModifier implements ICellModifier {
if (!IDebugVMConstants.COLUMN_ID__EXPRESSION.equals(property)) return; if (!IDebugVMConstants.COLUMN_ID__EXPRESSION.equals(property)) return;
if (!(value instanceof String)) return; if (!(value instanceof String)) return;
String strValue = ((String)value).trim();
IWatchExpression expression = getWatchExpression(element); IWatchExpression expression = getWatchExpression(element);
if (expression != null) {
expression.setExpressionText((String)value);
} else if (element instanceof NewExpressionVMC && ((String)value).trim().length() != 0) {
IExpressionManager expressionManager = DebugPlugin.getDefault().getExpressionManager(); IExpressionManager expressionManager = DebugPlugin.getDefault().getExpressionManager();
IWatchExpression watchExpression = expressionManager.newWatchExpression((String)value); if (expression != null) {
if (strValue.length() != 0) {
expression.setExpressionText(strValue);
} else {
expressionManager.removeExpression(expression);
}
} else if (element instanceof NewExpressionVMC && strValue.length() != 0) {
IWatchExpression watchExpression = expressionManager.newWatchExpression(strValue);
expressionManager.addExpression(watchExpression); expressionManager.addExpression(watchExpression);
} }
} }