diff options
Diffstat (limited to 'platform/platform-api/src/com/intellij/ide/util/treeView/NodeRenderer.java')
-rw-r--r-- | platform/platform-api/src/com/intellij/ide/util/treeView/NodeRenderer.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/platform/platform-api/src/com/intellij/ide/util/treeView/NodeRenderer.java b/platform/platform-api/src/com/intellij/ide/util/treeView/NodeRenderer.java index a07370e1238a..6183fae779e5 100644 --- a/platform/platform-api/src/com/intellij/ide/util/treeView/NodeRenderer.java +++ b/platform/platform-api/src/com/intellij/ide/util/treeView/NodeRenderer.java @@ -59,6 +59,11 @@ public class NodeRenderer extends ColoredTreeCellRenderer { String text = tree.convertValueToText(value.toString(), selected, expanded, leaf, row, hasFocus); SimpleTextAttributes simpleTextAttributes = getSimpleTextAttributes(node, presentation.getForcedTextForeground() != null ? presentation.getForcedTextForeground() : color); append(text, simpleTextAttributes); + String location = presentation.getLocationString(); + if (!StringUtil.isEmpty(location)) { + SimpleTextAttributes attributes = SimpleTextAttributes.merge(simpleTextAttributes, SimpleTextAttributes.GRAY_ATTRIBUTES); + append(presentation.getLocationPrefix() + location + presentation.getLocationSuffix(), attributes, false); + } } else { boolean first = true; @@ -82,11 +87,10 @@ public class NodeRenderer extends ColoredTreeCellRenderer { boolean isMain = simpleTextAttributes != SimpleTextAttributes.GRAYED_ATTRIBUTES; append(each.getText(), simpleTextAttributes, isMain); } - } - - final String location = presentation.getLocationString(); - if (!StringUtil.isEmpty(location)) { - append(presentation.getLocationPrefix() + location + presentation.getLocationSuffix(), SimpleTextAttributes.GRAY_ATTRIBUTES, false); + String location = presentation.getLocationString(); + if (!StringUtil.isEmpty(location)) { + append(presentation.getLocationPrefix() + location + presentation.getLocationSuffix(), SimpleTextAttributes.GRAY_ATTRIBUTES, false); + } } setToolTipText(presentation.getTooltip()); @@ -119,7 +123,7 @@ public class NodeRenderer extends ColoredTreeCellRenderer { return addColorToSimpleTextAttributes(simpleTextAttributes, color); } - private SimpleTextAttributes addColorToSimpleTextAttributes(SimpleTextAttributes simpleTextAttributes, Color color) { + private static SimpleTextAttributes addColorToSimpleTextAttributes(SimpleTextAttributes simpleTextAttributes, Color color) { if (color != null) { final TextAttributes textAttributes = simpleTextAttributes.toTextAttributes(); textAttributes.setForegroundColor(color); |