Add selected context menu items that are currently shown in the schema tree node to the corresponding object's context menu in the Detail Pane. For now, all menu items from the top to "Scripting Options" (not inclusive) will be shown. See attached screenshot.
The approach to implementing this feature is to reuse as much as possible the existing schema tree node context menu building logic and menu item actions; many of these are database-specific or even database-version-specific. Here are a few design notes:
1. The context menu building and menu item actions are closely tied to the "selected" node on the schema tree. For instance, on the schema tree, to obtain the context menu of the "orders" table, the "Tables" folder needs to be expanded and the "orders" table selected.
2. However, the detail pane contents are shown when the parent container node is selected. With the above example, when the "Tables" node selected, the detail pane is populated with the tables. When the detail pane's "orders" row is right-clicked, we need to make the schema tree code know that the "selected" node is actually the "orders" child node of the "Tables" folder (although the "Tables" folder node remains to be displayed as selected on the schema tree).
To achieve the above, I introduced the concept of action node. The action node is passed via the ActionEvent (generated when the menu item action is invoked). I refactored the schema tree context menu building logic and menu item actions to work with the action node instead of the selected node. When a row in the detail pane is right-clicked, the corresponding schema tree child node (e.g. the "orders" node) is set up as the action node (even though the "selected" node is still the "Tables" folder node).
Below are a few implementation details:
1. A pass to reduce the schema tree code dependence on "selected" node is made. Specifically, the passing and keeping schema tree node references have been reduced. For example, the original CEditorPanelView#setLastFolder(CTreeNode) actually just gets the connection properties from the tree node. It has been refactored to CEditorPanelView#setLastFolder(ConnectionProperties) - i.e. tree nodes are no longer passed around.
|
161 KB
@qa - please ensure to cover the following when testing:
1. Test on all databases ADS support, pick schemas that contain as many different object types as possible
2. Verify the functionalities of the actions in the schema node context menu do not regress
2. Verify the added context menu actions in the detail pane function the same as the corresponding actions in the schema node
This issue/feature has been turned off. Uncomment the following line in CTreeNode to re-activate it:
scroll.enablePopupMenu(() -> setupDetailPopupMenu(scroll, m));
This issue/feature has been turned off. Uncomment the following line in CTreeNode to re-activate it:
scroll.enablePopupMenu(() -> setupDetailPopupMenu(scroll, m));
Issue #15435 |
New |
Completion |
No due date |
No fixed build |
No time estimate |
1 issue link |
relates to #13137
Issue #13137Object Search - right click context menu |
@qa - please ensure to cover the following when testing:
1. Test on all databases ADS support, pick schemas that contain as many different object types as possible
2. Verify the functionalities of the actions in the schema node context menu do not regress
2. Verify the added context menu actions in the detail pane function the same as the corresponding actions in the schema node