mohit chilkoti wrote:
I don't want to make corresponding menu-items for every toolbar button to achieve this.
Why? What problem are you trying to avoid by taking this approach?
In theory, I suppose you can achieve it by using key bindings. But that is a horrible design in my opinion.
The accelerators are for the buttons/menus. It makes sense to have the accelerator code with those items.
Usually the toolbar displays visual representation of items, which are already present with in the menu bar.
Then it makes even more sense to have similar items share the same subclassed AbstractAction