Hi all,
i just decided to switch from FlexDock to DockingFrames.
While i was converting my project, i stumpled upon the actions.
They are not compatible to the usual actions used in swing.
If i extend a CButton and override it’s action() method i’m missing the ActionEvent which tells me who is the ‘source’ for this action. So, for example, if i wand to popup a menu and have the ‘source’ i can decide on which position to pop up the menu. And also the JPopupMenu needs a parent component for showing up.
But since the action() method doesn’t present me any information, i can’t show any popup menu.
Am i right? Is there any possibility to get the info, from which dockable this action is called?
Thanks in advance for any suggestion!
Greetings, -chris-
Because there is no unified way how actions are displayed, I never included any way to find out where the user clicked with the mouse.
You did notice that CMenu and CDropDownButton both provide a popup-menu (or a sub-menu), which can be filled with other actions?
Under the assumption you need something else: The Nodes-Demo uses a custom action to popup a panel displaying a grid full of Icons. This is done by modifying the DockThemes and implementing a new ViewGenerator. You could copy together a new kind of action for yourself, starting with the classes “IconAction” and “IconButtonHandler” you should be able to find all related classes. I can give you more information if this is the way you would like to go.
Or if you have the time to wait a week I’ll add a little “custom-popup-action” which allows custom popups.