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