Cross referencing [message #649087] |
Mon, 17 January 2011 15:27 |
Jesse Messages: 10 Registered: January 2011 |
Junior Member |
|
|
Hi,
I've tried creating a new XText Project using an existing Ecore Model (org.eclipse.e4.ui.model.workbench to be exact) and I've come across a number of issues. Some of them I've been able to solve with some additional help, but there's one particular issue we haven't been able to solve...
I understand that in order to cross-reference objects you need to use the "name" attribute, but in e4 the unique ID's are all "elementId"s. I'm having some trouble trying to figure out a way to cross-reference objects using the "elementId" attribute. XText DOES generate the "elementId" attributes for all Objects, but I just can't reference them unless I use the "name" attribute.
Here is an example:
// Handler requires a reference to a Command Object
Handler returns commands::Handler:
'Handler'
'{'
('elementId' elementId=EString)?
('tags' '{' tags+=EString ( "," tags+=EString)* '}' )?
('contributorURI' contributorURI=EString)?
('contributionURI' contributionURI=EString)?
'command' command=[commands::Command|EString]
('persistedState' '{' persistedState+=StringToStringMap ( "," persistedState+=StringToStringMap)* '}' )?
'}';
// Commands SHOULD be able to be referenced by their unique
// "elementId" attribute, but this doesn't seem to work. I can't
// even assign it a "name" attribute either because Xtext will tell me
// "Cannot find compatible feature name in sealed EClass Command
// from imported package http://...."
Command returns commands::Command:
{commands::Command}
'Command'
//name=EString
//elementId=EString
'{'
('elementId' elementId=EString)?
('tags' '{' tags+=EString ( "," tags+=EString)* '}' )?
('contributorURI' contributorURI=EString)?
('commandName' commandName=EString)?
('description' description=EString)?
('category' category=[commands::Category|EString])?
('parameters' '{' parameters+=CommandParameter ( "," parameters+=CommandParameter)* '}' )?
'}';
If anyone has any idea on how to solve this issue, any insight would be greatly appreciated.
Thanks.
- Jesse
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02993 seconds