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 SummaryFields inherited from class org.graffiti.plugin.EditorPluginAdaptertools
- 
Constructor SummaryConstructors Constructor Description AddonManagerPlugin()Creates a new menu-entry for the Add-ons and waits for all plugins to be started.
- 
Method SummaryModifier 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_EditorPluginAdaptergetIconMethods inherited from class org.graffiti.plugin.EditorPluginAdaptergetAttributeComponents, getGUIComponents, getInspectorTabs, getModes, getShapes, getTools, getValueEditComponentsMethods inherited from class org.graffiti.plugin.GenericPluginAdapterconfigure, 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.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.graffiti.plugin.GenericPluginconfigure, doBeforeExit, getAlgorithms, getAttributeDescriptions, getAttributes, getDefaultView, getDependencies, getExtensions, getInputSerializers, getOutputSerializers, getURLattributeActions, getViews, interrupt, isSelectionListener, isSessionListener, isViewListener, needsEditComponents, stop
- 
Constructor Details- 
AddonManagerPluginpublic 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)
 
- 
expandClasspathByJarfileExpands the classloader by the Add-on jarfile.- Parameters:
- files- the files
 
- 
addAddonAdds the addon to Vanted.- Parameters:
- f- The Add-on-Jar-File.
 
- 
writeDeactivatedListToFilepublic void writeDeactivatedListToFile()Write deactivated list to file.- Parameters:
- list- The file-list
 
- 
activateAddonpublic boolean activateAddon(int number)Activate deactivated addon.- Parameters:
- number- the number
 
- 
deactivateAddonpublic void deactivateAddon(int number)
- 
installAddonpublic 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 directory
- jarname- the jarname of the add-on
- Throws:
- FileNotFoundException- the file not found exception
- IOException- Signals that an I/O exception has occurred.
 
- 
removeAddonRemoves the Add-on by renaming it.- Parameters:
- file- the file
- Throws:
- FileNotFoundException- the file not found exception
- IOException- Signals that an I/O exception has occurred.
 
- 
showManageAddonDialogpublic void showManageAddonDialog()Shows Add-on-Manage-Dialog.
- 
showManageAddonDialogShows Add-on-Manage-Dialog.
- 
showManageAddonDialog
- 
getAddonsGets the all the Add-ons as a list.- Returns:
- the addons
 
- 
process- Specified by:
- processin interface- DragAndDropHandler
 
- 
getAddon
- 
getDeactivatedAddons
- 
addonsLoadedpublic static boolean addonsLoaded()
- 
canProcess- Specified by:
- canProcessin interface- DragAndDropHandler
- 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.
 
- 
hasPrioritypublic boolean hasPriority()- Specified by:
- hasPriorityin interface- DragAndDropHandler
- Returns:
- True, if the handler should be called before other handlers are executed, which return False.
 
- 
activateAddon
 
-