Class WorkbenchPlugin
- All Implemented Interfaces:
- BundleActivator
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic booleanGlobal workbench ui plugin flag.static StringThe workbench plugin ID.static charThe character used to separate preference page category idsFields inherited from class org.eclipse.core.runtime.PluginPLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic ObjectcreateExtension(IConfigurationElement element, String classAttribute) Creates an extension.protected ImageRegistryReturns the image registry for this plugin.org.eclipse.ui.internal.registry.ActionSetRegistryReturns the action set registry for the workbench.Returns the application name.Returns the bundle context associated with the workbench plug-in.static BundlegetBundleForExecutableExtension(IConfigurationElement element, String extensionName) Returns the bundle that contains the class referenced by an executable extension.Bundle[]Return an array of all bundles contained in this workbench.FOR INTERNAL WORKBENCH USE ONLY.org.eclipse.ui.internal.decorators.DecoratorManagerGet the decorator manager for the receiverstatic WorkbenchPluginReturn the default instance of the receiver.Answer the manager that maps resource types to a the description of the editor to usegetElementFactory(String targetID) Answer the element factory for an id, ornull. if not found.Return the export wizard registry.Return the import wizard registry.org.eclipse.ui.internal.intro.IIntroRegistryReturns the introduction registry.Return the new wizard registry.Returns the operation support.Return the perspective registry.Get the preference manager.Returns the name of the product.Returns the shared images for the workbench.static ShellgetSplashShell(Display display) Get the splash shell for this workbench instance, if any.static IStatusReturn the status from throwableReturns aTestableObjectprovided by a TestableObject service ornullif a service implementation cannot be found.org.eclipse.ui.internal.themes.IThemeRegistryReturns the theme registry for the workbench.Answer the view registry.Returns the image descriptors for the window image to use for this product.Returns the working set managerorg.eclipse.ui.internal.registry.WorkingSetRegistryReturns the working set registrystatic booleanhasExecutableExtension(IConfigurationElement element, String extensionName) Answers whether the provided element either has an attribute with the given name or a child element with the given name with an attribute called class.voidinitializeContext(IEclipseContext context) Initialized the workbench plug-in with the e4 contextprotected voidSet default preference values.static booleanisBundleLoadedForExecutableExtension(IConfigurationElement element, String extensionName) Checks to see if the provided element has the syntax for an executable extension with a given name that resides in a bundle that is already active.static booleanReturn whether or not the OSGi framework has specified the handle of a splash shell.booleanisStarting(Bundle bundle) static voidLogs the given throwable to the platform log, indicating the class and method from where it is being logged (this is not necessarily where it occurred).static voidLogs the given message to the platform log.static voidLogs the given message and throwable to the platform log.static voidLogs the given message and status to the platform log.static voidLog the throwable.static voidLog the status to the default log.static IStatusCreate a new error from the message and the throwable.voidstart(BundleContext context) TheAbstractUIPluginimplementation of thisPluginmethod refreshes the plug-in actions.voidstop(BundleContext context) TheAbstractUIPluginimplementation of thisPluginmethod saves this plug-in's preference and dialog stores and shuts down its image registry (if they are in use).static voidunsetSplashShell(Display display) Removes any splash shell data set on the provided display and disposes the shell if necessary.Methods inherited from class org.eclipse.ui.plugin.AbstractUIPlugingetDialogSettings, getImageRegistry, getPreferenceStore, getWorkbench, imageDescriptorFromPlugin, initializeDefaultPluginPreferences, initializeImageRegistry, loadDialogSettings, loadPreferenceStore, refreshPluginActions, saveDialogSettings, savePreferenceStore, shutdown, startupMethods inherited from class org.eclipse.core.runtime.Pluginfind, find, getBundle, getLog, getPluginPreferences, getStateLocation, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, toString
- 
Field Details- 
DEBUGpublic static boolean DEBUGGlobal workbench ui plugin flag. Only workbench implementation is allowed to use this flag All other plugins, examples, or test cases must *not* use this flag.
- 
PI_WORKBENCHThe workbench plugin ID.
- 
PREFERENCE_PAGE_CATEGORY_SEPARATORpublic static char PREFERENCE_PAGE_CATEGORY_SEPARATORThe character used to separate preference page category ids
 
