Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to hide a root node in outline tree without hiding its children?
How to hide a root node in outline tree without hiding its children? [message #912772] Fri, 14 September 2012 06:53 Go to next message
Tu Do is currently offline Tu DoFriend
Messages: 21
Registered: August 2012
Junior Member
For example:

VARIABLE:
      'VARIABLE' VARIABLE_NAME '=' 'test'
;

VARIABLE_NAME:
       name = ID


This is just an example. With this kind of rule, the VARIABLE_NAME will appear as a child node of VARIABLE rule. I don't want the VARIABLE node to show up in my outline tree. How can I hide it?
Re: How to hide a root node in outline tree without hiding its children? [message #912802 is a reply to message #912772] Fri, 14 September 2012 07:57 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6499
Registered: July 2009
Senior Member
Hi,

are you talking about a root node (a) or a parent node (b)?

if (b)

public void _createChildren(IOutlineNode parent, ParentOfVARIABLE m) {
		for (VARIABLE v : m.getVARIABLEs()) { //IF its only one dont loop ;-)
			createNode(parent, v.getVARIABLE_NAME ());
		}
	}


if (a)

override

protected void _createChildren(DocumentRootNode parentNode, EObject modelElement) {
		
	}

sililarly

~Christian
Re: How to hide a root node in outline tree without hiding its children? [message #912811 is a reply to message #912802] Fri, 14 September 2012 08:25 Go to previous messageGo to next message
Tu Do is currently offline Tu DoFriend
Messages: 21
Registered: August 2012
Junior Member
Sorry for my ambiguity. I meant (b).

I did as you said, but the parent node did not disappear. Instead, it appears as "<unnamed>", and the child node (VARIABLE_NAME) is in it.
Re: How to hide a root node in outline tree without hiding its children? [message #912812 is a reply to message #912811] Fri, 14 September 2012 08:27 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6499
Registered: July 2009
Senior Member
can you share a complete grammar and your complete outlinetreeprovider?
Re: How to hide a root node in outline tree without hiding its children? [message #912817 is a reply to message #912812] Fri, 14 September 2012 08:35 Go to previous message
Tu Do is currently offline Tu DoFriend
Messages: 21
Registered: August 2012
Junior Member
Christian Dietrich wrote on Fri, 14 September 2012 04:27
can you share a complete grammar and your complete outlinetreeprovider?

Thanks Christian,

I got it working now. The wrong parent node was used, so it was not created as I wanted.
Previous Topic:Get a list of referencing object
Next Topic:How can I perform a ISemanticModification quickfix with formatting?
Goto Forum:
  


Current Time: Fri Nov 28 13:38:00 GMT 2014

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

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