Currently actions added to dockables appear in two different views: as buttons at the corner of the dockable, and inside a pop-up whenever you right-click on the dockable tab.
Is it possible to add actions that would appear only inside the pop-up (i.e. whenever you right-click on the dockable tab)?
In other words, is it possible to access that pop-up and manipulate its content, to say add more menu items to it?
Every DockAction has a method “createView”. You could create an action that just returns “null” if the “target” is something else then a “ViewTarget.MENU”. The framework should support missing views, and not throw a NullPointerException.
You would still need to add these actions to the Dockable - like any other action - they would just be invisible most of the time.
If using Common you would still need to create new DockActions (subclassing some existing CommonDockActions) and then create new CActions, e.g. by calling the “init” method with your new actions.
Perhaps what you suggested above does the trick, but still, I would like to know if it is possible to access the pop-up directly and manipulate its content.
There is a method “DockController.setPopupMenuFactory”. You can implement a custom “ActionPopupMenu” and “ActionPopupMenuFactory”. This way you take complete control of the menu and its behavior.
The default implementation - DefaultActionPopupMenu - is not extendable, but you could copy its code and add methods to modify/insert items wherever you want.