Class AddonManagerPlugin
java.lang.Object
org.graffiti.plugin.GenericPluginAdapter
org.graffiti.plugin.EditorPluginAdapter
de.ipk_gatersleben.ag_nw.graffiti.IPK_EditorPluginAdapter
de.ipk_gatersleben.ag_nw.graffiti.plugins.addons.AddonManagerPlugin
- All Implemented Interfaces:
DragAndDropHandler,EditorPlugin,GenericPlugin
public class AddonManagerPlugin extends IPK_EditorPluginAdapter implements DragAndDropHandler
This class manages Add-ons, which are Vanted-plugins loaded during runtime.
Usually such an Add-on brings more functionality than plugins, e.g. extending
Vanted by complete Flux-Balance Analysis or 3D-networks. Add-ons are
downloaded/distributed as a jar-file. An exemplary Add-on can be found in the
CVS and serve as a starting point.
- Author:
- Hendrik Rohn, Christian Klukas
-
Field Summary
Fields inherited from class org.graffiti.plugin.EditorPluginAdapter
tools -
Constructor Summary
Constructors Constructor Description AddonManagerPlugin()Creates a new menu-entry for the Add-ons and waits for all plugins to be started. -
Method Summary
Modifier and Type Method Description booleanactivateAddon(int number)Activate deactivated addon.booleanactivateAddon(String name)AddOnInstallResultaddAddon(PluginDescription pd, File f, boolean onStartup)Adds the addon to Vanted.static booleanaddonsLoaded()booleancanProcess(File f)voiddeactivateAddon(int number)static voidexpandClasspathByJarfile(URL[] files)Expands the classloader by the Add-on jarfile.AddongetAddon(int number)ArrayList<Addon>getAddons()Gets the all the Add-ons as a list.Collection<String>getDeactivatedAddons()static AddonManagerPlugingetInstance()booleanhasPriority()booleaninstallAddon(String jardir, String jarname)Install Add-on by copying the jarfile and loading it.booleanprocess(List<File> files)voidremoveAddon(File file)Removes the Add-on by renaming it.voidshowManageAddonDialog()Shows Add-on-Manage-Dialog.voidshowManageAddonDialog(Window parent)Shows Add-on-Manage-Dialog.voidshowManageAddonDialog(String msg, boolean highlightUpdate)voidwriteDeactivatedListToFile()Write deactivated list to file.Methods inherited from class de.ipk_gatersleben.ag_nw.graffiti.IPK_EditorPluginAdapter
getIconMethods inherited from class org.graffiti.plugin.EditorPluginAdapter
getAttributeComponents, getGUIComponents, getInspectorTabs, getModes, getShapes, getTools, getValueEditComponentsMethods inherited from class org.graffiti.plugin.GenericPluginAdapter
configure, doBeforeExit, getAddonIcon, getAlgorithms, getAttributeDescriptions, getAttributes, getDefaultView, getDependencies, getExtensions, getGraphPostProcessors, getInputSerializers, getOutputSerializers, getURLattributeActions, getViews, interrupt, isSelectionListener, isSessionListener, isViewListener, needsEditComponents, setIsAddon, stopMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.graffiti.plugin.GenericPlugin
configure, doBeforeExit, getAlgorithms, getAttributeDescriptions, getAttributes, getDefaultView, getDependencies, getExtensions, getInputSerializers, getOutputSerializers, getURLattributeActions, getViews, interrupt, isSelectionListener, isSessionListener, isViewListener, needsEditComponents, stop
-
Constructor Details
-
AddonManagerPlugin
public AddonManagerPlugin()Creates a new menu-entry for the Add-ons and waits for all plugins to be started. Then the Add-ons can be loaded.
-
-
Method Details
-
getInstance
- Returns:
- The Addonmanager instance or null, if no instance was created (e.g. deselected)
-
expandClasspathByJarfile
Expands the classloader by the Add-on jarfile.- Parameters:
files- the files
-
addAddon
Adds the addon to Vanted.- Parameters:
f- The Add-on-Jar-File.
-
writeDeactivatedListToFile
public void writeDeactivatedListToFile()Write deactivated list to file.- Parameters:
list- The file-list
-
activateAddon
public boolean activateAddon(int number)Activate deactivated addon.- Parameters:
number- the number
-
deactivateAddon
public void deactivateAddon(int number) -
installAddon
public boolean installAddon(String jardir, String jarname) throws FileNotFoundException, IOExceptionInstall Add-on by copying the jarfile and loading it.- Parameters:
jardir- the jardir, which must not be the add-on directoryjarname- the jarname of the add-on- Throws:
FileNotFoundException- the file not found exceptionIOException- Signals that an I/O exception has occurred.
-
removeAddon
Removes the Add-on by renaming it.- Parameters:
file- the file- Throws:
FileNotFoundException- the file not found exceptionIOException- Signals that an I/O exception has occurred.
-
showManageAddonDialog
public void showManageAddonDialog()Shows Add-on-Manage-Dialog. -
showManageAddonDialog
Shows Add-on-Manage-Dialog. -
showManageAddonDialog
-
getAddons
Gets the all the Add-ons as a list.- Returns:
- the addons
-
process
- Specified by:
processin interfaceDragAndDropHandler
-
getAddon
-
getDeactivatedAddons
-
addonsLoaded
public static boolean addonsLoaded() -
canProcess
- Specified by:
canProcessin interfaceDragAndDropHandler- Parameters:
f- Input file to be analyzed for compatibility.- Returns:
- True, if this handler might handle the input file. E.g. based on the file extension.
-
hasPriority
public boolean hasPriority()- Specified by:
hasPriorityin interfaceDragAndDropHandler- Returns:
- True, if the handler should be called before other handlers are executed, which return False.
-
activateAddon
-