Add a column to a Table [message #1691326] |
Mon, 06 April 2015 04:02  |
Eclipse User |
|
|
|
I have a table of objects that I would like to add a 'derived' column. Sure I can add a derived attribute in my model, but can I do so directly with the Parsley DSL.
parts {
viewpart com.verticon.im.view.events {
viewname "IM History"
viewclass EventsOnSelectionTableView
}
}
featuresProvider{
features{
Enity -> events
}
}
featureCaptionProvider{
text {
Event : date -> 'Date'
Event : ^target -> 'Target'
}
}
Would like to add a third column with the name 'Name' to the table which is the name of the type of Event.
Can I do this with the DSL?
|
|
|
Re: Add a column to a Table [message #1691481 is a reply to message #1691326] |
Tue, 07 April 2015 14:23   |
Eclipse User |
|
|
|
On 06/04/2015 06:02, John Conlon wrote:
> I have a table of objects that I would like to add a 'derived' column.
> Sure I can add a derived attribute in my model, but can I do so directly
> with the Parsley DSL.
>
> parts {
> viewpart com.verticon.im.view.events {
> viewname "IM History"
> viewclass EventsOnSelectionTableView
> }
> }
>
> featuresProvider{
> features{
> Enity -> events
> }
> }
>
> featureCaptionProvider{
> text {
> Event : date -> 'Date'
> Event : ^target -> 'Target'
> }
> }
>
>
> Would like to add a third column with the name 'Name' to the table which
> is the name of the type of Event.
> Can I do this with the DSL?
Hi John
currently it is not possible to do that with the DSL; at the moment, I
could not come up with a clean solution (in particular, adding a column
header is not that hard, but then we should provide also a way of
specifying the value to be shown in the cell, so this would require to
customize two elements in the end). I think the clean solution is to
have a derived feature in the meta-model as you said yourself.
You could still bind your own custom TableViewerColumnBuilder in Java.
Does that sound good?
cheers
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
|
|
|
|
Powered by
FUDForum. Page generated in 0.07261 seconds