1 22 23 package org.gjt.sp.jedit.buffer; 24 25 import org.gjt.sp.jedit.Buffer; 26 27 41 public interface BufferChangeListener 42 { 43 51 void foldLevelChanged(Buffer buffer, int startLine, int endLine); 52 54 64 void contentInserted(Buffer buffer, int startLine, int offset, 65 int numLines, int length); 66 68 78 void contentRemoved(Buffer buffer, int startLine, int offset, 79 int numLines, int length); 80 82 93 public void preContentRemoved(Buffer buffer, int startLine, int offset, 94 int numLines, int length); 95 97 107 void transactionComplete(Buffer buffer); 108 110 120 void foldHandlerChanged(Buffer buffer); 121 123 130 void bufferLoaded(Buffer buffer); 131 133 public class Adapter implements BufferListener 135 { 136 private BufferChangeListener delegate; 137 138 public Adapter(BufferChangeListener delegate) 140 { 141 this.delegate = delegate; 142 } 144 public BufferChangeListener getDelegate() 146 { 147 return delegate; 148 } 150 158 public void foldLevelChanged(JEditBuffer buffer, int startLine, int endLine) 159 { 160 delegate.foldLevelChanged((Buffer)buffer,startLine,endLine); 161 } 163 173 public void contentInserted(JEditBuffer buffer, int startLine, int offset, 174 int numLines, int length) 175 { 176 delegate.contentInserted((Buffer)buffer,startLine,offset,numLines,length); 177 } 179 189 public void contentRemoved(JEditBuffer buffer, int startLine, int offset, 190 int numLines, int length) 191 { 192 delegate.contentRemoved((Buffer)buffer,startLine,offset,numLines,length); 193 } 195 206 public void preContentRemoved(JEditBuffer buffer, int startLine, int offset, 207 int numLines, int length) 208 { 209 delegate.preContentRemoved((Buffer)buffer,startLine,offset,numLines,length); 210 } 212 222 public void transactionComplete(JEditBuffer buffer) 223 { 224 delegate.transactionComplete((Buffer)buffer); 225 } 227 237 public void foldHandlerChanged(JEditBuffer buffer) 238 { 239 delegate.foldHandlerChanged((Buffer)buffer); 240 } 242 249 public void bufferLoaded(JEditBuffer buffer) 250 { 251 delegate.bufferLoaded((Buffer)buffer); 252 } } } 255 | Popular Tags |