Search in sources :

Example 1 with XKeywordValuePresentation

use of com.intellij.xdebugger.frame.presentation.XKeywordValuePresentation in project intellij-plugins by JetBrains.

the class DartVmServiceValue method computeVarHavingStringValuePresentation.

private boolean computeVarHavingStringValuePresentation(@NotNull final XValueNode node) {
    // getValueAsString() is provided for the instance kinds: Null, Bool, Double, Int, String (value may be truncated), Float32x4, Float64x2, Int32x4, StackTrace
    switch(myInstanceRef.getKind()) {
        case Null:
        case Bool:
            node.setPresentation(getIcon(), new XKeywordValuePresentation(myInstanceRef.getValueAsString()), false);
            break;
        case Double:
        case Int:
            node.setPresentation(getIcon(), new XNumericValuePresentation(myInstanceRef.getValueAsString()), false);
            break;
        case String:
            final String presentableValue = StringUtil.replace(myInstanceRef.getValueAsString(), "\"", "\\\"");
            node.setPresentation(getIcon(), new XStringValuePresentation(presentableValue), false);
            if (myInstanceRef.getValueAsStringIsTruncated()) {
                addFullStringValueEvaluator(node, myInstanceRef);
            }
            break;
        case Float32x4:
        case Float64x2:
        case Int32x4:
        case StackTrace:
            node.setFullValueEvaluator(new ImmediateFullValueEvaluator("Click to see stack trace...", myInstanceRef.getValueAsString()));
            node.setPresentation(getIcon(), myInstanceRef.getClassRef().getName(), "", true);
            break;
        default:
            return false;
    }
    return true;
}
Also used : XNumericValuePresentation(com.intellij.xdebugger.frame.presentation.XNumericValuePresentation) XKeywordValuePresentation(com.intellij.xdebugger.frame.presentation.XKeywordValuePresentation) XStringValuePresentation(com.intellij.xdebugger.frame.presentation.XStringValuePresentation)

Aggregations

XKeywordValuePresentation (com.intellij.xdebugger.frame.presentation.XKeywordValuePresentation)1 XNumericValuePresentation (com.intellij.xdebugger.frame.presentation.XNumericValuePresentation)1 XStringValuePresentation (com.intellij.xdebugger.frame.presentation.XStringValuePresentation)1