|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xnap.plugin.PluginManager
public class PluginManager
This class keeps track of all available and enabled plugins.
Nested Class Summary | |
---|---|
static class |
PluginManager.PluginInfoComparator
Compares PluginInfo objects by name. |
Field Summary | |
---|---|
static java.lang.String |
PLUGIN_FILENAME
|
Method Summary | |
---|---|
boolean |
add(PluginInfo info)
Adds a new plugin information object to the list of available plugins. |
PluginInfo |
add(java.util.Properties props)
Constructs a PluginInfo object from props
and invokes add(PluginInfo) if info is valid. |
boolean |
addFromPackage(PackageInfo p)
Adds a plugin from package info. |
void |
addPluginListener(PluginListener l)
Adds the specified plugin listener to receive plugin events. |
PluginInfo |
getCorePackage()
Returns the xnap-core package. |
static java.lang.String |
getCoreVersion()
|
int |
getEnabledCount()
Returns the number of enabled plugins. |
PluginInfo |
getInfoByName(java.lang.String name)
Returns the information record for plugin with name. |
static PluginManager |
getInstance()
|
void |
guiStarted()
Invoked by XNapFrame . |
void |
guiStopped()
Invoked by XNapFrame . |
java.util.Iterator |
infos()
Return a sorted iterator over a copy of all PluginInfo objects. |
Plugin |
load(PluginInfo info)
Loads the plugin described by info . |
void |
remove(PluginInfo info)
|
void |
removePluginListener(PluginListener l)
Removes the specified plugin listener. |
static java.lang.String[] |
resolveClassPath(PluginInfo info)
Resolves the class path of info to absolute filenames. |
void |
restore()
Restores the state of the plugin manager from the Preferences . |
void |
save()
Disables all plugins and saves the state of the PluginManager. |
void |
setEnabled(Plugin plugin,
boolean enable)
|
int |
size()
Returns the number of plugins. |
void |
updateFromPackageManager()
Updates the list of available plugins from XNapPackageManager . |
void |
write()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PLUGIN_FILENAME
Method Detail |
---|
public static PluginManager getInstance()
public PluginInfo add(java.util.Properties props)
PluginInfo
object from props
and invokes add(PluginInfo)
if info is valid.
PluginManager()
public boolean add(PluginInfo info)
If the plugin was already known and info
has a lower version or the plugin was already loaded,
info
is not added.
info
was added; false, otherwisepublic boolean addFromPackage(PackageInfo p) throws ParseException, UnsatisfiedDependenciesException
ParseException
UnsatisfiedDependenciesException
add(PluginInfo)
public void addPluginListener(PluginListener l)
public void removePluginListener(PluginListener l)
public PluginInfo getCorePackage()
public static java.lang.String getCoreVersion()
public int getEnabledCount()
public void guiStarted()
XNapFrame
.
public void guiStopped()
XNapFrame
.
public PluginInfo getInfoByName(java.lang.String name)
name
- the plugin's namepublic java.util.Iterator infos()
PluginInfo
objects.
Changes made to the iterator are not reflected.
public Plugin load(PluginInfo info) throws java.lang.Exception
info
. All required jar
files are added to the class loader and the plugin class is
instantiated.
info
- the plugin to be loaded
java.lang.Exception
public void restore()
Preferences
.
public void save()
public void setEnabled(Plugin plugin, boolean enable) throws java.lang.Exception
java.lang.Exception
public int size()
public void remove(PluginInfo info)
public static java.lang.String[] resolveClassPath(PluginInfo info) throws ParseException, UnsatisfiedDependenciesException
ParseException
UnsatisfiedDependenciesException
public void updateFromPackageManager()
XNapPackageManager
.
public void write()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |