Package org.eclipse.ui.internal

# Class UIPlugin

java.lang.Object
org.eclipse.core.runtime.Plugin
org.eclipse.ui.plugin.AbstractUIPlugin
org.eclipse.ui.internal.UIPlugin

All Implemented Interfaces:
  `BundleActivator`

public final class UIPlugin extends AbstractUIPlugin
The plug-in class for the org.eclipse.ui plug-in. This class is internal to the workbench and should not be referenced by clients.

## Field Summary

### 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
`UIPlugin()`
Creates an instance of the UIPlugin.

## Method Summary

Modifier and Type
Method
Description
`protected ImageRegistry`
`createImageRegistry()`
Returns the image registry for this plugin.
`static UIPlugin`
`getDefault()`
Returns the default instance of the receiver.
`ImageRegistry`
`getImageRegistry()`
Returns the image registry for this UI plug-in.
`void`
`start(BundleContext context)`
The `AbstractUIPlugin` implementation of this `Plugin` method refreshes the plug-in actions.

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

`getDialogSettings, getPreferenceStore, getWorkbench, imageDescriptorFromPlugin, initializeDefaultPluginPreferences, initializeDefaultPreferences, initializeImageRegistry, loadDialogSettings, loadPreferenceStore, refreshPluginActions, saveDialogSettings, savePreferenceStore, shutdown, startup, stop`

### 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`

## Constructor Details

### UIPlugin

public UIPlugin()
Creates an instance of the UIPlugin.

Since:
  3.0

## Method Details

### createImageRegistry

protected ImageRegistry createImageRegistry()
Returns the image registry for this plugin. Where are the images? The images (typically png) are found in the same plugins directory. Note: The workbench uses the standard JFace ImageRegistry to track its images. In addition the class WorkbenchGraphicResources provides convenience access to the graphics resources and fast field access for some of the commonly used graphical images.

Overrides:
  `createImageRegistry` in class `AbstractUIPlugin`
Returns:
  ImageRegistry the resulting registry.
See Also:
  - `ImageRegistry`

### getImageRegistry

public ImageRegistry getImageRegistry()
Description copied from class: `AbstractUIPlugin`
Returns the image registry for this UI plug-in.

The image registry contains the images used by this plug-in that are very frequently used and so need to be globally shared within the plug-in. Since many OSs have a severe limit on the number of images that can be in memory at any given time, a plug-in should only keep a small number of images in their registry.

Subclasses should reimplement `initializeImageRegistry` if they have custom graphic images to load.

Subclasses may override this method but are not expected to.

Overrides:
  `getImageRegistry` in class `AbstractUIPlugin`
Returns:
  the image registry

### getDefault

public static UIPlugin getDefault()
Returns the default instance of the receiver. This represents the runtime plugin.

Returns:
  UIPlugin the singleton instance of the receiver.
See Also:
  - `for the typical implementation pattern for plugin classes.`

### start

public void start(BundleContext context) throws Exception
Description copied from class: `AbstractUIPlugin`
The `AbstractUIPlugin` implementation of this `Plugin` method refreshes the plug-in actions. Subclasses may extend this method, but must send super first. Starts up this plug-in.

This method should be overridden in subclasses that need to do something when this plug-in is started. Implementors should call the inherited method at the first possible point to ensure that any system requirements can be met.

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 `Plugin.stop(BundleContext)` may be called from separate threads, but the OSGi framework ensures that both methods will not be called simultaneously.

Clients must never explicitly call this method.

Specified by:
  `start` in interface `BundleActivator`
Overrides:
  `start` in class `AbstractUIPlugin`
Parameters:
  `context` - the bundle context for this plug-in
Throws:
  `Exception` - if this plug-in did not start up properly