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:
parent
2821634b7d
commit
43456f1f7f
1 changed files with 10 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue