Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [XText] organize outline view
[XText] organize outline view [message #496196] Mon, 09 November 2009 10:31 Go to next message
Michael Burkhardt is currently offline Michael BurkhardtFriend
Messages: 64
Registered: July 2009
Member
Hello *,


I'd like to re-organize the tree in the outline view of my DSL. I want to group
some enties in the outline. Imagine, something like the grouped imports in Java
Editor outline view.

How can I do this?


Ciao, Micha
Re: [XText] organize outline view [message #496203 is a reply to message #496196] Mon, 09 November 2009 10:48 Go to previous messageGo to next message
Tim  is currently offline Tim Friend
Messages: 21
Registered: August 2009
Junior Member
I think the sample below is what you are looking for. I created a new rule for all the parts that I want to group together!

elements+=
  "Include:" includes+=Includes
| "Beliefs:" beliefs+=Beliefs
;

Includes:
	(include+=Include)+;
Include:
	includeName=ID;
Beliefs:
	(belief+=Belief)+;     
Belief:
	  atom+=Atom "."


Hope it helps you getting there!

Regards,
Tim

[Updated on: Mon, 09 November 2009 10:49]

Report message to a moderator

Re: [XText] organize outline view [message #496288 is a reply to message #496196] Mon, 09 November 2009 15:47 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Michael,

you may want to have a look at the generated MyDslTransformer in the
*.outline package in your ui plugin. It allows to customize the
structure of the outline view.

#newOutlineNode(parent, label, image, location) will help to instantiate
nodes that do not mirror a semantic object but are kind of virtual nodes
or logical groups.

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

Michael Burkhardt schrieb:
> Hello *,
>
>
> I'd like to re-organize the tree in the outline view of my DSL. I want
> to group some enties in the outline. Imagine, something like the grouped
> imports in Java Editor outline view.
>
> How can I do this?
>
>
> Ciao, Micha
Re: [XText] organize outline view [message #496299 is a reply to message #496288] Mon, 09 November 2009 16:06 Go to previous messageGo to next message
Michael Burkhardt is currently offline Michael BurkhardtFriend
Messages: 64
Registered: July 2009
Member
Hi Sebastian,

thanks for reply.

I found my DSL transformer. My problem is, that for every instance of Include
(subclass of EObject), the method is called. For every call a new group will be
created.


Is there a sample for virtual outline nodes?
(except for http://www.eclipse.org/Xtext/documentation/0_7_2/xtext.html# outline)


For example my XText model is:

Root :
Include | Service ;

All includes should be grouped into a virtual ContentOutlineNode. the sequence
of Services and Includes can be mixed, but the includes should be grouped at the
top of my outline.

Ciao, Micha


--- Original-Nachricht ---
Absender: Sebastian Zarnekow
Datum: 09.11.2009 16:47
> Hi Michael,
>
> you may want to have a look at the generated MyDslTransformer in the
> *.outline package in your ui plugin. It allows to customize the
> structure of the outline view.
>
> #newOutlineNode(parent, label, image, location) will help to instantiate
> nodes that do not mirror a semantic object but are kind of virtual nodes
> or logical groups.
>
> Regards,
> Sebastian
Re: [XText] organize outline view [message #659044 is a reply to message #496288] Thu, 10 March 2011 19:16 Go to previous messageGo to next message
Olaf Bigalk is currently offline Olaf BigalkFriend
Messages: 155
Registered: July 2009
Location: Berlin
Senior Member
Hi Sebastian,

I have a similar problem like Michael.
I did not found a method newOutlineNode with the mentioned signature in AbstractDeclarativeSemanticModelTransformer. There is a method with this name but only two parameters.

Can you provide a code snippet that shows how to introduce virtual outline nodes?
Re: [XText] organize outline view [message #659152 is a reply to message #659044] Fri, 11 March 2011 10:07 Go to previous messageGo to next message
Olaf Bigalk is currently offline Olaf BigalkFriend
Messages: 155
Registered: July 2009
Location: Berlin
Senior Member
Hi all,

the solution for the problem is to create a new node with newOutlineNode(semanticNode, parentNode)
for the semantic node you take the first node of the childnodes of the virtual node.
Re: [XText] organize outline view [message #668135 is a reply to message #496196] Tue, 03 May 2011 22:54 Go to previous message
Luong  is currently offline Luong Friend
Messages: 8
Registered: March 2011
Junior Member
Hi everyone,
I know this is a very old topic and I don't want to annoy you all, but I have found that calling one of the constructors of ContentOutlineNode works.
Just instantiate a ContentOutlineNode with a label and set its parent in your Transformer class.
Here is a post.

(Xtext 1.0)

Bye! Xtext rocks! Very Happy
Previous Topic:assertion error in MergingHighlightedPositionAcceptor
Next Topic:Xtext ExpressionLanguage Example
Goto Forum:
  


Current Time: Thu Apr 25 17:49:49 GMT 2024

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

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

Back to the top