Search in sources :

Example 6 with BooleanValue

use of com.sun.jdi.BooleanValue in project intellij-community by JetBrains.

the class ExpressionChildrenRenderer method isExpandable.

public boolean isExpandable(Value value, final EvaluationContext context, NodeDescriptor parentDescriptor) {
    final EvaluationContext evaluationContext = context.createEvaluationContext(value);
    if (!StringUtil.isEmpty(myChildrenExpandable.getReferenceExpression().getText())) {
        try {
            Value expanded = myChildrenExpandable.getEvaluator(evaluationContext.getProject()).evaluate(evaluationContext);
            if (expanded instanceof BooleanValue) {
                return ((BooleanValue) expanded).booleanValue();
            }
        } catch (EvaluateException e) {
        // ignored
        }
    }
    try {
        Value children = evaluateChildren(evaluationContext, parentDescriptor);
        ChildrenRenderer defaultChildrenRenderer = DebugProcessImpl.getDefaultRenderer(value.type());
        return defaultChildrenRenderer.isExpandable(children, evaluationContext, parentDescriptor);
    } catch (EvaluateException e) {
        return true;
    }
}
Also used : EvaluateException(com.intellij.debugger.engine.evaluation.EvaluateException) BooleanValue(com.sun.jdi.BooleanValue) BooleanValue(com.sun.jdi.BooleanValue) Value(com.sun.jdi.Value) EvaluationContext(com.intellij.debugger.engine.evaluation.EvaluationContext)

Aggregations

BooleanValue (com.sun.jdi.BooleanValue)6 Value (com.sun.jdi.Value)5 IntegerValue (com.sun.jdi.IntegerValue)3 ObjectReference (com.sun.jdi.ObjectReference)3 PrimitiveValue (com.sun.jdi.PrimitiveValue)3 DoubleValue (com.sun.jdi.DoubleValue)2 FloatValue (com.sun.jdi.FloatValue)2 LongValue (com.sun.jdi.LongValue)2 StringReference (com.sun.jdi.StringReference)2 ThreadReference (com.sun.jdi.ThreadReference)2 Test (org.junit.Test)2 EvaluateException (com.intellij.debugger.engine.evaluation.EvaluateException)1 EvaluationContext (com.intellij.debugger.engine.evaluation.EvaluationContext)1 VirtualMachineProxyImpl (com.intellij.debugger.jdi.VirtualMachineProxyImpl)1