當前位置: 首頁>>代碼示例>>Java>>正文


Java IExecutableExtension類代碼示例

本文整理匯總了Java中org.eclipse.core.runtime.IExecutableExtension的典型用法代碼示例。如果您正苦於以下問題:Java IExecutableExtension類的具體用法?Java IExecutableExtension怎麽用?Java IExecutableExtension使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IExecutableExtension類屬於org.eclipse.core.runtime包,在下文中一共展示了IExecutableExtension類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createExecutableExtension

import org.eclipse.core.runtime.IExecutableExtension; //導入依賴的package包/類
public Object createExecutableExtension( String propertyName )
		throws CoreException
{
	String value = attributes.get( propertyName );
	if ( value != null )
	{
		try
		{
			Class<?> clazz = Class.forName( value );
			Object inst = clazz.newInstance( );

			if( inst instanceof IExecutableExtension )
			{
			    ((IExecutableExtension)inst).setInitializationData( 
			            this, propertyName, null ); // TODO support adapter data
			}
			return inst;
		}
		catch ( Exception e )
		{
			throw new CoreException( new Status( IStatus.ERROR,
					"org.eclipse.birt.core", 0, e.getMessage( ), e ) ); //$NON-NLS-1$
		}
	}
	return null;
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:27,代碼來源:ConfigurationElement.java

示例2: create

import org.eclipse.core.runtime.IExecutableExtension; //導入依賴的package包/類
public Object create() throws CoreException {
	try {
		final Class<?> clazz = getBundle().loadClass(clazzName);
		final Injector injector = getInjector();
		final Object result = injector.getInstance(clazz);
		if (result instanceof IExecutableExtension)
               ((IExecutableExtension)result).setInitializationData(config, null, null);
           return result;
       } catch (Throwable e) {
           try {
               Thread.currentThread().getContextClassLoader().loadClass(clazzName);
           } catch (ClassNotFoundException e1) {
               e1.printStackTrace();
           }
           throw new CoreException(new Status(IStatus.ERROR, getBundle().getSymbolicName(), e.getMessage(), e));
       }
}
 
開發者ID:markus1978,項目名稱:clickwatch,代碼行數:18,代碼來源:GuiceAwareExecutableExtensionFactory.java

示例3: create

import org.eclipse.core.runtime.IExecutableExtension; //導入依賴的package包/類
@Override
public final Object create() throws CoreException {
	try {
		final Class<?> clazz = getClassLoader().loadClass(clazzName);
		final Injector injector = getInjector();
		final Object result = injector.getInstance(clazz);
		if (result instanceof IExecutableExtension) {
			((IExecutableExtension) result).setInitializationData(config, null, null);
		}
		return result;
	} catch (final Exception e) {
		throw new CoreException(new Status(ERROR, getBunleId(),
				nullToEmpty(e.getMessage()) + " ExtensionFactory: " + getClass().getName(), e));
	}
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:16,代碼來源:N4ExecutableExtensionFactory.java

示例4: create

import org.eclipse.core.runtime.IExecutableExtension; //導入依賴的package包/類
public Object create() throws CoreException {
	try {
		final Class<?> clazz = getBundle().loadClass(clazzName);
		final Injector injector = getInjector();
		final Object result = injector.getInstance(clazz);
		if (result instanceof IExecutableExtension)
			((IExecutableExtension) result).setInitializationData(config, null, null);
		return result;
	}
	catch (Exception e) {
		log.error(e);
		throw new CoreException(new Status(IStatus.ERROR, getBundle().getSymbolicName(), e.getMessage() + " ExtensionFactory: "+ getClass().getName(), e));
	}
}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:15,代碼來源:AbstractGuiceAwareExecutableExtensionFactory.java

示例5: create

import org.eclipse.core.runtime.IExecutableExtension; //導入依賴的package包/類
public Object create() throws CoreException {
	try {
		final Class<?> clazz = getBundle().loadClass(clazzName);
		final Injector injector = getInjector();
		final Object result = injector.getInstance(clazz);
		if (result instanceof IExecutableExtension)
			((IExecutableExtension) result).setInitializationData(config, null, null);
		return result;
	}
	catch (Exception e) {
		Activator.logErrorMessage(e.getMessage(), e);
		throw new CoreException(new Status(IStatus.ERROR, getBundle().getSymbolicName(), e.getMessage() + " ExtensionFactory: "+ getClass().getName(), e));
	}
}
 
開發者ID:diverse-project,項目名稱:k3,代碼行數:15,代碼來源:K3XtendExecutableExtensionFactory.java


注:本文中的org.eclipse.core.runtime.IExecutableExtension類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。