Class PluginManager

java.lang.Object
com.iizigo.plugin.PluginManager

public class PluginManager extends Object
The plug-in handler is the manager class for IIZI plug-ins, using the Eclipse OSGi bundle framework.
Author:
Christopher Mindus
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    activatePlugins(String requiredPlugins)
    Activates the list of plug-ins if not already done.
    static List<URL>
    getBundleClasspath(org.osgi.framework.Bundle bundle)
    Finds the classpath entries for a bundle and its required bundles.
    static org.eclipse.ui.menus.CommandContributionItem[]
    getNewWizards(ModuleModel model, String folderName)
    Gets the new wizards, sorted by label.
    Gets the registered plug-ins sorted by name.
    static List<String>
    Gets the classpath entries used for the Server and all the core plug-ins (Database, WebServices, Terminal and other registered plugins).
    static boolean
    Checks if a required plug-in is available.
    static void
    onInitialLayout(org.eclipse.ui.IPageLayout layout, org.eclipse.ui.IFolderLayout folder, org.eclipse.ui.IFolderLayout outlineFolder, org.eclipse.ui.IFolderLayout outputFolder)
    Calls the plug-ins to perform IIZI Module perspective customization.
    static void
    onProjectChanged(org.eclipse.core.resources.IResourceDelta delta)
    Called during workspace change to inform the plug-in of a project change.
    static void
    Registers a plug-in.
    static boolean
    waitPluginLoaded(org.eclipse.core.runtime.IProgressMonitor monitor)
    Waits for the all required plug-in's to complete loading before loading projects.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PluginManager

      public PluginManager()
  • Method Details

    • getBundleClasspath

      public static List<URL> getBundleClasspath(org.osgi.framework.Bundle bundle)
      Finds the classpath entries for a bundle and its required bundles. Only "IIZI" bundles are processed, not other ones.
      Parameters:
      bundle - The bundle.
      Returns:
      The unmodifiable list of classpath URL's for the bundle, null if not found.
    • activatePlugins

      public static void activatePlugins(String requiredPlugins) throws org.eclipse.core.runtime.CoreException
      Activates the list of plug-ins if not already done.
      Parameters:
      requiredPlugins - Comma-separated value of plug-in's symbolic name, or null for none.
      Throws:
      org.eclipse.core.runtime.CoreException - For bundle action errors.
    • waitPluginLoaded

      public static boolean waitPluginLoaded(org.eclipse.core.runtime.IProgressMonitor monitor)
      Waits for the all required plug-in's to complete loading before loading projects.
      Parameters:
      monitor - The progress monitor for the load job.
      Returns:
      true for success, false for canceled.
    • isAvailable

      public static boolean isAvailable(String sn)
      Checks if a required plug-in is available.
      Parameters:
      sn - The symbolic name.
      Returns:
      true if available and loaded.
    • register

      public static void register(PluginDescriptor pd) throws org.eclipse.core.runtime.CoreException
      Registers a plug-in.
      Throws:
      org.eclipse.core.runtime.CoreException - For registration failures.
    • getNewWizards

      public static org.eclipse.ui.menus.CommandContributionItem[] getNewWizards(ModuleModel model, String folderName)
      Gets the new wizards, sorted by label.
      Parameters:
      model - The module model in question.
      folderName - Folder name to match, null for any.
    • getPlugins

      public static PluginDescriptor[] getPlugins()
      Gets the registered plug-ins sorted by name.
      Returns:
      The plug-in's registered, including non-directory or file based plug-in's such as UI component plug-in's.
    • onInitialLayout

      public static void onInitialLayout(org.eclipse.ui.IPageLayout layout, org.eclipse.ui.IFolderLayout folder, org.eclipse.ui.IFolderLayout outlineFolder, org.eclipse.ui.IFolderLayout outputFolder)
      Calls the plug-ins to perform IIZI Module perspective customization.
    • onProjectChanged

      public static void onProjectChanged(org.eclipse.core.resources.IResourceDelta delta)
      Called during workspace change to inform the plug-in of a project change.
      Parameters:
      delta - The resource delta.
    • getServerCoreAndPluginClasspath

      public static List<String> getServerCoreAndPluginClasspath()
      Gets the classpath entries used for the Server and all the core plug-ins (Database, WebServices, Terminal and other registered plugins).
      Returns:
      The immutable classpath list.