How show action item to context menu, but not tollbar? Follow
Answered
Hi,
I have action
public class MyAction extends FileChooserAction { /*...*/ }
and programmaticaly registration
DefaultActionGroup group = (DefaultActionGroup) actionManager.getAction("FileChooserToolbar");
group.add(new MyAction());
My custom action buttons add to toolbar modal dialog window and to context menu on right click mouse. How can I show buttons only in context menu or only toolbar?
Thanks
Please sign in to leave a comment.
You can check `AnActionEvent#isFromActionToolbar` and `AnActionEvent#isFromContextMenu`. (and `AnActionEvent#getPlace` to differentiate between different toolbars)
Aleksey means you should add some checks in update() method to update enabled/visible flags in presentation of AnActionEvent
Thanks!!!