Class BufferManagerImpl

  • All Implemented Interfaces:
    BufferManager

    public class BufferManagerImpl
    extends java.lang.Object
    implements BufferManager
    This class contains buffer management code, those methods are not public and must only be used by jEdit. The public interface is BufferManager
    Since:
    5.6pre1
    • Field Detail

      • EMPTY_BUFFER_ARRAY

        public static final Buffer[] EMPTY_BUFFER_ARRAY
    • Constructor Detail

      • BufferManagerImpl

        public BufferManagerImpl()
    • Method Detail

      • getBufferListLock

        public java.lang.Object getBufferListLock()
      • getBuffers

        public java.util.List<Buffer> getBuffers()
        Returns an array of all open buffers from any View. This method is synchronized on the bufferList, if you expect your action might be slow
        Specified by:
        getBuffers in interface BufferManager
        Returns:
        a list of all open buffers
        See Also:
        View.getBuffers()
      • getBuffers

        public java.util.List<Buffer> getBuffers​(java.util.function.Predicate<Buffer> predicate)
      • forEach

        public void forEach​(java.util.function.Consumer<? super Buffer> action)
        Performs the given action for each buffer. This method is synchronized on the bufferList, if you expect your action might be slow, you can retrieve an array of the buffers.
        Specified by:
        forEach in interface BufferManager
        Parameters:
        action - The action to be performed for each element
        Throws:
        java.lang.NullPointerException - if the specified action is null
      • size

        public int size()
        Returns the number of open buffers.
        Specified by:
        size in interface BufferManager
      • getLast

        public Buffer getLast()
      • checkBufferStatus

        public void checkBufferStatus​(View view,
                                      boolean currentBuffer,
                                      boolean autoReload)
        Checks buffer status on disk and shows the dialog box informing the user that buffers changed on disk, if necessary.
        Parameters:
        view - The view
        currentBuffer - indicates whether to check only the current buffer
        autoReload - true if we autoreload
        Since:
        jEdit 4.2pre1
      • setSortBuffers

        public void setSortBuffers​(boolean sortBuffers)
      • setSortByName

        public void setSortByName​(boolean sortByName)
      • updateBufferHash

        public void updateBufferHash​(Buffer buffer)
        To be used by jEdit class only
      • removeBufferFromList

        public void removeBufferFromList​(Buffer buffer)
      • addBufferToList

        public void addBufferToList​(Buffer buffer)
      • updatePosition

        public void updatePosition​(java.lang.String oldPath,
                                   Buffer buffer)
        If buffer sorting is enabled, this repositions the buffer.
      • removeBuffer

        public void removeBuffer​(Buffer buffer)
      • closeAllBuffers

        public void closeAllBuffers​(View view,
                                    boolean isExiting,
                                    boolean autosaveUntitled,
                                    boolean saveRecent,
                                    boolean persistentMarkers)