Class BufferSet


  • public class BufferSet
    extends java.lang.Object
    An ordered list of buffers, normally attached to an EditPane and viewed in a BufferSwitcher.
    Since:
    jEdit 4.3pre15
    • Constructor Detail

      • BufferSet

        public BufferSet​(BufferSet source)
    • Method Detail

      • getBuffer

        public Buffer getBuffer​(int index)
        Returns the Buffer at the given index.
        Parameters:
        index - the index. The index must exists
        Returns:
        the buffer at the index.
      • getSorter

        @Nullable
        public java.util.Comparator<Buffer> getSorter()
        Returns:
        the Comparator used for this bufferset can be null if there is no sorting
        Since:
        jEdit 5.2
      • getPreviousBuffer

        public Buffer getPreviousBuffer​(int index)
      • getNextBuffer

        public Buffer getNextBuffer​(int index)
      • indexOf

        public int indexOf​(Buffer buffer)
      • contains

        public boolean contains​(Buffer buffer)
        Check if the BufferSet contains the given buffer
        Parameters:
        buffer - the buffer to search
        Returns:
        true if it contains this buffer
        Since:
        jEdit 5.7pre1
      • size

        public int size()
      • getAllBuffers

        public Buffer[] getAllBuffers()
        Returns an array of all buffers in this bufferSet.
        Returns:
        an array of all Buffers
      • addBufferSetListener

        public void addBufferSetListener​(BufferSetListener listener)
        Add a BufferSetListener.
        Parameters:
        listener - the new BufferSetListener
      • removeBufferSetListener

        public void removeBufferSetListener​(BufferSetListener listener)
        Remove a BufferSetListener. If there are no listeners anymore, remove all buffers from the bufferSet.
        Parameters:
        listener - the removed BufferSetListener
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • sort

        public void sort()
        Sort the bufferSet (useful if a buffer has been renamed for example
        Since:
        jEdit 4.4pre1