1 11 package org.eclipse.debug.internal.ui.views.console; 12 13 14 import org.eclipse.jface.text.ITextStore; 15 16 public class ConsoleOutputTextStore implements ITextStore { 17 18 private StringBuffer fBuffer; 19 20 public ConsoleOutputTextStore(int bufferSize) { 21 fBuffer= new StringBuffer (bufferSize); 22 } 23 24 27 public char get(int pos) { 28 return fBuffer.charAt(pos); 29 } 30 31 34 public String get(int pos, int length) { 35 return fBuffer.substring(pos, pos + length); 36 } 37 38 41 public int getLength() { 42 return fBuffer.length(); 43 } 44 45 48 public void replace(int pos, int length, String text) { 49 if (text == null) { 50 text= ""; } 52 fBuffer.replace(pos, pos + length, text); 53 } 54 55 58 public void set(String text) { 59 fBuffer= new StringBuffer (text); 60 } 61 62 65 public void setMinimalBufferSize(int bufferSize) { 66 fBuffer.ensureCapacity(bufferSize); 67 } 68 } 69 | Popular Tags |