This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
It's a shame that badged icons must be hardcoded to be used in an xml layer. This requires extra maintenance if the main icon changes. Therefore, badging should be possible for the icon. Suggestion: Use a .instance mechanism to point to a class which badges the icon in its code.
I don't see any clean syntax for this. The icon must be given as a URL. Normally this is a urlvalue="nbresloc:/...". However you can already give it methodvalue="some.Class.method" which will be a static method expected to return a URL to the image. You can implement it to create some image and return a URL. However this would mean your own URL protocol handler, or else saving a temp GIF somewhere and using file:, both of which are ugly. So possible enhancement: value of attr SystemFileSystem.icon (also .icon32) may be a java.awt.Image rather than URL. Then the method could create it.
Created attachment 3901 [details] Possible patch (untested)
So would the syntax be <attr name="SystemFileSystem.icon" methodValue="mypackage.MyClass.myStaticMethodWhichReturnsAnImage"> That sounds good! Is this in the release_33 branch?
It is in no branch, it is a proposed patch only.
Why not apply it to the trunk now that we're in a new release cycle?
I suppose so.
Implemented. For example usage, see layer.xml and Util.java in the core/test/unit/src/org/netbeans/core/projects/data/sfs-attr-test/sfs_attr_test/ directory in CVS. committed * Up-To-Date 1.7 apisupport/src/org/netbeans/modules/apisupport/layers/MiscPropEds.java committed * Up-To-Date 1.8 apisupport/src/org/netbeans/modules/apisupport/layers/WritableXMLFileSystem.java committed * UpIn committed * Up-To-Date 1.71 openide/api/doc/org/openide/modules/doc-files/api.html directory core/test: committed * Up-To-Date 1.30 core/test/build.xml committed * Up-To-Date 1.16 core/test/cfg-unit.xml In directory core/test/unit: In directory core/test/unit/src: In directory core/test/unit/src/org: In directory core/test/unit/src/org/netbeans: In directory core/test/unit/src/org/netbeans/core: In directory core/test/unit/src/org/netbeans/core/projects: added * Up-To-Date 1.1 core/test/unit/src/org/netbeans/core/projects/SystemFileSystemTest.java added * Up-To-Date 1.1 core/test/unit/src/org/netbeans/core/projects/build.xml In directory core/test/unit/src/org/netbeans/core/projects/data: added * Up-To-Date 1.1 core/test/unit/src/org/netbeans/core/projects/data/.cvsignore added * Up-To-Date 1.1 core/test/unit/src/org/netbeans/core/projects/data/sfs-attr-test.mf In directory core/test/unit/src/org/netbeans/core/projects/data/sfs-attr-test: In directory core/test/unit/src/org/netbeans/core/projects/data/sfs-attr-test/sfs_attr_test: added * Up-To-Date 1.1 core/test/unit/src/org/netbeans/core/projects/data/sfs-attr-test/sfs_attr_test/Bundle.properties added * Up-To-Date 1.1 core/test/unit/src/org/netbeans/core/projects/data/sfs-attr-test/sfs_attr_test/Util.java added * Up-To-Date 1.1 core/test/unit/src/org/netbeans/core/projects/data/sfs-attr-test/sfs_attr_test/badge.gif added * Up-To-Date 1.1 core/test/unit/src/org/netbeans/core/projects/data/sfs-attr-test/sfs_attr_test/layer.xml added * Up-To-Date 1.1 core/test/unit/src/org/netbeans/core/projects/data/sfs-attr-test/sfs_attr_test/main-plus-badge.gif added * Up-To-Date 1.1 core/test/unit/src/org/netbeans/core/projects/data/sfs-attr-test/sfs_attr_test/main.gif -To-Date 1.26 core/src/org/netbeans/core/projects/SystemFileSystem.java
Resolved for 3.4.x or earlier, no new info since then -> verified
Resolved for 3.4.x or earlier, no new info since then -> closing.