## org.gjt.sp.jedit.buffer
Interface BufferChangeListener

All Known Implementing Classes:
  BufferChangeAdapter

    public interface BufferChangeListener

A interface for notification of changes to buffer text. While the `BufferUpdate` EditBus message is used for general buffer state changes, this interface is used for events which are fired frequently, or for which performance is essential.

Because this interface is subject to change in the future, you should subclass `BufferChangeAdapter` instead of implementing it directly.

Since:
  jEdit 4.0pre1

Nested Class Summary
`static class` `BufferChangeListener.Adapter`

Method Summary
`void` `bufferLoaded(Buffer buffer)` Called to notify the text area that the buffer has been reloaded.
`void` `contentInserted(Buffer buffer, int startLine, int offset, int numLines, int length)` Called when text is inserted into the buffer.
`void` `contentRemoved(Buffer buffer, int startLine, int offset, int numLines, int length)` Called when text is removed from the buffer.
`void` `foldHandlerChanged(Buffer buffer)` Called to notify the text area that folds need to be collapsed if the "collapseFolds" property is set.
`void` `foldLevelChanged(Buffer buffer, int startLine, int endLine)` Called when line fold levels change.
`void` `preContentRemoved(Buffer buffer, int startLine, int offset, int numLines, int length)` Called when text is about to be removed from the buffer, but is still present.
`void` `transactionComplete(Buffer buffer)` Called after an undo or compound edit has finished.

Method Detail

### foldLevelChanged

    void foldLevelChanged(Buffer buffer,
                          int startLine,
                          int endLine)

  Called when line fold levels change.

  Parameters:
    `buffer` - The buffer in question
    `startLine` - The start line number
    `endLine` - The end line number
  Since:
    jEdit 4.0pre1

### contentInserted

    void contentInserted(Buffer buffer,
                         int startLine,
                         int offset,
                         int numLines,
                         int length)

  Called when text is inserted into the buffer.

  Parameters:
    `buffer` - The buffer in question
    `startLine` - The first line
    `offset` - The start offset, from the beginning of the buffer
    `numLines` - The number of lines inserted
    `length` - The number of characters inserted
  Since:
    jEdit 4.0pre1

### contentRemoved

    void contentRemoved(Buffer buffer,
                        int startLine,
                        int offset,
                        int numLines,
                        int length)

  Called when text is removed from the buffer.

  Parameters:
    `buffer` - The buffer in question
    `startLine` - The first line
    `offset` - The start offset, from the beginning of the buffer
    `numLines` - The number of lines removed
    `length` - The number of characters removed
  Since:
    jEdit 4.0pre1

### preContentRemoved

    void preContentRemoved(Buffer buffer,
                           int startLine,
                           int offset,
                           int numLines,
                           int length)

  Called when text is about to be removed from the buffer, but is still present.

  Parameters:
    `buffer` - The buffer in question
    `startLine` - The first line
    `offset` - The start offset, from the beginning of the buffer
    `numLines` - The number of lines to be removed
    `length` - The number of characters to be removed
  Since:
    jEdit 4.2pre1

### transactionComplete

    void transactionComplete(Buffer buffer)

  Called after an undo or compound edit has finished. The text area uses this event to queue up and collapse cleanup operations so they are only run once during a long transaction (such as a "Replace All" operation.)

  Parameters:
    `buffer` - The buffer in question
  Since:
    jEdit 4.0pre6

### foldHandlerChanged

    void foldHandlerChanged(Buffer buffer)

  Called to notify the text area that folds need to be collapsed if the "collapseFolds" property is set. This method is called after the buffer has been loaded, and also if the user changes the fold handler.

  Parameters:
    `buffer` - The buffer in question
  Since:
    jEdit 4.2pre2

### bufferLoaded

    void bufferLoaded(Buffer buffer)

  Called to notify the text area that the buffer has been reloaded.

  Parameters:
    `buffer` - The buffer in question
  Since:
    jEdit 4.3pre1