eclipse - Add XML outline to Xtext DSL IDE -


i have dsl ide generated xtext 2.8.4. works ok. due different reason have implement few editors different kind of file. i've easy added xml editor syntax coloring. need outline view xml. if not mistake have implement

public class xmloutlinetreeprovider implements ioutlinetreestructureprovider, ioutlinetreeprovider, ioutlinetreeprovider.cancelable {} 

also eclipse platform has xml outline implementation. can reuse implementaion in xtext project? i'm sure there ready use implementation task, find it. next question not find out how register implementaion in xtext core

any advises appreciated

thanks alex

i'd guess it's more effort reuse existing outline implementation implement few methods on own. in fact, have provide label, icon path , list of children xml nodes.

it in principle (code xtend):

def _createchildren(ioutlinenode parentnode, element element) {     element.children.foreach [         createnode(parentnode, it);     ] } 

the label provider:

def text(element ele) {     return ele.name }  def text(attribute attr) {     attr.name + '=' + attr.value  }  def image(element ele) {     'element.gif' } 

the domain model example or arithmetics example implement simple outline. may want these.

reusing existing stuff more cumbersome since you'd have adapt xtext model based on emf internal model xml outline expects.


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -