Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF Parsley » Add a column to a Table(Can I add a column to a table through the DSL)
Add a column to a Table [message #1691326] Mon, 06 April 2015 04:02 Go to next message
John Conlon is currently offline John ConlonFriend
Messages: 35
Registered: July 2009
Member
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 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1751
Registered: July 2009
Location: Firenze, Italy
Senior Member
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
Re: Add a column to a Table [message #1691507 is a reply to message #1691481] Tue, 07 April 2015 16:48 Go to previous message
John Conlon is currently offline John ConlonFriend
Messages: 35
Registered: July 2009
Member
Hi Lorenzo,

Sure that sounds good. I just wanted to make sure I was not missing something...

thanks,
John
Previous Topic:Can't create a Parsley Project
Next Topic:Problem showing Derived Features
Goto Forum:
  


Current Time: Sun Oct 21 20:45:16 GMT 2018

Powered by FUDForum. Page generated in 0.01559 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top