distinguish annotation interfaces in Ctrl-hover popup (IDEADEV-40633)
[fedora-idea.git] / java / idea-ui / src / com / intellij / openapi / roots / ui / configuration / packaging / PackedModuleOutputNode.java
blob3515a482f52973b8d82755f15cfef6de927cf644
1 package com.intellij.openapi.roots.ui.configuration.packaging;
3 import com.intellij.openapi.deployment.ModuleLink;
4 import com.intellij.openapi.module.Module;
5 import com.intellij.openapi.project.ProjectBundle;
6 import com.intellij.openapi.util.IconLoader;
7 import com.intellij.ui.ColoredTreeCellRenderer;
8 import com.intellij.ui.SimpleTextAttributes;
9 import org.jetbrains.annotations.NotNull;
11 import javax.swing.*;
13 /**
14 * @author nik
16 class PackedModuleOutputNode extends ModuleOutputBaseNode {
17 private static final Icon MODULE_JAR_ICON = IconLoader.getIcon("/nodes/moduleJar.png");
18 private final String myJarFileName;
20 PackedModuleOutputNode(@NotNull ModuleLink moduleLink, String jarFileName, PackagingArtifact owner) {
21 super(owner, moduleLink);
22 myJarFileName = jarFileName;
25 @NotNull
26 public String getOutputFileName() {
27 return myJarFileName;
30 public void render(@NotNull final ColoredTreeCellRenderer renderer) {
31 Module module = myModuleLink.getModule();
32 renderer.setIcon(MODULE_JAR_ICON);
33 if (module != null) {
34 renderer.append(myJarFileName, getMainAttributes());
35 renderer.append(getComment(module.getName()), getCommentAttributes());
37 else {
38 renderer.append(myJarFileName, SimpleTextAttributes.ERROR_ATTRIBUTES);
39 renderer.append(getComment(myModuleLink.getName()), getCommentAttributes());
43 private static String getComment(final String name) {
44 return " " + ProjectBundle.message("node.text.packed.0.compile.output", name);