show "native" description for node objects

This commit is contained in:
Vladimir Krivosheev
2014-02-24 18:19:23 +01:00
parent 84aa4e8142
commit 17b78eb122
4 changed files with 15 additions and 1 deletions
@@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
public class XKeywordValuePresentation extends XValuePresentation {
private final String myValue;
public XKeywordValuePresentation(String value) {
public XKeywordValuePresentation(@NotNull String value) {
myValue = value;
}
@@ -15,6 +15,7 @@
*/
package com.intellij.xdebugger.frame.presentation;
import com.intellij.ui.SimpleTextAttributes;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -71,6 +72,8 @@ public abstract class XValuePresentation {
*/
void renderKeywordValue(@NotNull String value);
void renderValue(@NotNull String value, @Nullable SimpleTextAttributes attributes);
/**
* Appends {@code value} surrounded by quotes to the node text colored as a string
* @param value value to be shown
@@ -124,6 +124,11 @@ public class XValuePresentationUtil {
myBuilder.append(symbol);
}
@Override
public void renderValue(@NotNull String value, @Nullable SimpleTextAttributes attributes) {
renderValue(value);
}
public String getText() {
return myBuilder.toString();
}
@@ -21,6 +21,7 @@ import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.editor.markup.TextAttributes;
import com.intellij.ui.ColoredTextContainer;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.util.ObjectUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -39,6 +40,11 @@ class XValueTextRendererImpl extends XValueTextRendererBase {
XValuePresentationUtil.renderValue(value, myText, SimpleTextAttributes.REGULAR_ATTRIBUTES, -1, null);
}
@Override
public void renderValue(@NotNull String value, @Nullable SimpleTextAttributes attributes) {
myText.append(value, ObjectUtils.notNull(attributes, SimpleTextAttributes.REGULAR_ATTRIBUTES));
}
@Override
protected void renderRawValue(@NotNull String value, @NotNull TextAttributesKey key) {
TextAttributes textAttributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(key);