org.freehep.application.studio.pluginmanager
Class PluginManager

java.lang.Object
  extended by org.freehep.application.studio.Plugin
      extended by org.freehep.application.studio.pluginmanager.PluginManager
All Implemented Interfaces:
Runnable

public class PluginManager
extends Plugin
implements Runnable

A Plugin which provides a Plugin Manager. TODO: 1. Standardize property keys. 2. Inform user if additional plugins are being uninstalled. 3. Do I need update(Component parent, Collection plugins) ?

Version:
$Id: PluginManager.java 14719 2013-04-30 19:36:00Z onoprien $
Author:
tonyj

Constructor Summary
PluginManager()
           
 
Method Summary
 URL getCheckURL()
          Getter for property checkURL.
 boolean install(Component parent, Collection<PluginInfo> plugins)
          Installs specified plugins into the application extensions directories.
 boolean isCheckAtStart()
          Getter for property checkAtStart.
 boolean isRemoveAppIncompatible()
          Getter for property removeAppIncompatible.
 boolean isRemoveJavaIncompatible()
          Getter for property removeJavaIncompatible.
 void offerUpdate()
          Offers the user to update installed plugins and executes user's command.
 void run()
           
 void setCheckAtStart(boolean checkAtStart)
          Setter for property checkAtStart.
 void setCheckURL(URL checkURL)
          Setter for property checkURL.
 void setPluginListHandler(PluginListHandler pluginListHandler)
           
 void setRemoveAppIncompatible(boolean removeAppIncompatible)
          Setter for property removeJavaIncompatible.
 void setRemoveJavaIncompatible(boolean removeJavaIncompatible)
          Setter for property removeJavaIncompatible.
 void showPluginManager()
          Displays PluginManagerDialog.
 boolean uninstall(Component parent, Collection<PluginInfo> plugins)
          Uninstall specified plugins.
 boolean update(Component parent, Collection<PluginInfo> plugins)
          Downloads, installs, and loads latest versions of files for the specified plugins.
 boolean updateInstalledPlugins(Component parent)
          Updates all installed plugins for which newer versions are available.
 
Methods inherited from class org.freehep.application.studio.Plugin
canBeShutDown, getApplication
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginManager

public PluginManager()
Method Detail

isCheckAtStart

public boolean isCheckAtStart()
Getter for property checkAtStart. If true, the plugin manager will start downloading a list of available and updatable plugins when the application is started.


getCheckURL

public URL getCheckURL()
Getter for property checkURL. URL from which the list of available and updatable plugins should be downloaded.


isRemoveJavaIncompatible

public boolean isRemoveJavaIncompatible()
Getter for property removeJavaIncompatible. If true, plugins incompatible with the currently used java runtime version are uninstalled when extension directories are purged.


isRemoveAppIncompatible

public boolean isRemoveAppIncompatible()
Getter for property removeAppIncompatible. If true, plugins incompatible with the currently used application version are uninstalled when extension directories are purged.


setCheckAtStart

public void setCheckAtStart(boolean checkAtStart)
Setter for property checkAtStart. If true, the plugin manager will start downloading a list of available plugins when the application is started.


setCheckURL

public void setCheckURL(URL checkURL)
Setter for property checkURL. URL from which the list of available and plugins should be downloaded.


setRemoveJavaIncompatible

public void setRemoveJavaIncompatible(boolean removeJavaIncompatible)
Setter for property removeJavaIncompatible. If true, plugins incompatible with the currently used java runtime version are uninstalled when extension directories are purged.


setRemoveAppIncompatible

public void setRemoveAppIncompatible(boolean removeAppIncompatible)
Setter for property removeJavaIncompatible. If true, plugins incompatible with the currently used application version are uninstalled when extension directories are purged.


setPluginListHandler

public void setPluginListHandler(PluginListHandler pluginListHandler)

showPluginManager

public void showPluginManager()
Displays PluginManagerDialog. Should be called from the event processing thread.


offerUpdate

public void offerUpdate()
Offers the user to update installed plugins and executes user's command. Should be called from the event processing thread.


run

public void run()
Specified by:
run in interface Runnable

updateInstalledPlugins

public boolean updateInstalledPlugins(Component parent)
Updates all installed plugins for which newer versions are available.

Parameters:
parent - Component to be used as parent by any GUI windows displayed while executing this method, if any. If null, no error notifications will be displayed, and IllegalArgumentException will be thrown instead.
Returns:
true if restarting the application is required for the changes to take effect.
Throws:
IllegalArgumentException - if errors occur while updating, and parent was not specified.

install

public boolean install(Component parent,
                       Collection<PluginInfo> plugins)
Installs specified plugins into the application extensions directories.

Parameters:
parent - Component to be used as parent by any GUI windows displayed while executing this method, if any. If null, no error notifications will be displayed, and IllegalArgumentException will be thrown instead.
plugins - Plugins to be installed. May or may not contain required dependencies.
Returns:
true if restarting the application is required for the changes to take effect.
Throws:
IllegalArgumentException - if errors occur while updating, and parent was not specified.

uninstall

public boolean uninstall(Component parent,
                         Collection<PluginInfo> plugins)
Uninstall specified plugins.

Parameters:
parent - Component to be used as parent by any GUI windows displayed while executing this method, if any. If null, no error notifications will be displayed, and IllegalArgumentException will be thrown instead.
plugins - Plugins to be uninstalled. May or may not contain required dependencies.
Returns:
true if restarting the application is required for the changes to take effect.
Throws:
IllegalArgumentException - if errors occur while updating, and parent was not specified.

update

public boolean update(Component parent,
                      Collection<PluginInfo> plugins)
Downloads, installs, and loads latest versions of files for the specified plugins.

Parameters:
parent - Component to be used as parent by any GUI windows displayed while executing this method, if any. If null, no error notifications will be displayed, and IllegalArgumentException will be thrown instead.
plugins - Plugins to update.
Returns:
true if restarting the application is required for the changes to take effect.
Throws:
IllegalArgumentException - if the update fails, and parent was not specified.


Copyright © 2000-2013 FreeHEP. All Rights Reserved.