Package com.iizigo.plugin
Class PluginManager
java.lang.Object
com.iizigo.plugin.PluginManager
The plug-in handler is the manager class for IIZI plug-ins, using the Eclipse OSGi bundle framework.
- Author:
- Christopher Mindus
Constructor Summary
Method Summary
Modifier and TypeMethodDescriptionstatic void
activatePlugins
(String requiredPlugins) Activates the list of plug-ins if not already done.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.static PluginDescriptor[]
Gets the registered plug-ins sorted by name.Gets the classpath entries used for the Server and all the core plug-ins (Database, WebServices, Terminal and other registered plugins).static boolean
isAvailable
(String sn) 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.
Constructor Details
PluginManager
public PluginManager()
Method Details
getBundleClasspath
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
Checks if a required plug-in is available.- Parameters:
sn
- The symbolic name.- Returns:
- true if available and loaded.
register
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
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
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.