- 
- 
Constructor Details- 
WorkbenchPluginpublic WorkbenchPlugin()Create an instance of the WorkbenchPlugin. The workbench plugin is effectively the "application" for the workbench UI. The entire UI operates as a good plugin citizen.
 
- 
- 
Method Details- 
createExtensionpublic static Object createExtension(IConfigurationElement element, String classAttribute) throws CoreException Creates an extension. If the extension plugin has not been loaded a busy cursor will be activated during the duration of the load.- Parameters:
- element- the config element defining the extension
- classAttribute- the name of the attribute carrying the class
- Returns:
- the extension object
- Throws:
- CoreException- if the extension cannot be created
 
- 
hasExecutableExtensionAnswers whether the provided element either has an attribute with the given name or a child element with the given name with an attribute called class.- Parameters:
- element- the element to test
- extensionName- the name of the extension to test for
- Returns:
- whether or not the extension is declared
- Since:
- 3.3
 
- 
isBundleLoadedForExecutableExtensionpublic static boolean isBundleLoadedForExecutableExtension(IConfigurationElement element, String extensionName) Checks to see if the provided element has the syntax for an executable extension with a given name that resides in a bundle that is already active. Determining the bundle happens in one of two ways:
 - The element has an attribute with the specified name or element text in
 the form bundle.id/class.name[:optional attributes]
- The element has a child element with the specified name that has a
 pluginattribute
 - Parameters:
- element- the element to test
- extensionName- the name of the extension to test for
- Returns:
- whether or not the bundle expressed by the above criteria is active. If the bundle cannot be determined then the state of the bundle that declared the element is returned.
- Since:
- 3.3
 
- The element has an attribute with the specified name or element text in
 the form 
- 
getBundleForExecutableExtensionpublic static Bundle getBundleForExecutableExtension(IConfigurationElement element, String extensionName) Returns the bundle that contains the class referenced by an executable extension. Determining the bundle happens in one of two ways:
 - The element has an attribute with the specified name or element text in
 the form bundle.id/class.name[:optional attributes]
- The element has a child element with the specified name that has a
 pluginattribute
 - Parameters:
- element- the element to test
- extensionName- the name of the extension to test for
- Returns:
- the bundle referenced by the extension. If that bundle cannot be
         determined the bundle that declared the element is returned. Note
         that this may be null.
- Since:
- 3.3
 
- The element has an attribute with the specified name or element text in
 the form 
- 
createImageRegistryReturns the image registry for this plugin. Where are the images? The images (typically gifs) are found in the same plugins directory.- Overrides:
- createImageRegistryin class- AbstractUIPlugin
- Returns:
- ImageRegistry the resulting registry.
- See Also:
 
- 
getActionSetRegistrypublic org.eclipse.ui.internal.registry.ActionSetRegistry getActionSetRegistry()Returns the action set registry for the workbench.- Returns:
- the workbench action set registry
 
- 
getDefaultReturn the default instance of the receiver. This represents the runtime plugin.- Returns:
- WorkbenchPlugin
- See Also:
 
- 
getEditorRegistryAnswer the manager that maps resource types to a the description of the editor to use- Returns:
- IEditorRegistry the editor registry used by this plug-in.
 
- 
getElementFactoryAnswer the element factory for an id, ornull. if not found.- Returns:
- IElementFactory
 
- 
getPerspectiveRegistryReturn the perspective registry.- Returns:
- IPerspectiveRegistry. The registry for the receiver.
 
- 
getWorkingSetManagerReturns the working set manager- Returns:
- the working set manager
- Since:
- 2.0
 
