Package com.iizigo.plugin
Class PluginManager
- java.lang.Object
 - com.iizigo.plugin.PluginManager
 
public class PluginManager extends java.lang.ObjectThe 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 PluginManager()
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidactivatePlugins(java.lang.String requiredPlugins)Activates the list of plug-ins if not already done.static java.util.List<java.net.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, java.lang.String folderName)Gets the new wizards, sorted by label.static PluginDescriptor[]getPlugins()Gets the registered plug-ins sorted by name.static java.util.List<java.lang.String>getServerCoreAndPluginClasspath()Gets the classpath entries used for the Server and all the core plug-ins (Database, WebServices, Terminal and other registered plugins).static booleanisAvailable(java.lang.String sn)Checks if a required plug-in is available.static voidonInitialLayout(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 voidonProjectChanged(org.eclipse.core.resources.IResourceDelta delta)Called during workspace change to inform the plug-in of a project change.static voidregister(PluginDescriptor pd)Registers a plug-in.static booleanwaitPluginLoaded(org.eclipse.core.runtime.IProgressMonitor monitor)Waits for the all required plug-in's to complete loading before loading projects.
Method Detail
getBundleClasspath
public static java.util.List<java.net.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(java.lang.String requiredPlugins) throws org.eclipse.core.runtime.CoreExceptionActivates 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(java.lang.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, java.lang.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 java.util.List<java.lang.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.