Hi Stephan,
As Dirk said on the forum, yes we implemented a such feature for Papyrus.
The method org.eclipse.papyrus.infra.nattable.manager.table.NattableModelManager.invertAxis() is called by the handler
org.eclipse.papyrus.infra.nattable.handler.InvertAxisHandler to invert user table.
This method just change a Boolean value in our table model, then the listener created by the method org.eclipse.papyrus.infra.nattable.manager.table.NattableModelManager.createInvertAxisListener() is in charge
to exchange the rows lists and the columns lists and others values
in the java classes. Then we need to re-set the whole configuration of NatTable (cell editors are now declared by rows and not by columns, label providers, comparators, filters, ...).
This feature is one of the more complex of our NatTable integration and it works only for "flat" table (we don’t know how to invert tree table yet).
Now, if we have to rewrite this feature in the future, we will try to adapt/complete the NatTable layer
org.eclipse.nebula.widgets.nattable.layer.InvertedLayer, because we think it will be more clean and more efficient.
Regards,
--
Vincent Lorenzo
-----Message d'origine-----
De : mdt-papyrus.dev-bounces@xxxxxxxxxxx [mailto:mdt-papyrus.dev-bounces@xxxxxxxxxxx] De la part de Stephan Druskat
Envoyé : dimanche 29 janvier 2017 20:29
À : mdt-papyrus.dev@xxxxxxxxxxx
Objet : [mdt-papyrus.dev] Experiences with transposing a NatTable widget
Dear List,
I know precious little about Papyrus (yet), but was pointed towards the project by Dirk Fauth, the project lead of Nebula NatTable.
He mentioned in a forum post
(https://www.eclipse.org/forums/index.php?t=msg&th=805042&goto=1751153&#msg_1751153),
that Papyrus has successfully managed to transpose a NatTable widget, i.e. swap rows and columns.
As I'm looking forward to using a NatTable widget in my application in such a manner (i.e., have "data points" in columns, and "categories" in rows to use some more abstract terms), would anybody on here be able to point me towards the
Papyrus code base where this has been done, e.g., the GUI class containing the NatTable widget as a starting point?
I'd also be very happy, of course, if anybody who has been working on the transpose feature could shed a little extra light on this in terms of what work has to be done on, for example, the data provider in order to achieve the wanted
functionality!
Many thanks indeed and a good start to the week Stephan
--
orcid.org/0000-0003-4925-7248
Research Software Engineer, MelaTAMP Research Project Dept. of German Studies and Linguistics Humboldt-Universität zu Berlin
Office: Dorotheenstr. 24, room 3.311
Office hrs: Tue 9-14, Wed 9-17, Fri 9-14
Phone: +49-(0)30-2093-9726
Postal address: Unter den Linden 6, 10099 Berlin, Germany