- 
getWorkingSetRegistrypublic org.eclipse.ui.internal.registry.WorkingSetRegistry getWorkingSetRegistry()Returns the working set registry- Returns:
- the working set registry
- Since:
- 2.0
 
- 
getIntroRegistrypublic org.eclipse.ui.internal.intro.IIntroRegistry getIntroRegistry()Returns the introduction registry.- Returns:
- the introduction registry.
- Since:
- 3.0
 
- 
getOperationSupportReturns the operation support.- Returns:
- the workbench operation support.
- Since:
- 3.1
 
- 
getPreferenceManagerGet the preference manager.- Returns:
- PreferenceManager the preference manager for the receiver.
 
- 
getThemeRegistrypublic org.eclipse.ui.internal.themes.IThemeRegistry getThemeRegistry()Returns the theme registry for the workbench.- Returns:
- the theme registry
 
- 
getViewRegistryAnswer the view registry.- Returns:
- IViewRegistry the view registry for the receiver.
 
- 
initializeDefaultPreferencesSet default preference values. This method must be called whenever the preference store is initially loaded because the default values are not stored in the preference store.- Overrides:
- initializeDefaultPreferencesin class- AbstractUIPlugin
- Parameters:
- store- the preference store to fill
 
- 
logLogs the given message to the platform log. If you have an exception in hand, call log(String, Throwable) instead. If you have a status object in hand call log(String, IStatus) instead. This convenience method is for internal use by the Workbench only and must not be called outside the Workbench.- Parameters:
- message- A high level UI message describing when the problem happened.
 
- 
logLog the throwable.
- 
getStatusReturn the status from throwable- Parameters:
- t- throwable
- Returns:
- IStatus
 
- 
newErrorCreate a new error from the message and the throwable.- Returns:
- IStatus
 
- 
logLogs the given message and throwable to the platform log. If you have a status object in hand call log(String, IStatus) instead. This convenience method is for internal use by the Workbench only and must not be called outside the Workbench.- Parameters:
- message- A high level UI message describing when the problem happened.
- t- The throwable from where the problem actually occurred.
 
- 
logLogs the given throwable to the platform log, indicating the class and method from where it is being logged (this is not necessarily where it occurred). This convenience method is for internal use by the Workbench only and must not be called outside the Workbench.- Parameters:
- clazz- The calling class.
- methodName- The calling method name.
- t- The throwable from where the problem actually occurred.
 
- 
logLogs the given message and status to the platform log. This convenience method is for internal use by the Workbench only and must not be called outside the Workbench.- Parameters:
- message- A high level UI message describing when the problem happened. May be- null.
- status- The status describing the problem. Must not be null.
 
- 
logLog the status to the default log.
- 
getDecoratorManagerpublic org.eclipse.ui.internal.decorators.DecoratorManager getDecoratorManager()Get the decorator manager for the receiver- Returns:
- DecoratorManager the decorator manager for the receiver.
 
- 
startDescription copied from class:AbstractUIPluginTheAbstractUIPluginimplementation of thisPluginmethod 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 Clients must never explicitly call this method.Plugin.stop(BundleContext)may be called from separate threads, but the OSGi framework ensures that both methods will not be called simultaneously.- Specified by:
- startin interface- BundleActivator
- Overrides:
- startin class- AbstractUIPlugin
- Parameters:
- context- the bundle context for this plug-in
- Throws:
- Exception- if this plug-in did not start up properly
 
- 
getBundlesReturn an array of all bundles contained in this workbench.- Returns:
- an array of bundles in the workbench or an empty array if none
- Since:
- 3.0
 
- 
getBundleContextReturns the bundle context associated with the workbench plug-in.- Returns:
- the bundle context
- Since:
- 3.1
 
- 
getAppNameReturns the application name.Note this is never shown to the user. It is used to initialize the SWT Display. On Motif, for example, this can be used to set the name used for resource lookup. - Returns:
- the application name, or null
- Since:
- 3.0
- See Also:
 
