| XtextEditor manipulation [message #1059996] |
Wed, 22 May 2013 09:30  |
Edwin Tuzar Messages: 10 Registered: April 2013 |
Junior Member |
|
|
Hello everyone,
could someone help me with the following problem, please:
I want to be able when I'm pressing in a view (like the outline) on a object from my model to be able to show in the editor only that element + subelements and the rest of the things in the editor I would like to have them collapsed or grayed.
Something like this:
View:
and if I click on Red in the editor should show me:
+myLanguage
Red name id
subelementOfRed name id
subelement2OfRed id
+code
Red name id
subelementOfRed name id
+code
the + is for collapse code
More info: now I have the XtextEditor and the IXtextDocument, I got also the model from : IXTextDocument.readOnly(new IUnitOfWork<Object, XtextResource>()).
But I'm a little stuck of how should I make this thing to collapse in between (I get the right elements from the model)
Thanks in advance!
Edwin W.T.
|
|
|
| Re: XtextEditor manipulation [message #1060017 is a reply to message #1059996] |
Wed, 22 May 2013 10:32   |
Alexander Nittka Messages: 1085 Registered: July 2009 |
Senior Member |
|
|
Hi,
I did some foldig customizations in a project. The corresponding code is in the folding package and the TerminologyXtextEditor (just as inspiration for how to collapse regions).
You will have to solve the following problems:
* identify the folding regions that correspond to the outline view selection
* find a good hook for your selection change in the view (OutlineWithEditorLinker?), where you collapse/expand the regions
A very hacky (but possibly minimal effort) idea if there was a 1:1 correspondence between outline element and text element (which seems not to be your use case).
When you select an element in the outline view, the corresponding model element is expanded automatically, so you could simply collapse *all* regions first.
Alex
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01754 seconds