I do have access to a DockAction, but its trigger() method requires a parameter of type Dockable element, which unfortunately I don’t have – how do I get a Dockable element?
Yes, I am still working on the design of my glass pane and I am open to options for implementing this feature. Also, this feature needs to be user configurable to enable the application to run with or without the glass pane (e.g. when running without the glass pane components such as buttons interact with a rollover, and tree nodes interact with highlights when a mouse hovers over them regardless if a popup menu is displayed. With the glass pane enabled, these components do not interact with mouse events when a popup menu is showing). The glass pane dispatches the mouse event to the component under the glass pane but uses Swing’s component.dispatchEvent() method (same approach to Oracle example). It’s a bit trickier than I anticipated but achievable.
But the glass pane is not the culprit for my question (although the solution may be related to glass panes); I noticed that when I right click on a DF dockable title bar to trigger a popup menu, (1) the buttons rollover, and (2) the same buttons do not react to a left click (while the popup menu is still showing). At first I thought that I have missed something when coding my dockables. But then I noticed three of DF’s demos (Notes, Size & Color, and Common Layouts) also demonstrate similar behavior.
From observation of Windows Look and Feel, when a popup menu is showing, most if not all, buttons, menus, tabs, tree nodes, fields, etc, are inactive when a mouse hovers over them. Clicking on one of these Windows components (either a press or release, depending on the component), triggers that component to react to the event, and simultaneously closes the popup menu that is showing. Eclipse, too, displays this same Windows behavior for Windows L&F.
I understand that such buttons are intended for the user, and I have used them in this way to define my dockables, but for situations when it is desirable to maintain Window L&F for user experience, is there a way to programmatically control these buttons?
I have a faint hunch that it may be simpler to implement a glass pane when triggering a popup menu from a DF dockable title bar to achieve Windows L&F. If this is the case, would it be possible for you to share a code example of DF GlassedPane implementation to achieve this L&F? Either approaches would be a big help.