[EMF Forms] Custom table control [message #1698907] |
Thu, 18 June 2015 12:15  |
Eclipse User |
|
|
|
Hey,
i want to change the behaviour of the table control renderer. For example i would like to add a column with checkboxes (instead of true/false), a column which content is created from referenced ecore data and values that can be changed inside the table without opening it in a new dialogue. Is there any way to do stuff like this in the model/genmodel ? And if not where should i start changing the table control render? Is it necessary to change the table domain model reference?
Is there a tutorial containing information about this?
Thanks in advance for any hints and help.
Greetings,
Tobi
|
|
|
Re: [EMF Forms] Custom table control [message #1698969 is a reply to message #1698907] |
Fri, 19 June 2015 04:29  |
Eclipse User |
|
|
|
Hi Tobi,
to get checkboxes instead of true/false, open the emfforms update site: EMF Forms Features -> EMFForms Table UI SWT Additional Cell Editors (non-RAP)
This feature is available since 1.6.
For everything else:
As far as I understand it, you want to change the way specific features are rendered inside a table.
To do so on a plain SWT Table you would need to provide CellEditors. You can do the same with EMFForms.
You will need 2 classes:
The CellEditor: It must extend the CellEditor (or a subclass of it) and the ECPCellEditor
The Tester: it must extends ECPCellEditorTester
The tester is used for determining which cell editor should be used, this way you can provide very specific cell renderer.
Then you have to provide those using the "org.eclipse.emf.ecp.edit.swt.cellEditor" extension point.
You can look at the implementation of the checkbox cell editor here: https://git.eclipse.org/c/emfclient/org.eclipse.emf.ecp.core.git/tree/bundles/org.eclipse.emf.ecp.view.table.celleditor.rcp
I don't really get this part: "values that can be changed inside the table without opening it in a new dialogue" .
The Table always allows inline editing. You need to select the row and then click inside a cell. The cell will probably change a bit the way it looks and thus get into an editable state.
You can additionally activate the option to edit the values in a dialog.
I think we don't have a tutorial about customizing tables yet.
Cheers,
Eugen
|
|
|
Powered by
FUDForum. Page generated in 0.25234 seconds