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.
NB uses "low color saturation" icons for disabled buttons in toolbar and menu. It would be nice and more consistent if such icons would be used also for other disabled buttons instead of default grayed icons. New method for conversion is needed in ImageUtilities.
Created attachment 87046 [details] diff
Please review.
Good. Consider pushing the Swing team to make AbstractButton use something similar. Last I checked their implementation of disabled icons only handles ImageIcon and just does nothing if you pass in any other Icon implementation. [JG01] The condition icon == null || !(icon instanceof Icon) is just a verbose way of saying !(icon instanceof Icon) [JG02] Unsynchronized lazy initialization of DISABLED_BUTTON_FILTER is potentially incorrect; just make it a final constant. Init of disabledIcon is also suspect, unless you are positive this is called only from EQ (in which case add an assertion to that effect). BTW tip: when writing apichanges.xml entries in a diff for review, better to set the <date> to the date on which you expect the review to close, say 7 days from when it was opened. Otherwise you are liable to forget and leave the wrong date in.
Y01 I am slightly surprised that createDisabledIcon takes Image and returns Icon. Slightly unintuitive. Would not it be better (symmetric, intuitive, nicer) to have two: public static Image createDisabledImage(Image) public static Icon createDisabledIcon(Icon) as far as I remember we also have dual Image+Icon objects with easy convertibility so the implementation shall not be less effective.
Created attachment 87099 [details] Thanks, updated patch with suggestions + Actions update
core-main #9ce2679e8a86
Integrated into 'main-golden', will be available in build *200909111401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/9ce2679e8a86 User: Tomas Holy <t_h@netbeans.org> Log: #171400: API for creation of low color saturation icons for disabled buttons