本文整理汇总了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));
}
}