Many applications use 24x24 icons for the toolbar
as a matter of course, as they tend to look much
better than 16x16 icons.
NetBeans (in keeping with javax.swing.Action) does
not directly support such icons; you can override
getToolbarPresenter to create a button with a
bigger button, but this is somewhat cumbersome.
You can also return a 24x24 icon for
Action.SMALL_ICON ~ SystemAction.iconResource, but
this is undesirable as then menu items will look
wrong (they should use only 16x16).
Also I am not sure if the NB toolbars correctly
handle non-default component heights - need to check.
Suggest perhaps adding new attribute name
constants for bigger icons (at least 24x24), and I
guess some option (system property? toolbar config
XML attr?) to try to use the bigger icons in a
toolbar when they are available.
This would permit custom apps (or perhaps NB) to
add bigger icons for common actions and begin
using bigger toolbars, without needing to patch
individual NB action classes (e.g. SaveAction, etc.).
which suggests that a new constant will be added specifically for
See also issue #32256 which is a bit related.
In Promo D we plan to use 24x24 icons in toolbars
- added core-promod to status whiteboard
- changed summary from "Better support 24x24 actions icons" to
"Toolbar icons should be 24x24"
- assigned this to mslama
- increased prio to P2
To support both 16x16 and 24x24 icons in toolbar some API changes are
method public static int getBasicHeight ()
(toolbar height depends on size of icons)
method public int getPreferredIconSize ()
method public void setPreferredIconSize (int preferredIconSize)
(global preferred size of icons used in toolbar buttons)
field public static final int BASIC_HEIGHT = 34;
How can Presenter.Toolbar know about icons size? Method could be added
to this interface but it would mean a lot of changes and it is
incompatible change. We decided to use client property on JComponent
(JButton): Client property "PreferredIconSize" is set to "24" when
24x24 icon should be used. Otherwise 16x16 icon is used. Suffix "24"
is added to icon name eg. cut.gif and cut24.gif icons are provided.
Complete diff is attached.
Created attachment 14836 [details]
Diff of enhancement
Request: Complete diff shall include test for behaviour of Actions.
Similar test have been provided for rollover icons, so just extend it.
Little advice: Use something other than string "24" to signal the size
of the icons. Integer(24)?
Is Integer(20) better than "24"? It is used as value in if clause
anyway. Of course it can be changed.
Extended test diff attached to test test24,gif, test24_pressed.gif,...
Created attachment 14849 [details]
Diff of test
Please object quickly. This issue should be committed tomorrow. I will
change client property value from String("24") to Integer(24).
Created attachment 14950 [details]
Commit log of changes in core and openide
Fixed in trunk.