Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XtextCellEditor usable in a JFace Tableviewer?
XtextCellEditor usable in a JFace Tableviewer? [message #690771] Thu, 30 June 2011 07:54 Go to next message
Daniel Trierweiler is currently offline Daniel TrierweilerFriend
Messages: 67
Registered: June 2011
Member
Hey guys,

sorry that I opened up a new thread, but since there are no answers I thought it would be good to specify the problem a bit more.

I used the XtextCellEditor provided here hxxp://ftp.itemis.de/eclipse_magazin/tmfgmf and integrated it into a Tableviewer as the default CellEditor in an EditingSupport Class.
But now I've got the problem, that this celleditor is like a full blown Xtext editor (which makes totally sense the way I implemented it), but this is not what I had in mind.
I would need a Tableviewer which integrates with Xtext in a way, that I could use the content assist all over the table, not just for one cell. Lets say a new row for each EObject and a new Cell for each EAttribute or something like that. I looked into the ContentProvider for the Tableviewer, but from my understanding this is not possible.
I hope someone has some thoughts on this and wants to share them Smile

Thanks and best regards!
Daniel
Re: XtextCellEditor usable in a JFace Tableviewer? [message #692346 is a reply to message #690771] Mon, 04 July 2011 09:14 Go to previous messageGo to next message
Andreas Muelder is currently offline Andreas MuelderFriend
Messages: 73
Registered: July 2011
Member
Hey Daniel,
really cool that you are using our XtextCellEditor implementation.
The example code of the article is outdated, you should use the updated code from the YAKINDU statechart project.

I don't know if I understand your problem, what do you mean with 'content assist all over the table'? If you want to reference objects outside the cell you are working in, you have to create a ScopeProvider for that.

In the Statechart Tools, you can find examples on how to scope elements that are outside of the CellEditors content. I.E, we can refer Events and Variables from a Transition.

I hope this helps. If not, maybe you can describe your problem in more detail?

Greets,
Andreas




Re: XtextCellEditor usable in a JFace Tableviewer? [message #692389 is a reply to message #692346] Mon, 04 July 2011 11:05 Go to previous messageGo to next message
Daniel Trierweiler is currently offline Daniel TrierweilerFriend
Messages: 67
Registered: June 2011
Member
Hi Andreas,

thanks for your reply Smile
The main problem is, that I want to use a TableViewer for the editing of a textual model representation. This would mean, that the model is split over the whole table, and the table itself contains the complete model.
Now when I implement your XtextCellEditor in the EditingSupport Class, it will provide a Xtext Editor for a single cell. I could write the model into this single cell with content assists etc. but I can not use those features for the table, because every cell has its own instance of the CellEditor. This is usefull for the example in the Article from the Eclipse Magazine, but IMHO not for a TableViewer.

Any input is still welcome Smile
Re: XtextCellEditor usable in a JFace Tableviewer? [message #692394 is a reply to message #692389] Mon, 04 July 2011 11:13 Go to previous messageGo to next message
Daniel Trierweiler is currently offline Daniel TrierweilerFriend
Messages: 67
Registered: June 2011
Member
To specifiy it a bit more, just have a look at the statemachine example http://www.eclipse.org/Xtext/documentation/2_0_0/020-grammar-language.php#statemachine

Lets say I want to edit the
state active
  drawOpened => waitingForLight
  lightOn    => waitingForDraw
end

in the Table. This would result in 3 rows.
First row defines the state: "active"
The second row is like: "drawOpened", "waitingForLight"
and the thirs row: "lightOn", "waitingForDraw"

And now I want the content assist for these entries. This is what I mean by having the Xtext Editor over the whole Table Smile
I hope it is a bit clearer right now.

[Updated on: Mon, 04 July 2011 11:14]

Report message to a moderator

Re: XtextCellEditor usable in a JFace Tableviewer? [message #695742 is a reply to message #692394] Tue, 12 July 2011 13:01 Go to previous messageGo to next message
Andreas Muelder is currently offline Andreas MuelderFriend
Messages: 73
Registered: July 2011
Member
Hi Daniel,
sorry for my late reply, I am new to this forum and something with my notification settings went terribly wrong :-/
I don't know if our cell editor is sufficient for this use case. what you can do is map a CellEditor to a special EntryRule.
for example, if you map your cell editor in row 2 to the EntryRule 'Event', it is only possible to specify events in this row. The
code completion will only provide proposals for the events, too.
How you can do that is described in detail in our article for the german eclipse magazin. You can write me an email (andreas . muelder @itemis.de)
and I will send it to you as a PDF, assumed you understand german Wink









Re: XtextCellEditor usable in a JFace Tableviewer? [message #696035 is a reply to message #695742] Wed, 13 July 2011 06:40 Go to previous message
Daniel Trierweiler is currently offline Daniel TrierweilerFriend
Messages: 67
Registered: June 2011
Member
You've got mail Smile
Previous Topic:NullPointerException in LazyLinker: EPackage is null for EClass from no-namespace XML model
Next Topic:Beginner problem
Goto Forum:
  


Current Time: Thu Mar 28 23:34:45 GMT 2024

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

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

Back to the top