Bug 535907

Summary: [TableControlRenderer] Make action bar extensible so new actions can be introduced more easily
Product: [Modeling] ECP Reporter: Mat Hansen <eclipse.org.list>
Component: EMF FormsAssignee: Mat Hansen <eclipse.org.list>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: lkoehler
Version: 1.17.0Keywords: test
Target Milestone: 1.18.0   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/124542
https://git.eclipse.org/r/124993
https://git.eclipse.org/c/emfclient/org.eclipse.emf.ecp.core.git/commit/?id=36075f2014194a6bc50c881ea57bcd5a32dbef39
https://git.eclipse.org/r/126629
https://git.eclipse.org/c/emfclient/org.eclipse.emf.ecp.core.git/commit/?id=3418c1144cb1126d7f6275a0cb6d8b8a0619e347
https://git.eclipse.org/r/127714
https://git.eclipse.org/c/emfclient/org.eclipse.emf.ecp.core.git/commit/?id=66a6aa053a8ccee337dd9f031538264f7c1af4a8
Whiteboard:

Description Mat Hansen CLA 2018-06-14 09:38:11 EDT

    
Comment 1 Eclipse Genie CLA 2018-06-14 09:55:05 EDT
New Gerrit change created: https://git.eclipse.org/r/124542
Comment 2 Eclipse Genie CLA 2018-06-25 11:46:39 EDT
New Gerrit change created: https://git.eclipse.org/r/124993
Comment 4 Eclipse Genie CLA 2018-07-25 18:50:11 EDT
New Gerrit change created: https://git.eclipse.org/r/126629
Comment 6 Lucas Koehler CLA 2018-07-26 05:43:08 EDT
TEST INFORMATION

Note: All changes mentioned for the table renderer also apply to the grid renderers. The explicit mention is just omitted to improve readability.

Summary of the critical part of the change

The table renderer's buttons to add, remove, and move items of a table are no longer hard coded in the table. Instead, a new ActionBar and ActionConfiguration mechanism was introduced. An ActionConfiguration allows to define actions for a table viewer. For each action, it can be defined whether a control (e.g. a button) should be rendered and/or if the action should be bound to one or more keyboard shortcuts.
Such an ActionBar and ActionConfiguration can be configured for any table viewer swt builder. These are then used by the AbstractTableViewerComposite to generate the action buttons and bind the actions' keybindings (This also applies for the grid builder and composite).

For the configuration of keybindings outside of the source code, a new view template style (VTKeyBindings) was introduced.

A concrete change in the behavior of actions occurred for the move up and move down actions of a table: The corresponding buttons are now disabled if the selected item(s) cannot be moved up or down (because they are already at the top/bottom).

For the default actions of a table renderer, no keybindings were configured.


Potential regressions

Custom implementations of table renderers that extend the buttons of a table could run into conflict with the new mechanism. Please make sure this does not happen. If it does consider adding the needed mechanism as actions by overriding TableControlSWTRender#configureActions.

The change in the move up/down enablement behavior could break unit or UI test cases.


Affected areas / use cases

Rendering of tables or creating tables with EMF Forms's table builder. Concretly, defining actions that can be executed on the table viewer


Things that shall be tested

All buttons are still shown as expected (Especially custom buttons)
All actions are executed as expected when clicking the buttons
Comment 7 Eclipse Genie CLA 2018-08-20 09:59:02 EDT
New Gerrit change created: https://git.eclipse.org/r/127714