1 21 22 package org.armedbear.j; 23 24 public final class XmlErrorBuffer extends CompilationErrorBuffer 25 { 26 private File file; 27 28 public XmlErrorBuffer(File file, String text) 29 { 30 super(); 31 this.file = file; 32 setText(text); 33 } 34 35 public void recycle(File file, String text) 36 { 37 if (!Editor.getBufferList().contains(this)) 38 relink(); 39 empty(); 40 setCurrentError(null); 41 this.file = file; 42 setText(text); 43 for (EditorIterator it = new EditorIterator(); it.hasNext();) { 44 Editor ed = it.nextEditor(); 45 if (ed.getBuffer() == this) { 46 ed.setMark(null); 47 ed.setDot(getFirstLine(), 0); 48 ed.updateDisplay(); 49 } 50 } 51 } 52 53 public String toString() 54 { 55 if (file != null) { 56 FastStringBuffer sb = new FastStringBuffer(); 57 sb.append(file.getName()); 58 sb.append(" (errors)"); 59 return sb.toString(); 60 } 61 return "Errors"; 62 } 63 } 64 | Popular Tags |