Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Providing content/input assist via a table editor?
Providing content/input assist via a table editor? [message #631064] Wed, 06 October 2010 04:14 Go to next message
No real name is currently offline No real nameFriend
Messages: 101
Registered: August 2010
Senior Member
Say I have a Xtext grammar which allows me to enter 2D arrays as follows:

DataSheet x[3][3] = { [label1, label2, label3],
[10.0, 5.0, 2.0],
[0.84, 0.2, -0.44] };


Now this matrix could have lots of rows and/or the user may need to change specific cells often. Rather, than searching through the matrix, I want to provide a Table editor that can be used to create/edit this DataSheet block. When the user closes the table editor, all the matrix content gets formatted/updated using the Xtext grammar.

So when the user starts typing 'DataSheet', there should be an option where he/she can switch to a TableEditor window (which blocks the rest of the Eclipse window upon focus), supply the values there, close the window (and now Eclipse is back to focus), and see the code above. Is it possible to do this in Xtext?

Of course I will write the java code for the table editor but how to integrate it into the Xtext editor? Thanks for any ideas.
Re: Providing content/input assist via a table editor? [message #631621 is a reply to message #631064] Fri, 08 October 2010 08:34 Go to previous message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
I am sure this could be done, but it won't be easy.

You could register an IAutoEditStrategy to trigger the opening of the
table editor, then take the live model from the running editor and apply
the changes made in your able editor using the IDocumentEditor API.

See the domainmodel example for auto-edit and the GMF example for
reconciling an Xtext editor with changes on the semantic model.

Am 06.10.10 06:14, schrieb pgbackup@yahoo.com:
> Say I have a Xtext grammar which allows me to enter 2D arrays as follows:
>
>
> DataSheet x[3][3] = { [label1, label2, label3],
> [10.0, 5.0, 2.0],
> [0.84, 0.2, -0.44] };
>
>
> Now this matrix could have lots of rows and/or the user may need to
> change specific cells often. Rather, than searching through the matrix,
> I want to provide a Table editor that can be used to create/edit this
> DataSheet block. When the user closes the table editor, all the matrix
> content gets formatted/updated using the Xtext grammar.
>
> So when the user starts typing 'DataSheet', there should be an option
> where he/she can switch to a TableEditor window (which blocks the rest
> of the Eclipse window upon focus), supply the values there, close the
> window (and now Eclipse is back to focus), and see the code above. Is it
> possible to do this in Xtext?
> Of course I will write the java code for the table editor but how to
> integrate it into the Xtext editor? Thanks for any ideas.


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


---
Get professional support from the Xtext committers at www.typefox.io
Previous Topic:Selecting extension point in eclipse
Next Topic:manipulate textual model
Goto Forum:
  


Current Time: Fri Apr 26 05:01:42 GMT 2024

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

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

Back to the top