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() ||