Class PlatformServicesUiPlugin

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

    public class PlatformServicesUiPlugin
    extends org.eclipse.ui.plugin.AbstractUIPlugin
    The activator class controls the plug-in life cycle.
    • Constructor Detail

      • PlatformServicesUiPlugin

        public PlatformServicesUiPlugin()
    • Method Detail

      • createErrorStatus

        public static org.eclipse.core.runtime.IStatus createErrorStatus​(String message,
                                                                         Throwable throwable)
        Create error status by given message and cause throwable.
        Parameters:
        message - status message, cannot be null
        throwable - throwable, can be null if not applicable
        Returns:
        status created error status, never null
      • createErrorStatus

        public static org.eclipse.core.runtime.IStatus createErrorStatus​(String message)
        Create error status by given message.
        Parameters:
        message - status message, cannot be null
        Returns:
        status created error status, never null
      • createWarningStatus

        public static org.eclipse.core.runtime.IStatus createWarningStatus​(String message)
        Create warning status by given message.
        Parameters:
        message - status message, cannot be null
        Returns:
        status created warning status, never null
      • getDefault

        public static PlatformServicesUiPlugin getDefault()
        Returns the shared instance.
        Returns:
        the shared instance
      • getImage

        public static org.eclipse.swt.graphics.Image getImage​(String symbolicName)
        Get image for given symbolic name.
        Parameters:
        symbolicName - image name, cannot be null
        Returns:
        image, or null if not found
      • getImageDescriptor

        public static org.eclipse.jface.resource.ImageDescriptor getImageDescriptor​(String symbolicName)
        Get image descriptor for given symbolic name.
        Parameters:
        symbolicName - image name, cannot be null
        Returns:
        image descriptor, or null if not found
      • getShell

        public static org.eclipse.swt.widgets.Shell getShell()
        Gets current active shell. Can return null.
        Returns:
        active shell, can be null
      • log

        public static void log​(org.eclipse.core.runtime.IStatus status)
        Write given status to log.
        Parameters:
        status - status to log, cannot be null
      • log

        public static void log​(Throwable throwable)
        Logs the specified Throwable with this plug-in's log.
        Parameters:
        throwable - Throwable to log
      • getButtonWidthHint

        public static int getButtonWidthHint​(org.eclipse.swt.widgets.Button button)
        Compute given button width.
        Parameters:
        button - button to compute width for, cannot be null
        Returns:
        button width
      • initializeImageRegistry

        protected void initializeImageRegistry​(org.eclipse.jface.resource.ImageRegistry registry)
        Overrides:
        initializeImageRegistry in class org.eclipse.ui.plugin.AbstractUIPlugin
      • start

        public void start​(org.osgi.framework.BundleContext context)
                   throws Exception
        Specified by:
        start in interface org.osgi.framework.BundleActivator
        Overrides:
        start in class org.eclipse.ui.plugin.AbstractUIPlugin
        Throws:
        Exception
      • 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
      • getInjector

        public com.google.inject.Injector getInjector()
        Returns the plugin Guice-injector. Method is synchronized.
        Returns:
        plugin Guice-injector, never null