Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 233111
Collapse All | Expand All

(-)src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/expression/WatchExpressionCellModifier.java (-5 / +10 lines)
Lines 53-65 Link Here
53
    public void modify(Object element, String property, Object value) {
53
    public void modify(Object element, String property, Object value) {
54
        if (!IDebugVMConstants.COLUMN_ID__EXPRESSION.equals(property)) return;
54
        if (!IDebugVMConstants.COLUMN_ID__EXPRESSION.equals(property)) return;
55
        if (!(value instanceof String)) return;
55
        if (!(value instanceof String)) return;
56
56
        
57
        String strValue = ((String)value).trim();
57
        IWatchExpression expression = getWatchExpression(element);
58
        IWatchExpression expression = getWatchExpression(element);
59
        IExpressionManager expressionManager = DebugPlugin.getDefault().getExpressionManager(); 
58
        if (expression != null) {
60
        if (expression != null) {
59
            expression.setExpressionText((String)value);
61
            if (strValue.length() != 0) {
60
        } else if (element instanceof NewExpressionVMC && ((String)value).trim().length() != 0) {
62
                expression.setExpressionText(strValue);
61
            IExpressionManager expressionManager = DebugPlugin.getDefault().getExpressionManager(); 
63
            } else {
62
            IWatchExpression watchExpression = expressionManager.newWatchExpression((String)value); 
64
                expressionManager.removeExpression(expression);
65
            }
66
        } else if (element instanceof NewExpressionVMC && strValue.length() != 0) {
67
            IWatchExpression watchExpression = expressionManager.newWatchExpression(strValue); 
63
            expressionManager.addExpression(watchExpression);            
68
            expressionManager.addExpression(watchExpression);            
64
        }
69
        }
65
    }
70
    }

Return to bug 233111