本文整理汇总了Java中org.eclipse.e4.core.contexts.IEclipseContext.get方法的典型用法代码示例。如果您正苦于以下问题:Java IEclipseContext.get方法的具体用法?Java IEclipseContext.get怎么用?Java IEclipseContext.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.e4.core.contexts.IEclipseContext
的用法示例。
在下文中一共展示了IEclipseContext.get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context, String contextKey) {
Object path = context.get(PreferenceConstants.CLOUDSDK_PATH);
if (path == null) {
// record this context as using the preference value
referencedContexts.add(context);
}
CloudSdk.Builder builder = new CloudSdk.Builder();
Path location = toPath(path);
if (location != null) {
builder.sdkPath(location);
}
try {
CloudSdk instance = builder.build();
instance.validateCloudSdk();
instance.validateAppEngineJavaComponents();
return instance;
} catch (CloudSdkNotFoundException | CloudSdkOutOfDateException
| AppEngineJavaComponentsNotInstalledException ex) {
return NOT_A_VALUE;
}
}
示例2: compute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
MApplication application = context.get(MApplication.class);
if (application != null && application.getContext() != null)
{
context = application.getContext();
}
RemoteDBConnectionProvider dao;
try
{
dao = loadDaoFactory(context).createDao(RemoteDBConnectionProvider.class, context);
} catch (CoreException e)
{
e.printStackTrace();
throw new BTSDBException(
"No DaoFactory found for DBConnectionProvider and factory name: " + daoFactoryName, e);
}
context.set(RemoteDBConnectionProvider.class, dao);
return dao;
}
示例3: compute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
System.out.println("Intitialize BTSImageService");
// Add the new object to the application context
MApplication application = context.get(MApplication.class);
IEclipseContext ctx = context;
if (application != null)
{
ctx= application.getContext();
}
if (ctx == null)
{
ctx = context;
}
BTSImageService imageService = ContextInjectionFactory.make(BTSImageServiceImpl.class, ctx);
ctx.set(BTSImageService.class, imageService);
return imageService;
}
示例4: compute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
System.out.println("Intitialize BTSStatusMessageService");
// Add the new object to the application context
MApplication application = context.get(MApplication.class);
IEclipseContext ctx = context;
if (application != null)
{
ctx= application.getContext();
}
if (ctx == null)
{
ctx = context;
}
BTSStatusMessageService service = ContextInjectionFactory.make(BTSStatusMessageServiceImpl.class, ctx);
ctx.set(BTSStatusMessageService.class, service);
return service;
}
示例5: compute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
MApplication application = context.get(MApplication.class);
if (application != null && application.getContext() != null)
{
context = application.getContext();
}
BTSIDReservationObjectDao dao;
try
{
dao = loadDao(context, daoFactoryName, BTSIDReservationObjectDao.class);
} catch (CoreException e)
{
e.printStackTrace();
throw new BTSDBException("No DaoFactory found for BTSIDReservationObjectDao and factory name: " + daoFactoryName, e);
}
context.set(BTSIDReservationObjectDao.class, dao);
return dao;
}
示例6: loadDaoFactory
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
private RemoteDAOFactory loadDaoFactory(IEclipseContext context) throws CoreException
{
IConfigurationElement[] config = ((IExtensionRegistry) context.get(IExtensionRegistry.class.getName()))
.getConfigurationElementsFor(RemoteDaoConstants.REMOTE_DAO_FACTORY_EXTENSION_POINT_ID);
for (IConfigurationElement e : config)
{
final Object o = e.createExecutableExtension("class");
if (o instanceof RemoteDAOFactory
&& (daoFactoryName == null || daoFactoryName.equals(((RemoteDAOFactory) o).getFactoryName())))
{
return (RemoteDAOFactory) o;
}
}
// in case no extension point found, look up context
// this is necessary to run the same plugins on a Eclipse Virgo server for the web application
RemoteDAOFactory factory = context.get(RemoteDAOFactory.class);
if (factory != null) return factory;
// if nothing found, throw exception
throw new BTSDBException("No DaoFactory found for GeneralPurposeDao and factory name: " + daoFactoryName);
}
示例7: compute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
MApplication application = context.get(MApplication.class);
if (application != null && application.getContext() != null)
{
context = application.getContext();
}
CorpusObjectDao dao;
try
{
dao = loadDao(context, daoFactoryName, CorpusObjectDao.class);
} catch (CoreException e)
{
e.printStackTrace();
throw new BTSDBException("No DaoFactory found for CorpusObjectDao and factory name: " + daoFactoryName, e);
}
context.set(CorpusObjectDao.class, dao);
return dao;
}
示例8: compute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
MApplication application = context.get(MApplication.class);
if (application != null && application.getContext() != null) {
context = application.getContext();
}
RemoteBTSProjectDao dao;
try {
dao = loadDaoFactory(context).createDao(RemoteBTSProjectDao.class,
context);
} catch (CoreException e) {
e.printStackTrace();
throw new BTSDBException(
"No RemoteDaoFactory found for BTSProjectDao and factory name: "
+ remotedaoFactoryName, e);
}
context.set(RemoteBTSProjectDao.class, dao);
return dao;
}
示例9: compute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
MApplication application = context.get(MApplication.class);
if (application != null && application.getContext() != null)
{
context = application.getContext();
}
BTSLemmaEntryDao dao;
try
{
dao = loadDao(context, daoFactoryName, BTSLemmaEntryDao.class);
} catch (CoreException e)
{
e.printStackTrace();
throw new BTSDBException("No DaoFactory found for BTSListEntryDao and factory name: " + daoFactoryName, e);
}
context.set(BTSLemmaEntryDao.class, dao);
return dao;
}
示例10: compute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
MApplication application = context.get(MApplication.class);
if (application != null && application.getContext() != null)
{
context = application.getContext();
}
BTSConfigurationDao dao;
try
{
dao = loadDao(context, daoFactoryName, BTSConfigurationDao.class);
} catch (CoreException e)
{
e.printStackTrace();
throw new BTSDBException("No DaoFactory found for BTSConfigurationDao and factory name: " + daoFactoryName,
e);
}
context.set(BTSConfigurationDao.class, dao);
return dao;
}
示例11: compute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context) {
System.out.println("Intitialize BTSThsEntryService");
// Add the new object to the application context
MApplication application = context.get(MApplication.class);
IEclipseContext ctx = context;
if (application != null)
{
ctx= application.getContext();
}
if (ctx == null)
{
ctx = context;
}
BTSThsEntryService service = ContextInjectionFactory.make(BTSThsEntryServiceImpl.class, ctx);
ctx.set(BTSThsEntryService.class, service);
return service;
}
示例12: compute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
// System.out.println("Intitialize BTSCommentService");
// Add the new object to the application context
MApplication application = context.get(MApplication.class);
IEclipseContext ctx = context;
if (application != null)
{
ctx= application.getContext();
}
if (ctx == null)
{
ctx = context;
}
BTSCommentService service = ContextInjectionFactory.make( BTSCommentServiceImpl.class, ctx);
ctx.set( BTSCommentService.class, service);
return service;
}
示例13: compute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context) {
System.out
.println("Intitialize PermissionsAndExpressionsEvaluationService");
// Add the new object to the application context
PermissionsAndExpressionsEvaluationService controller = ContextInjectionFactory
.make(PermissionsAndExpressionsEvaluationServiceImpl.class,
context);
MApplication application = context.get(MApplication.class);
if (application == null) {
context.set(PermissionsAndExpressionsEvaluationService.class,
controller);
} else {
IEclipseContext ctx = application.getContext();
ctx.set(PermissionsAndExpressionsEvaluationService.class,
controller);
}
return controller;
}
示例14: compute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
System.out.println("Intitialize InitialProjectController");
// Add the new object to the application context
MApplication application = context.get(MApplication.class);
if (application != null)
{
context = application.getContext();
}
BTSProjectController controller = ContextInjectionFactory.make(BTSProjectControllerImpl.class, context);
context.set(BTSProjectController.class, controller);
return controller;
}
示例15: CommandProvider
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
public CommandProvider(IEvaluationContext evaluationContext) {
this.evaluationContext = evaluationContext;
IEclipseContext context = ((ExpressionContext) evaluationContext).eclipseContext;
ehandlerService = context.get(EHandlerService.class);
handlerService = context.get(IHandlerService.class);
commandService = context.get(ICommandService.class);
commandById = new HashMap<>();
}