001: /*
002: * BufferChangeListener.java - Buffer listener adapter
003: * :tabSize=8:indentSize=8:noTabs=false:
004: * :folding=explicit:collapseFolds=1:
005: *
006: * Copyright (C) 2001, 2003 Slava Pestov
007: *
008: * This program is free software; you can redistribute it and/or
009: * modify it under the terms of the GNU General Public License
010: * as published by the Free Software Foundation; either version 2
011: * of the License, or any later version.
012: *
013: * This program is distributed in the hope that it will be useful,
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016: * GNU General Public License for more details.
017: *
018: * You should have received a copy of the GNU General Public License
019: * along with this program; if not, write to the Free Software
020: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
021: */
022:
023: package org.gjt.sp.jedit.buffer;
024:
025: import org.gjt.sp.jedit.Buffer;
026:
027: /**
028: * An adapter you can subclass to avoid having to implement all the methods
029: * of the {@link BufferChangeListener} interface.
030: * @author Slava Pestov
031: * @version $Id: BufferChangeAdapter.java 5147 2004-11-08 04:01:22Z spestov $
032: * @since jEdit 4.0pre1
033: */
034: public abstract class BufferChangeAdapter implements
035: BufferChangeListener {
036: //{{{ foldLevelChanged() method
037: /**
038: * Called when line fold levels change.
039: * @param buffer The buffer in question
040: * @param start The start line number
041: * @param end The end line number
042: * @since jEdit 4.0pre1
043: */
044: public void foldLevelChanged(Buffer buffer, int start, int end) {
045: } //}}}
046:
047: //{{{ contentInserted() method
048: /**
049: * Called when text is inserted into the buffer.
050: * @param buffer The buffer in question
051: * @param startLine The first line
052: * @param offset The start offset, from the beginning of the buffer
053: * @param numLines The number of lines inserted
054: * @param length The number of characters inserted
055: * @since jEdit 4.0pre1
056: */
057: public void contentInserted(Buffer buffer, int startLine,
058: int offset, int numLines, int length) {
059: }
060:
061: //}}}
062:
063: //{{{ preContentRemoved() method
064: /**
065: * Called when text is about to be removed from the buffer, but is
066: * still present.
067: * @param buffer The buffer in question
068: * @param startLine The first line
069: * @param offset The start offset, from the beginning of the buffer
070: * @param numLines The number of lines to be removed
071: * @param length The number of characters to be removed
072: * @since jEdit 4.2pre1
073: */
074: public void preContentRemoved(Buffer buffer, int startLine,
075: int offset, int numLines, int length) {
076: }
077:
078: //}}}
079:
080: //{{{ contentRemoved() method
081: /**
082: * Called when text is removed from the buffer.
083: * @param buffer The buffer in question
084: * @param startLine The first line
085: * @param offset The start offset, from the beginning of the buffer
086: * @param numLines The number of lines removed
087: * @param length The number of characters removed
088: * @since jEdit 4.0pre1
089: */
090: public void contentRemoved(Buffer buffer, int startLine,
091: int offset, int numLines, int length) {
092: }
093:
094: //}}}
095:
096: //{{{ transactionComplete() method
097: /**
098: * Called after an undo or compound edit has finished. The text area
099: * uses this event to queue up and collapse cleanup operations so they
100: * are only run once during a long transaction (such as a "Replace All"
101: * operation.)
102: *
103: * @param buffer The buffer in question
104: * @since jEdit 4.0pre6
105: */
106: public void transactionComplete(Buffer buffer) {
107: }
108:
109: //}}}
110:
111: //{{{ foldHandlerChanged() method
112: /**
113: * Called to notify the text area that folds need to be collapsed if
114: * the "collapseFolds" property is set. This method is called after the
115: * buffer has been loaded, and also if the user changes the fold
116: * handler.
117: *
118: * @param buffer The buffer in question
119: * @since jEdit 4.2pre2
120: */
121: public void foldHandlerChanged(Buffer buffer) {
122: }
123:
124: //}}}
125:
126: //{{{ foldHandlerChanged() method
127: /**
128: * Called to notify the text area that the buffer has been reloaded.
129: *
130: * @param buffer The buffer in question
131: * @since jEdit 4.3pre1
132: */
133: public void bufferLoaded(Buffer buffer) {
134: }
135: //}}}
136: }
|