bibliothek.gui.dock.util.extension
Class ExtensionManager

java.lang.Object
  extended by bibliothek.gui.dock.util.extension.ExtensionManager

public class ExtensionManager
extends Object

Manages a set of Extensions.

Author:
Benjamin Sigg

Constructor Summary
ExtensionManager(DockController controller)
          Creates a new manager.
 
Method Summary
 void add(Extension extension)
          Adds extension to the list of extensions.
 Extension[] getExtensions()
          Gets a list of all extensions that are currently known to this manager.
 void init()
          Starts up all extensions.
 void kill()
          Stops and removes all extensions.
<E> List<E>
load(ExtensionName<E> name)
          Loads all extensions matching name.
 void remove(Extension extension)
          Removes extension from the list of extensions.
protected  void tryLoadDefaultExtensions()
          Tries to load the standard extensions that are developed alongside with the main-framework.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtensionManager

public ExtensionManager(DockController controller)
Creates a new manager.

Parameters:
controller - the controller in whose realm this manager works
Method Detail

tryLoadDefaultExtensions

protected void tryLoadDefaultExtensions()
Tries to load the standard extensions that are developed alongside with the main-framework.


add

public void add(Extension extension)
Adds extension to the list of extensions.

Parameters:
extension - the new extension

remove

public void remove(Extension extension)
Removes extension from the list of extensions.

Parameters:
extension - the extension to remove

getExtensions

public Extension[] getExtensions()
Gets a list of all extensions that are currently known to this manager.

Returns:
the list of extensions

load

public <E> List<E> load(ExtensionName<E> name)
Loads all extensions matching name.

Type Parameters:
E - the type of extensions that is loaded
Parameters:
name - the name of the extensions
Returns:
a list containing all non-null extensions, may be empty

init

public void init()
Starts up all extensions.


kill

public void kill()
Stops and removes all extensions.