org.gjt.sp.jedit.bufferset
Class BufferSetManager

java.lang.Object
  extended by org.gjt.sp.jedit.bufferset.BufferSetManager
All Implemented Interfaces:
EBComponent

public class BufferSetManager
extends java.lang.Object
implements EBComponent

The buffersets manager.

Since:
jEdit 4.3pre15

Nested Class Summary
static interface BufferSetManager.BufferSetVisitor
           
static class BufferSetManager.NewBufferSetAction
           
 
Constructor Summary
BufferSetManager()
           
 
Method Summary
 void addBuffer(BufferSet bufferSet, Buffer buffer)
           
 void addBuffer(EditPane editPane, Buffer buffer)
           
 void addBuffer(View view, Buffer buffer)
           
 void clear()
          Close all buffers.
 int countBufferSets(Buffer buffer)
          Count the bufferSets in which the buffer is.
 BufferSet getEditPaneBufferSet(EditPane editPane)
           
 BufferSet getEditPaneBufferSet(EditPane editPane, BufferSet source)
           
 BufferSet getGlobalBufferSet()
          Retourne le bufferSet global.
 BufferSet getViewBufferSet(View view)
           
 BufferSet getViewBufferSet(View view, BufferSet source)
           
 void handleMessage(EBMessage message)
          Handles a message sent on the EditBus.
 boolean hasListeners(Buffer buffer)
          Check if a buffer is in at least one bufferSet that as some listeners.
 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

getGlobalBufferSet

public BufferSet getGlobalBufferSet()
Retourne le bufferSet global.

Returns:
le bufferSet global

getViewBufferSet

public BufferSet getViewBufferSet(View view,
                                  BufferSet source)

getViewBufferSet

public BufferSet getViewBufferSet(View view)

getEditPaneBufferSet

public BufferSet getEditPaneBufferSet(EditPane editPane,
                                      BufferSet source)

getEditPaneBufferSet

public BufferSet getEditPaneBufferSet(EditPane editPane)

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

addBuffer

public void addBuffer(View view,
                      Buffer buffer)

addBuffer

public void addBuffer(EditPane editPane,
                      Buffer buffer)

addBuffer

public void addBuffer(BufferSet bufferSet,
                      Buffer buffer)

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

hasListeners

public boolean hasListeners(Buffer buffer)
Check if a buffer is in at least one bufferSet that as some listeners. Otherwise nobody can see it.

Parameters:
buffer - the buffer
Returns:
true if the buffer is in a bufferSet that has listeners

removeBuffer

public void removeBuffer(Buffer buffer)
remove a buffer from all bufferSets.

Parameters:
buffer - the buffer that must be removed

clear

public void clear()
Close all buffers.


visit

public void visit(BufferSetManager.BufferSetVisitor visitor)
This method will visit all buffersets.

Parameters:
visitor - the bufferset visitor