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.

Bug 18832 - Allow the specification of badged icon via layer
Summary: Allow the specification of badged icon via layer
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: All All
: P4 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2001-12-19 22:43 UTC by Rochelle Raccah
Modified: 2008-12-23 00:06 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Possible patch (untested) (3.67 KB, patch)
2001-12-20 00:23 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rochelle Raccah 2001-12-19 22:43:28 UTC
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.
Comment 1 Jesse Glick 2001-12-20 00:22:28 UTC
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.
Comment 2 Jesse Glick 2001-12-20 00:23:48 UTC
Created attachment 3901 [details]
Possible patch (untested)
Comment 3 Rochelle Raccah 2001-12-20 03:10:09 UTC
So would the syntax be
 <attr name="SystemFileSystem.icon"  
methodValue="mypackage.MyClass.myStaticMethodWhichReturnsAnImage">

That sounds good!  Is this in the release_33 branch?
Comment 4 Jesse Glick 2002-02-20 11:28:12 UTC
It is in no branch, it is a proposed patch only.
Comment 5 Rochelle Raccah 2002-02-20 19:42:12 UTC
Why not apply it to the trunk now that we're in a new release cycle?
Comment 6 Jesse Glick 2002-02-20 21:52:04 UTC
I suppose so.
Comment 7 Jesse Glick 2002-02-28 12:41:48 UTC
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


Comment 8 Quality Engineering 2003-07-01 15:49:49 UTC
Resolved for 3.4.x or earlier, no new info since then -> verified
Comment 9 Quality Engineering 2003-07-01 16:33:05 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.