1 21 22 package org.armedbear.j; 23 24 public final class OutputBuffer extends Buffer 25 { 26 private OutputBuffer() 27 { 28 supportsUndo = false; 29 type = TYPE_OUTPUT; 30 mode = PlainTextMode.getMode(); 31 formatter = new PlainTextFormatter(this); 32 lineSeparator = System.getProperty("line.separator"); 33 readOnly = true; 34 setTransient(true); 35 setProperty(Property.VERTICAL_RULE, 0); 36 setProperty(Property.SHOW_LINE_NUMBERS, false); 37 setProperty(Property.HIGHLIGHT_MATCHING_BRACKET, false); 38 setProperty(Property.HIGHLIGHT_BRACKETS, false); 39 setInitialized(true); 40 } 41 42 public static OutputBuffer getOutputBuffer(String text) 43 { 44 OutputBuffer outputBuffer = new OutputBuffer(); 45 outputBuffer.setText(text); 46 return outputBuffer; 47 } 48 49 public int load() 50 { 51 if (!isLoaded()) { 52 if (getFirstLine() == null) { 53 appendLine(""); 54 renumber(); 55 } 56 setLoaded(true); 57 } 58 return LOAD_COMPLETED; 59 } 60 61 public String getFileNameForDisplay() 62 { 63 return title != null ? title : ""; 64 } 65 } 66 | Popular Tags |