distinguish annotation interfaces in Ctrl-hover popup (IDEADEV-40633)
[fedora-idea.git] / java / idea-ui / src / com / intellij / jar / JarPackagingTreeBuilder.java
blob3886ad70e71e0d1df73c40e6f6553352550234d5
1 package com.intellij.jar;
3 import com.intellij.openapi.deployment.ContainerElement;
4 import com.intellij.openapi.module.Module;
5 import com.intellij.openapi.roots.ui.configuration.packaging.PackagingArtifact;
6 import com.intellij.openapi.roots.ui.configuration.packaging.PackagingTreeBuilder;
7 import com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable;
8 import com.intellij.ui.ColoredTreeCellRenderer;
9 import com.intellij.ui.SimpleTextAttributes;
10 import com.intellij.util.Icons;
11 import org.jetbrains.annotations.NotNull;
12 import org.jetbrains.annotations.Nullable;
14 /**
15 * @author nik
17 public class JarPackagingTreeBuilder extends PackagingTreeBuilder {
18 private final Module myModule;
20 public JarPackagingTreeBuilder(final Module module) {
21 myModule = module;
24 public PackagingArtifact createRootArtifact() {
25 return new PackagingArtifact() {
26 @NotNull
27 @Override
28 public String getOutputFileName() {
29 return myModule.getName();
32 @Override
33 public void render(@NotNull final ColoredTreeCellRenderer renderer, final SimpleTextAttributes mainAttributes, final SimpleTextAttributes commentAttributes) {
34 renderer.setIcon(Icons.JAR_ICON);
35 renderer.append(myModule.getName() + ".jar", mainAttributes);
38 @Override
39 public void navigate(final ModuleStructureConfigurable configurable, @Nullable final ContainerElement element) {
42 @Override
43 public String getDisplayName() {
44 return myModule.getName();