## org.gjt.sp.jedit.bufferset
Class BufferSetManager

    java.lang.Object
      org.gjt.sp.jedit.bufferset.BufferSetManager

All Implemented Interfaces:
  EBComponent

    public class BufferSetManager

extends java.lang.Object
implements EBComponent

The buffersets manager. A singleton instance of this can be obtained from jEdit.getBufferSetManager()

Since:
  jEdit 4.3pre15

Nested Class Summary
`static interface` `BufferSetManager.BufferSetVisitor`
`static class` `BufferSetManager.NewBufferSetAction`

Constructor Summary
`BufferSetManager()`

Method Summary
`void` `addAllBuffers(BufferSet bufferSet)` Add all buffers to the bufferSet.
`void` `addBuffer(BufferSet bufferSet, Buffer buffer)` Add a buffer in the given bufferSet.
`void` `addBuffer(EditPane editPane, Buffer buffer)` Add a buffer into the current editPane of the given editPane.
`void` `addBuffer(View view, Buffer buffer)` Add a buffer into the current editPane of the given view.
`int` `countBufferSets(Buffer buffer)` Count the bufferSets in which the buffer is.
`void` `handleMessage(EBMessage message)` Handles a message sent on the EditBus.
`void` `mergeBufferSet(BufferSet target, BufferSet source)` Merge the content of the source bufferSet into the target bufferSet
`void` `moveBuffer(EditPane editPane, int oldPosition, int newPosition)` Moves a buffer from a old position to a new position in the BufferSet used in an EditPane.
`void` `removeBuffer(Buffer buffer)` remove a buffer from all bufferSets.
`void` `removeBuffer(EditPane editPane, Buffer buffer)` Remove a buffer from the EditPane's bufferSet.
`void` `visit(BufferSetManager.BufferSetVisitor visitor)` This method will visit all buffersets.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### BufferSetManager

    public BufferSetManager()

Method Detail

### handleMessage

    public void handleMessage(EBMessage message)

  Description copied from interface: `EBComponent`
  Handles a message sent on the EditBus. This method must specify the type of responses the plugin will have for various subclasses of the `EBMessage` class. Typically this is done with one or more `if` blocks that test whether the message is an instance of a derived message class in which the component has an interest. For example:

       if(msg instanceof BufferUpdate) {
           // a buffer's state has changed!
       }
       else if(msg instanceof ViewUpdate) {
           // a view's state has changed!
       }
       // ... and so on

  Specified by:
    `handleMessage` in interface `EBComponent`
  Parameters:
    `message` - The message

### mergeBufferSet

    public void mergeBufferSet(BufferSet target,
                               BufferSet source)

  Merge the content of the source bufferSet into the target bufferSet

  Parameters:
    `target` - the target bufferSet
    `source` - the source bufferSet
  See Also:
    `EditPane.setBuffer(org.gjt.sp.jedit.Buffer)`

### countBufferSets

    public int countBufferSets(Buffer buffer)

  Count the bufferSets in which the buffer is.

  Parameters:
    `buffer` - the buffer
  Returns:
    the number of buffersets in which buffer is
  See Also:
    `jEdit.closeBuffer(org.gjt.sp.jedit.EditPane, org.gjt.sp.jedit.Buffer)`

### addBuffer

    public void addBuffer(View view,
                          Buffer buffer)

  Add a buffer into the current editPane of the given view. If the view is null, it will be added to the global bufferSet

  Parameters:
    `view` - a view (or null)
    `buffer` - the buffer to add

### addBuffer

    public void addBuffer(EditPane editPane,
                          Buffer buffer)

  Add a buffer into the current editPane of the given editPane. If the editPane is null, it will be added to the global bufferSet

  Parameters:
    `editPane` - an EditPane (or null)
    `buffer` - the buffer to add

### addBuffer

    public void addBuffer(BufferSet bufferSet,
                          Buffer buffer)

  Add a buffer in the given bufferSet.

  Parameters:
    `bufferSet` - the bufferSet
    `buffer` - the buffer to add

### addAllBuffers

    public void addAllBuffers(BufferSet bufferSet)

  Add all buffers to the bufferSet.

  Parameters:
    `bufferSet` - the bufferSet

### moveBuffer

    public void moveBuffer(EditPane editPane,
                           int oldPosition,
                           int newPosition)

  Moves a buffer from a old position to a new position in the BufferSet used in an EditPane.

### removeBuffer

    public void removeBuffer(EditPane editPane,
                             Buffer buffer)

  Remove a buffer from the EditPane's bufferSet.

  Parameters:
    `editPane` - the editPane It cannot be null
    `buffer` - the buffer

### removeBuffer

    public void removeBuffer(Buffer buffer)

  remove a buffer from all bufferSets.

  Parameters:
    `buffer` - the buffer that must be removed

### visit

    public void visit(BufferSetManager.BufferSetVisitor visitor)

  This method will visit all buffersets.

  Parameters:
    `visitor` - the bufferset visitor