1 package org.antlr.works.editor; 2 3 import org.antlr.works.ate.ATEUnderlyingManager; 4 import org.antlr.works.components.grammar.CEditorGrammar; 5 6 import java.awt.*; 7 import java.util.List ; 8 38 39 public class EditorUnderlyingManager extends ATEUnderlyingManager { 40 41 protected CEditorGrammar editor; 42 43 public EditorUnderlyingManager(CEditorGrammar editor) { 44 super(editor.textEditor); 45 this.editor = editor; 46 } 47 48 public void render(Graphics g) { 49 renderItems(g, editor.editorInspector.getErrors()); 50 renderItems(g, editor.editorInspector.getWarnings()); 51 renderItems(g, editor.editorInspector.getDecisionDFAs()); 52 } 53 54 protected void renderItems(Graphics g, List <EditorInspectorItem> items) { 55 if(items == null) 56 return; 57 58 for(EditorInspectorItem item : items) { 59 drawUnderlineAtIndexes(g, item.color, item.startIndex, item.endIndex, item.shape); 60 } 61 } 62 63 } 64 | Popular Tags |