aungmyo / camel-extra

Automatically exported from code.google.com/p/camel-extra
0 stars 0 forks source link

[camel-spit] How do I 'skip' some rules when creating the outline view? #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Take the example :

route FilterTest from 'mock:wibble' {
    filter xpath("/book[@category!='CHILDREN]'") {  
        recipients {
          to 'uri:1'
          to 'uri:2'
        }
    }
}

In the outline view I get something like

 * filter message
    * <unnamed>
       * recipients
          * <unnamed>
             * uri:1
             * uri:2
    * /book[@category!='CHILDREN]'

The <unnamed> nodes correspond to the SimplePattern in the grammar that is
used to hold the DSL block bounded by '{' '}'. 

I need to get rid of these <unnamed> nodes in the tree and keep the rest :)

Original issue reported on code.google.com by oisin.hurley on 7 Nov 2008 at 3:36

GoogleCodeExporter commented 9 years ago

Original comment by oisin.hurley on 7 Nov 2008 at 3:37

GoogleCodeExporter commented 9 years ago
Got it. Created a simple filter in the Outline.ext

 create UIContentNode outlineTree(emf::EObject model) :
    setLabel(model.label()) ->
    setImage(model.image()) ->
    setContext(model)->
    addNonSimplePatternNodesToTree(this, model);

UIContentNode addNonSimplePatternNodesToTree(tree::UIContentNode uinode, 
emf::EObject
simpleP) :
   simpleP.eContents.collect(e|
           e.label()!=null 
          ? 
            (e.metaType != spit::SimplePattern
               ?
                 uinode.children.add(e.outlineTree()) 
               :
                 addNonSimplePatternNodesToTree(uinode, e)
             )
          :
            null);

Original comment by oisin.hurley on 11 Nov 2008 at 5:27