- 
getProductNameReturns the name of the product.- Returns:
- the product name, or nullif none
- Since:
- 3.0
 
- 
getWindowImagesReturns the image descriptors for the window image to use for this product.- Returns:
- an array of the image descriptors for the window image, or
         nullif none
- Since:
- 3.0
 
- 
stopDescription copied from class:AbstractUIPluginTheAbstractUIPluginimplementation of thisPluginmethod saves this plug-in's preference and dialog stores and shuts down its image registry (if they are in use). Subclasses may extend this method, but must send super last. A try-finally statement should be used where necessary to ensure thatsuper.stop()is always done. Stops this plug-in.This method should be re-implemented in subclasses that need to do something when the plug-in is shut down. Implementors should call the inherited method as late as possible to ensure that any system requirements can be met. Plug-in shutdown code should be robust. In particular, this method should always make an effort to shut down the plug-in. Furthermore, the code should not assume that the plug-in was started successfully. Note 1: If a plug-in has been automatically started, this method will be automatically invoked by the platform when the platform is shut down. Note 2: This method is intended to perform simple termination of the plug-in environment. The platform may terminate invocations that do not complete in a timely fashion. Note 3: 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 4: This method and the Clients must never explicitly call this method.Plugin.start(BundleContext)may be called from separate threads, but the OSGi framework ensures that both methods will not be called simultaneously.- Specified by:
- stopin interface- BundleActivator
- Overrides:
- stopin class- AbstractUIPlugin
- Parameters:
- context- the bundle context for this plug-in
- Throws:
- Exception- if this method fails to shut down this plug-in
 
- 
getNewWizardRegistryReturn the new wizard registry.- Returns:
- the new wizard registry
- Since:
- 3.1
 
- 
getImportWizardRegistryReturn the import wizard registry.- Returns:
- the import wizard registry
- Since:
- 3.1
 
- 
getExportWizardRegistryReturn the export wizard registry.- Returns:
- the export wizard registry
- Since:
- 3.1
 
- 
getDataLocationFOR INTERNAL WORKBENCH USE ONLY. Returns the path to a location in the file system that can be used to persist/restore state between workbench invocations. If the location did not exist prior to this call it will be created. Returnsnullif no such location is available.- Returns:
- path to a location in the file system where this plug-in can persist
         data between sessions, or nullif no such location is available.
- Since:
- 3.1
 
- 
isStarting
- 
isSplashHandleSpecifiedpublic static boolean isSplashHandleSpecified()Return whether or not the OSGi framework has specified the handle of a splash shell.- Returns:
- whether or not the OSGi framework has specified the handle of a splash shell
- Since:
- 3.4
 
- 
getSplashShellpublic static Shell getSplashShell(Display display) throws NumberFormatException, IllegalArgumentException Get the splash shell for this workbench instance, if any. This will find the splash created by the launcher (native) code and wrap it in a SWT shell. This may have the side effect of setting data on the providedDisplay.- Parameters:
- display- the display to parent the shell on
- Returns:
- the splash shell or null
- Throws:
- NumberFormatException
- IllegalArgumentException
- Since:
- 3.4
- See Also:
 
- 
unsetSplashShellRemoves any splash shell data set on the provided display and disposes the shell if necessary.- Parameters:
- display- the display to parent the shell on
- Since:
- 3.4
 
- 
initializeContextInitialized the workbench plug-in with the e4 context- Parameters:
- context- the e4 context
 
- 
getDebugOptions
- 
getTestableObjectReturns aTestableObjectprovided by a TestableObject service ornullif a service implementation cannot be found. The TestableObject is used to hook tests into the application lifecycle.It is recommended the testable object is obtained via service over Workbench.getWorkbenchTestable()to avoid the tests having a dependency on the Workbench.- Returns:
- TestableObject provided via service or null
- See Also:
 
 
-