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.

Version:
$Id: PluginManager.java 15984 2014-05-19 20:54:03Z onoprien $
Author:
tonyj

Constructor Summary
PluginManager()
           
 
Method Summary
 PluginPreferences getPreferences()
          Returns an object that provides access to current PluginManager settings.
 boolean install(Component parent, Collection<PluginInfo> plugins)
          Installs specified plugins into the application extensions directories.
 void offerUpdate()
          Offers the user to update installed plugins and executes user's command.
 void restart(Component parentComponent)
          Displays dialog informing the user that the application needs to be restarted.
 void run()
           
 void setPluginListHandler(PluginListHandler pluginListHandler)
           
 void showPluginManager()
          Displays PluginManagerDialog.
 boolean uninstall(Component parent, Collection<PluginInfo> plugins)
          Uninstall specified plugins.
 boolean update(Component parent)
          Updates all installed plugins for which newer versions are available.
 boolean update(Component parent, Collection<PluginInfo> plugins)
          Downloads, installs, and loads latest versions of files for the specified plugins.
 
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

getPreferences

public PluginPreferences getPreferences()
Returns an object that provides access to current PluginManager settings.


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

update

public boolean update(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.

restart

public void restart(Component parentComponent)
Displays dialog informing the user that the application needs to be restarted. If the user selects "Restart Now", restarting is attempted. If the restart fails for any reason, the application is shut down. If the user selects "Restart Later", this method returns without any further actions.

Parameters:
parentComponent - Parent component for the dialog. If null, the application window is used as a parent.


Copyright © 2000-2014 FreeHEP. All Rights Reserved.