本文整理匯總了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;
}
示例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));
}
}
示例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));
}
}
示例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));
}
}
示例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));
}
}