Re: Different icons for the files with same mime and different extensions.
Volodymyr <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.openide.devel |
|---|---|
| Message-ID | <[email protected]> |
Yes, I've been using this annotation: @DataObject.Registration( mimeType = MyLanguage.MIME_TYPE, iconBase = " com/my/resources/AIcon.png ", displayName = "#LBL_My_LOADER", position = 300 ) Of course it doesn't allow to specify different icos for different files extensions . 08 липня 2016, 16:38:06, від "Boris Heithecker" < [email protected] >: 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.