return icons in file chooser

This commit is contained in:
Egor.Ushakov
2017-04-11 19:35:21 +03:00
parent 56706c0d45
commit 0c867b619b
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,6 +41,13 @@ public class NodeRenderer extends ColoredTreeCellRenderer {
public void customizeCellRenderer(@NotNull JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
Object node = TreeUtil.getUserObject(value);
if (node instanceof NodeDescriptor) {
NodeDescriptor descriptor = (NodeDescriptor)node;
// TODO: use this color somewhere
Color color = descriptor.getColor();
setIcon(descriptor.getIcon());
}
PresentationData presentation =
node instanceof PresentableNodeDescriptor ? ((PresentableNodeDescriptor)node).getPresentation() :
node instanceof NavigationItem ? ObjectUtils.tryCast(((NavigationItem)node).getPresentation(), PresentationData.class) :