1

this is my xtext outline:

enter image description here

I would like to name by my self the unnamed fields.

this is my outline tree provider code, it's not a final version :

class MyDslOutlineTreeProvider extends DefaultOutlineTreeProvider {

  def _createChildren(DocumentRootNode parentNode, Script test) {
       test.includes.forEach[v| createNode(parentNode,v)] 

       //test.assignments.forEach[a | createNode(parentNode,a)]
       test.tests.forEach[t|createNode(parentNode,t)]
  }
  def _createNode(IOutlineNode parentNode, Include modelElement) {      

  }
  def _createNode(IOutlineNode parentNode, Test modelElement) {
      // print ("RUN")
  }
}
Thomas Fritsch
  • 9,639
  • 33
  • 37
  • 49
BR.Hamza
  • 99
  • 14

1 Answers1

3

You can customize the displayed texts not in your OutLineTreeProvider, but in your LabelProvider.
You can find examples in the Xtext documentation about LabelProvider (see at Xtext Documentation -> Eclipse Support -> Label Provider).

Thomas Fritsch
  • 9,639
  • 33
  • 37
  • 49