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]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.