Search in sources :

Example 1 with CommonActionProvider

use of org.eclipse.ui.navigator.CommonActionProvider in project polymap4-core by Polymap4.

the class CommonActionProviderDescriptor method createActionProvider.

/**
 * @return The instantiated CommonActionProvider for this descriptor as
 *         declared in the ATT_CLASS attribute or
 *         {@link SkeletonActionProvider} if a problem occurs while loading
 *         the instance.
 */
public CommonActionProvider createActionProvider() {
    if (hasLoadingFailed) {
        return SkeletonActionProvider.INSTANCE;
    }
    final CommonActionProvider[] provider = new CommonActionProvider[1];
    SafeRunner.run(new NavigatorSafeRunnable(configurationElement) {

        public void run() throws Exception {
            provider[0] = (CommonActionProvider) configurationElement.createExecutableExtension(ATT_CLASS);
        }
    });
    if (provider[0] != null)
        return provider[0];
    hasLoadingFailed = true;
    return SkeletonActionProvider.INSTANCE;
}
Also used : NavigatorSafeRunnable(org.eclipse.ui.internal.navigator.NavigatorSafeRunnable) CommonActionProvider(org.eclipse.ui.navigator.CommonActionProvider) CoreException(org.eclipse.core.runtime.CoreException)

Aggregations

CoreException (org.eclipse.core.runtime.CoreException)1 NavigatorSafeRunnable (org.eclipse.ui.internal.navigator.NavigatorSafeRunnable)1 CommonActionProvider (org.eclipse.ui.navigator.CommonActionProvider)1