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

@ -53,13 +53,18 @@ public class WatchExpressionCellModifier implements ICellModifier {
public void modify(Object element, String property, Object value) {
if (!IDebugVMConstants.COLUMN_ID__EXPRESSION.equals(property)) return;
if (!(value instanceof String)) return;
String strValue = ((String)value).trim();
IWatchExpression expression = getWatchExpression(element);
IExpressionManager expressionManager = DebugPlugin.getDefault().getExpressionManager();
if (expression != null) {
expression.setExpressionText((String)value);
} else if (element instanceof NewExpressionVMC && ((String)value).trim().length() != 0) {
IExpressionManager expressionManager = DebugPlugin.getDefault().getExpressionManager();
IWatchExpression watchExpression = expressionManager.newWatchExpression((String)value);
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);
}
}