(STViewFrame m)
| 290 | } |
| 291 | |
| 292 | private void updateCurrentST(STViewFrame m) { |
| 293 | // System.out.println("updateCurrentST(): currentScope.st="+currentScope.st); |
| 294 | // update all views according to currentScope.st |
| 295 | updateStack(currentScope, m); // STACK |
| 296 | updateAttributes(currentScope, m); // ATTRIBUTES |
| 297 | setText(m.bytecode, currentScope.st.impl.disasm()); // BYTECODE DIS. |
| 298 | setText(m.template, currentScope.st.impl.template); // TEMPLATE SRC |
| 299 | JTreeASTModel astModel = new JTreeASTModel(new CommonTreeAdaptor(), currentScope.st.impl.ast); |
| 300 | viewFrame.ast.setModel(astModel); |
| 301 | |
| 302 | // highlight output text and, if {...} subtemplate, region in ST src |
| 303 | // get last event for currentScope.st; it's the event that captures ST eval |
| 304 | if ( currentEvent instanceof EvalExprEvent ) { |
| 305 | EvalExprEvent exprEvent = (EvalExprEvent)currentEvent; |
| 306 | highlight(m.output, exprEvent.outputStartChar, exprEvent.outputStopChar); |
| 307 | highlight(m.template, exprEvent.exprStartChar, exprEvent.exprStopChar); |
| 308 | } |
| 309 | else { |
| 310 | EvalTemplateEvent templateEvent; |
| 311 | if ( currentEvent instanceof EvalTemplateEvent ) { |
| 312 | templateEvent = (EvalTemplateEvent)currentEvent; |
| 313 | } |
| 314 | else { |
| 315 | List<InterpEvent> events = currentScope.events; |
| 316 | templateEvent = (EvalTemplateEvent)events.get(events.size()-1); |
| 317 | } |
| 318 | if ( templateEvent!=null ) { |
| 319 | highlight(m.output, templateEvent.outputStartChar, templateEvent.outputStopChar); |
| 320 | } |
| 321 | if ( currentScope.st.isAnonSubtemplate() ) { |
| 322 | Interval r = currentScope.st.impl.getTemplateRange(); |
| 323 | //System.out.println("currentScope.st src range="+r); |
| 324 | //m.template.moveCaretPosition(r.a); |
| 325 | highlight(m.template, r.a, r.b); |
| 326 | } |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | protected void setText(JEditorPane component, String text) { |
| 331 | List<Integer> windowsLineEndingsList = new ArrayList<Integer>(); |
no test coverage detected