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.
Summary: | Custom icons and Categories for Update Centers | ||
---|---|---|---|
Product: | platform | Reporter: | andybob <andybob> |
Component: | Autoupdate | Assignee: | Jaroslav Tulach <jtulach> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | apireviews, jglick |
Priority: | P1 | Keywords: | API_REVIEW_FAST |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | 193944 | ||
Bug Blocks: | |||
Attachments: |
sample layer for individual autoupdate category
Patch against nightly 201011210001 Adding support for categoryIconBase attribute New patch, together with needed changes for 193944 |
Description
andybob
2010-04-09 14:58:05 UTC
Of course! if you provide a patch with implementation. I did some quick research and I think it is possible if we get rid off"org.netbeans.api.autoupdate.UpdateUnitProvider.CATEGORY" from "Auto Update Services" in some way. This enum blocks dynamic generation of new categories and icons. In a first test I replaced it by a simple class implementing name() and valueOf() methods. Than I created a new Category "PORTAL" in layer only and could change the icon successfully. I do not have a patch, yet, but a (first) screen shot is in my blog (german only): http://blog.nigjo.de/netbeans/2010/11/eigene-icons-im-updatecenter/ Thanks for your work (future and also done so far)! I cannot easily turn CATEGORY into class, that would not be backward compatible. But if you provide a patch based on CATEGORY being a class, I can find a way to make it work and remain compatible. Reopen when you attach your work. Created attachment 103095 [details]
sample layer for individual autoupdate category
I successfully installed my first update center with an individual category icon. To do so i had to define a new folder inside the layer. My choice was "/Services/AutoupdateCategory". Any other suggestions?
Created attachment 103162 [details]
Patch against nightly 201011210001
The changes should work in 6.9 too.
They WILL break every module depending on special enum Features like the ordinal. The methods "name", "valueOf" and "values" are implemented so no problem exists here.
The "ordinal" of the enum is no longer suitable because of the dynamic creation of categories, so I think this will not be a problem.
Thanks, nice work. I'll keep an eye on it. Created attachment 103272 [details]
Adding support for categoryIconBase attribute
Please verify my patch satisfies your needs. If so, I can integrate it on Nov 30, 2010.
[JG01] Should be documented that getSourceIcon and getSourceDescription may return null and what that means. (Recommend using @CheckForNull.) [JG02] Shouldn't CATEGORY itself be deprecated, since it appears that all its referring elements are to be deprecated? The Icon shows up correctly if I set "categoryIconBase" for my update center. Nice work. But there seems to be a problem with the category itself. I still can enter "STANDARD", "BETA", "COMMUNITY" only. If I try to set an individual "display name" into "category" for the first time I got an Exception which I can't reproduce at the moment. But nether I put into the "category" attribute the UI shows only "COMMUNITY" for the modules of my update center. Sorry for the delay, but I have found no time before that. All tests are done with a local NBM file. [NI01] I got another Exception: It will occure when a "categoryIconBase" is set but no "category". The assert in the ProviderCategory constructor will throw the exception. In this case the problem is in AutoupdateCatalogFactory (around line 135: pc = ProviderCategory.create(categoryIconBase, categoryName); "categoryName" may be null. [NI02] When I uninstall the UpdateCenter Module the corresponting entry in the List of knonw centers will still be there (Maybe another bug [NI02a]). After restart the IDE you got another NPE in SettingsTab.UpdateProviderRenderer. The "UpdateUnitProvider" returns null because the icon can't be found no longer. (see [JG01]) [NI03] A mentioned in JG01 and NI02 the main problem for the UI is, that now "null" values can be returned by UnitProviders. This should be handled properly. Created attachment 104652 [details]
New patch, together with needed changes for 193944
I have not addressed JG02. CATEGORY is still OK to be used I think. Otherwise I hope I addressed the rest of your comments. To be integrated on Jan 10, 2011, if there are no objections. works well for me. Just two minor hints: * The patch is missing the relocation of the icon files. This will result in an StackOverflowError. Your old patch does contain this relocation. * "apichanges.xml" contains the "old" date and attribute name. I have forgotten to use hg diff --git, thus the missing relocation. Thanks for verification. I'll fix the date and integrate on Jan 10, 2011 (if I don't forget). I'll integrate on Monday. ergonomics#a5105892b931 Integrated into 'main-golden', will be available in build *201101110000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/a5105892b931 User: Jaroslav Tulach <jtulach@netbeans.org> Log: #183778: Custom icons and Categories for Update Centers |