Package com.iizigo.ws

Class PluginActivator

java.lang.Object
org.eclipse.core.runtime.Plugin
org.eclipse.ui.plugin.AbstractUIPlugin
com.iizigo.ws.PluginActivator
All Implemented Interfaces:
IPluginInitialize, IModulePerspective, org.osgi.framework.BundleActivator

public class PluginActivator extends org.eclipse.ui.plugin.AbstractUIPlugin implements IPluginInitialize, IModulePerspective
The activator class controls the plug-in life cycle.
Author:
Christopher Mindus
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The plug-in directory ID.
    static final String
    The plug-in ID.
    static final PropertyEditorSetup
    The resource setup.

    Fields inherited from class org.eclipse.core.runtime.Plugin

    PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
  • Constructor Summary

    Constructors
    Constructor
    Description
    The constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    createNewWizards(ArrayList<org.eclipse.ui.menus.CommandContributionItem> newWizards)
    Call to fill the array with "New Wizards".
    Returns the shared instance
    static org.eclipse.jface.resource.ImageDescriptor
    getIcon(String fileName)
    Returns an image descriptor for the image file at the given plug-in relative path.
    Returns the shared instance.
    Gets the IIZI PluginDescriptor.
    void
    Initializes the plug-in after the Module project has been loaded.
    void
    onInitialLayout(org.eclipse.ui.IPageLayout layout, org.eclipse.ui.IFolderLayout folder, org.eclipse.ui.IFolderLayout outlineFolder, org.eclipse.ui.IFolderLayout outputfolder)
    Called when the Module perspective has completed initializing itself with IIZI-related items.
    void
    Registers this plug-in with iiziGo.
    void
    start(org.osgi.framework.BundleContext context)
    Starts up the WebService plug-in bundle.
    void
    stop(org.osgi.framework.BundleContext context)
     

    Methods inherited from class org.eclipse.ui.plugin.AbstractUIPlugin

    createImageRegistry, getDialogSettings, getImageRegistry, getPreferenceStore, getWorkbench, imageDescriptorFromPlugin, initializeDefaultPluginPreferences, initializeDefaultPreferences, initializeImageRegistry, loadDialogSettings, loadPreferenceStore, refreshPluginActions, saveDialogSettings, savePreferenceStore, shutdown, startup

    Methods inherited from class org.eclipse.core.runtime.Plugin

    find, find, getBundle, getLog, getPluginPreferences, getStateLocation, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • PluginActivator

      public PluginActivator()
      The constructor
  • Method Details

    • getInstance

      public static PluginActivator getInstance()
      Returns the shared instance.
      Returns:
      The shared instance.
    • start

      public void start(org.osgi.framework.BundleContext context) throws Exception
      Starts up the WebService plug-in bundle.

      If this method throws an exception, it is taken as an indication that plug-in initialization has failed; as a result, the plug-in will not be activated; moreover, the plug-in will be marked as disabled and ineligible for activation for the duration.

      Note 1: This method is automatically invoked by the platform the first time any code in the plug-in is executed.

      Note 2: This method is intended to perform simple initialization of the plug-in environment. The platform may terminate initializers that do not complete in a timely fashion.

      Note 3: The class loader typically has monitors acquired during invocation of this method. It is strongly recommended that this method avoid synchronized blocks or other thread locking mechanisms, as this would lead to deadlock vulnerability.

      Note 4: The supplied bundle context represents the plug-in to the OSGi framework. For security reasons, it is strongly recommended that this object should not be divulged.

      Note 5: This method and the stop(BundleContext) may be called from separate threads, but the OSGi framework ensures that both methods will not be called simultaneously.

      Specified by:
      start in interface org.osgi.framework.BundleActivator
      Overrides:
      start in class org.eclipse.ui.plugin.AbstractUIPlugin
      Parameters:
      context - The bundle context.
      Throws:
      Exception - For errors in loading the IIZI properties framework.
    • registerPlugin

      public void registerPlugin() throws org.eclipse.core.runtime.CoreException
      Registers this plug-in with iiziGo. This method is called from IIZI Designer when an application requires the plug-in. The plug-in should check if registration already has been done, and if so, skip the registration. This is required due to the OSGi framework threading at startup of Eclipse.
      Specified by:
      registerPlugin in interface IPluginInitialize
      Throws:
      org.eclipse.core.runtime.CoreException - For registration failures.
    • initializeModule

      public void initializeModule(ModuleModel model) throws org.eclipse.core.runtime.CoreException
      Initializes the plug-in after the Module project has been loaded.
      Specified by:
      initializeModule in interface IPluginInitialize
      Parameters:
      model - The Module project.
      Throws:
      org.eclipse.core.runtime.CoreException - For initialization failures.
    • stop

      public void stop(org.osgi.framework.BundleContext context) throws Exception
      Specified by:
      stop in interface org.osgi.framework.BundleActivator
      Overrides:
      stop in class org.eclipse.ui.plugin.AbstractUIPlugin
      Throws:
      Exception
    • getDefault

      public static PluginActivator getDefault()
      Returns the shared instance
      Returns:
      the shared instance
    • getPluginDescriptor

      public static PluginDescriptor getPluginDescriptor()
      Gets the IIZI PluginDescriptor.
      Returns:
      The static descriptor.
    • createNewWizards

      public void createNewWizards(ArrayList<org.eclipse.ui.menus.CommandContributionItem> newWizards)
      Call to fill the array with "New Wizards".
      Specified by:
      createNewWizards in interface IPluginInitialize
      Parameters:
      newWizards - Array of New Wizard's.
    • getIcon

      public static org.eclipse.jface.resource.ImageDescriptor getIcon(String fileName)
      Returns an image descriptor for the image file at the given plug-in relative path.
      Parameters:
      fileName - The image file name inside "icons".
      Returns:
      the image descriptor.
    • onInitialLayout

      public void onInitialLayout(org.eclipse.ui.IPageLayout layout, org.eclipse.ui.IFolderLayout folder, org.eclipse.ui.IFolderLayout outlineFolder, org.eclipse.ui.IFolderLayout outputfolder)
      Called when the Module perspective has completed initializing itself with IIZI-related items. Once the plug-ins complete their processing, additional Java and Java-EE items are added.
      Specified by:
      onInitialLayout in interface IModulePerspective
      Parameters:
      layout - The page layout.
      folder - The folder area, left side.
      outlineFolder - The outline folder on the right side, perhaps null (be careful!).
      outputfolder - The output folder area, bottom placement.