Re: Different icons for the files with same mime and different extensions.
Boris Heithecker <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.openide.devel |
|---|---|
| Message-ID | <CAL465REZSf+XsDz3_8OdXpK+_B5MLEE1J7+1j5B9i8FgyL6BCQ@mail.gmail.com> |
It depends. Do you use annotations to register your editor tabs? Boris Am 08.07.2016 14:27 schrieb "Volodymyr" <[email protected]>: > Does anybody know? Please). > > E.g. how does NetBeans know which icon to show here: > > > 3 different icons for .xml file. > > Thanks. > > 07 липня 2016, 16:51:59, від "Volodymyr" <[email protected]>: > > Hello, > > I've got files with .a and .b extensions. They contain source code with > the same language, e.g. > @MIMEResolver.ExtensionRegistration( > displayName = "#LBL_My_LOADER", > mimeType = MyLanguage.MIME_TYPE, > extension = {"a","b"} > ) > > I have a leaf node as follows: > public class MyLeafNode extends FilterNode { > ....... > @Override > public Image getIcon(int type) { > switch(file.getExt()) { > case "a": > return > ImageUtilities.loadImageIcon("com/my/resources/AIcon.png", > false).getImage(); > &nbs p; case "b": > return > ImageUtilities.loadImageIcon("com/my/resources/BIcon.png", > false).getImage(); > default : > return super.getIcon(type); > } > } > ....... > } > > In project view everything works perfect, the icons are displayed > correctly. But when the files are opened, the icons do not get used to > display the tab with file editor. What should I do? > > Thanks. > >