Changeset 2016

Show
Ignore:
Timestamp:
11/26/07 04:30:55 (5 years ago)
Author:
gyuque
Message:

uplang/javascript/javascript-xpath/applications: created root node

Location:
lang/javascript/javascript-xpath/applications/inspector
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/javascript-xpath/applications/inspector/script/jsxpi.js

    r1825 r2016  
    7777        this.console = new JSXPInspector.Console($("jsxpi-console")); 
    7878        this.history = new JSXPInspector.InputHistory(); 
    79         this.streeMan = new JSXPInspector.SyntaxTreeManager(); 
     79        this.streeMan = new JSXPInspector.SyntaxTreeManager(this.synTreePanel); 
    8080        setInterval(this.checkJSXPathInstalled.bind(this), 1000); 
    8181}; 
     
    121121                 
    122122                var synTreePanel = new Ext.tree.TreePanel('jsxpath-syntaxtree', { 
    123                         containerScroll: true 
     123                        enableDD: false 
    124124                }); 
    125125                 
     
    138138                layout.getRegion("center").showPanel(0); 
    139139                 
     140                this.synTreePanel = synTreePanel; 
    140141                return layout; 
    141142        }, 
     
    330331                                        result = expr.evaluate(this.xpathEnv.currentContext, 0, null); 
    331332                                         
    332                                         this.updateSyntaxTree(); 
     333                                        this.updateSyntaxTree(expr, exp); 
    333334                                } 
    334335                        } 
     
    479480}; 
    480481 
    481 JSXPInspector.SyntaxTreeManager = function() { 
     482JSXPInspector.SyntaxTreeManager = function(view) { 
    482483        this.curSource = null; 
    483484        this.curExp = null; 
    484485        this.curTree = null; 
     486        this.view = view; 
    485487} 
    486488 
     
    490492                        return this.curTree 
    491493                         
    492                 //this.curTree = new JXAnalyzer.SyntaxTree(); 
     494                this.curTree = new JXAnalyzer.SyntaxTree(exp, exp.lexer, src); 
    493495                this.curExp = exp; 
    494496                this.curSource = src; 
    495                          
     497                 
     498                var root = new Ext.tree.TreeNode({ 
     499                        allowDrag: false, 
     500                        allowDrop: false,                        
     501                        id       : '/', 
     502                        text     : 'XPathExpression', 
     503                        icon     : "img/xroot.gif" 
     504                }); 
     505                 
     506                this.view.setRootNode(root); 
     507                this.view.render(); 
     508                root.expand(); 
     509 
    496510                return this.curTree; 
    497511        }