Package com.intellij.xdebugger.frame.presentation

Examples of com.intellij.xdebugger.frame.presentation.XValuePresentation


  public void computePresentation(final @NotNull XValueNode node, final @NotNull XValuePlace place) {
    final String value = myVmValue.isList() ? "size = " + myVmValue.getLength()
                                            : StringUtil.notNullize(myVmValue.getText(), "null");
    final String objectIdPostfix = "[id=" + myVmValue.getObjectId() + "]";

    final XValuePresentation presentation;

    if (myVmValue.isNull()) {
      presentation = new XRegularValuePresentation("null", null);
    }
    else if (myVmValue.isString()) {
      presentation = new XStringValuePresentation(StringUtil.stripQuotesAroundValue(value));
    }
    else if (myVmValue.isNumber()) {
      presentation = new XNumericValuePresentation(value);
    }
    else if ("boolean".equals(myVmValue.getKind())) {
      presentation = new XRegularValuePresentation(value, null);
    }
    else if (myVmValue.isList()) {
      presentation = new XRegularValuePresentation(value, "List" + objectIdPostfix); // VmValue doesn't contain real List subclass name
    }
    else {
      if (value.startsWith(OBJECT_OF_TYPE_PREFIX)) {
        presentation = new XRegularValuePresentation("", value.substring(OBJECT_OF_TYPE_PREFIX.length()) + objectIdPostfix);
      }
      else {
        presentation = new XRegularValuePresentation(value, DebuggerUtils.demangleVmName(myVmValue.getKind()) + objectIdPostfix);
      }
    }

    final boolean neverHasChildren = myVmValue.isPrimitive() ||
                                     myVmValue.isNull() ||
                                     myVmValue.isFunction() ||
                                     myVmValue.isList() && myVmValue.getLength() == 0;
    node.setPresentation(getIcon(), presentation, !neverHasChildren);

    if (!myVmValue.isList() && !myVmValue.isPrimitive() && !myVmValue.isNull() && !myVmValue.isFunction()) {
      scheduleToStringOrCollectionSizePresentation(node, presentation.getType());
    }
  }
View Full Code Here


    node.addChildren(children, computedAllChildren);
  }

  @Override
  public final void computePresentation(@NotNull XValueNode node, @NotNull XValuePlace place) {
    XValuePresentation presentation = getPresentation(node, place);
    if (presentation != null) {
      node.setPresentation(getIcon(), presentation, hasChildren());
    }
    else {
      String repr = getStringRepr();
View Full Code Here

    //TODO apply string detection heuristics (see http://www.erlang.org/doc/apps/stdlib/unicode_usage.html)
    final String textValue = new String(getValue().binaryValue());
    if (textValue.length() > XValueNode.MAX_VALUE_LENGTH) {
      node.setFullValueEvaluator(new ImmediateFullValueEvaluator(textValue));
    }
    return new XValuePresentation() {
      @Override
      public void renderValue(@NotNull XValueTextRenderer renderer) {
        renderer.renderSpecialSymbol("<<");
        renderer.renderStringValue(textValue, "\"\\", XValueNode.MAX_VALUE_LENGTH);
        renderer.renderSpecialSymbol(">>");
View Full Code Here

TOP

Related Classes of com.intellij.xdebugger.frame.presentation.XValuePresentation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.