Class Activator

  • All Implemented Interfaces:
    org.osgi.framework.BundleActivator

    public class Activator
    extends org.eclipse.ui.plugin.AbstractUIPlugin
    The activator class controls the plug-in life cycle.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ERROR  
      static java.lang.String LOGO  
      private static Activator plugin
      The shared instance.
      static java.lang.String PLUGIN_ID
      The plug-in ID.
      static java.lang.String PRE  
      static java.lang.String WARNING  
      • 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
      Activator()
      The constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Activator getDefault()
      Returns the shared instance.
      static org.eclipse.swt.graphics.Image getImage​(java.lang.String path)
      Get icon by path.
      static org.eclipse.jface.resource.ImageDescriptor getImageDescriptor​(java.lang.String path)
      Returns an image descriptor for the image file at the given plug-in relative path.
      static EASyLoggerFactory.EASyLogger getLogger​(java.lang.Class<?> cls)
      Returns the EASy logger for the specified class.
      static java.lang.String getVersion()
      Returns the version of the specified bundle as specified in its manifest.
      void start​(org.osgi.framework.BundleContext context)
      The AbstractUIPlugin implementation of this Plugin method refreshes the plug-in actions.
      This instance is created.
      void stop​(org.osgi.framework.BundleContext context)
      The AbstractUIPlugin implementation of this Plugin method saves this plug-in's preference and dialog stores and shuts down its image registry (if they are in use).
      • 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, getDescriptor, 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
    • Constructor Detail

      • Activator

        public Activator()
        The constructor.
    • Method Detail

      • start

        public void start​(org.osgi.framework.BundleContext context)
                   throws java.lang.Exception
        The AbstractUIPlugin implementation of this Plugin method refreshes the plug-in actions.
        This instance is created.
        Specified by:
        start in interface org.osgi.framework.BundleActivator
        Overrides:
        start in class org.eclipse.ui.plugin.AbstractUIPlugin
        Parameters:
        context - the bundle context for this plug-in
        Throws:
        java.lang.Exception - if this plug-in did not start up properly
      • stop

        public void stop​(org.osgi.framework.BundleContext context)
                  throws java.lang.Exception
        The AbstractUIPlugin implementation of this Plugin method saves this plug-in's preference and dialog stores and shuts down its image registry (if they are in use).
        Specified by:
        stop in interface org.osgi.framework.BundleActivator
        Overrides:
        stop in class org.eclipse.ui.plugin.AbstractUIPlugin
        Parameters:
        context - the bundle context for this plug-in
        Throws:
        java.lang.Exception - if this plug-in did not start up properly
      • getDefault

        public static Activator getDefault()
        Returns the shared instance.
        Returns:
        the shared instance
      • getImageDescriptor

        public static org.eclipse.jface.resource.ImageDescriptor getImageDescriptor​(java.lang.String path)
        Returns an image descriptor for the image file at the given plug-in relative path.
        Parameters:
        path - the path of the image inside this plug-in.
        Returns:
        the image descriptor
      • getImage

        public static org.eclipse.swt.graphics.Image getImage​(java.lang.String path)
        Get icon by path.
        Parameters:
        path - the path to the image/icon
        Returns:
        the image/icon
      • getLogger

        public static EASyLoggerFactory.EASyLogger getLogger​(java.lang.Class<?> cls)
        Returns the EASy logger for the specified class.
        Parameters:
        cls - the class to return the logger for
        Returns:
        the logger
      • getVersion

        public static java.lang.String getVersion()
        Returns the version of the specified bundle as specified in its manifest.
        Returns:
        The version in the following format: <number>.<number>.<number>