本文整理汇总了Java中org.eclipse.e4.ui.model.application.MApplication.getContext方法的典型用法代码示例。如果您正苦于以下问题:Java MApplication.getContext方法的具体用法?Java MApplication.getContext怎么用?Java MApplication.getContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.e4.ui.model.application.MApplication
的用法示例。
在下文中一共展示了MApplication.getContext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compute
import org.eclipse.e4.ui.model.application.MApplication; //导入方法依赖的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;
}
示例2: compute
import org.eclipse.e4.ui.model.application.MApplication; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
MApplication application = context.get(MApplication.class);
if (application != null && application.getContext() != null)
{
context = application.getContext();
}
RemoteBTSUserGroupDao dao;
try
{
dao = loadDaoFactory(context).createDao(RemoteBTSUserGroupDao.class, context);
} catch (CoreException e)
{
e.printStackTrace();
throw new BTSDBException("No DaoFactory found for BTSUserGroupDao and factory name: " + daoFactoryName, e);
}
context.set(RemoteBTSUserGroupDao.class, dao);
return dao;
}
示例3: compute
import org.eclipse.e4.ui.model.application.MApplication; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
MApplication application = context.get(MApplication.class);
if (application != null && application.getContext() != null)
{
context = application.getContext();
}
RemoteDBManager manager;
try
{
manager = loadDaoFactory(context).createDao(RemoteDBManager.class, context);
} catch (CoreException e)
{
e.printStackTrace();
throw new BTSDBException("No DaoFactory found for manager and factory name: " + daoFactoryName, e);
}
context.set(RemoteDBManager.class, manager);
return manager;
}
示例4: compute
import org.eclipse.e4.ui.model.application.MApplication; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
System.out.println("Intitialize UserManagerController");
// Add the new object to the application context
UserManagerController controller = ContextInjectionFactory.make(UserManagerControllerImpl.class, context);
MApplication application = context.get(MApplication.class);
if (application == null)
{
context.set(UserManagerController.class, controller);
} else
{
IEclipseContext ctx = application.getContext();
ctx.set(UserManagerController.class, controller);
}
return controller;
}
示例5: compute
import org.eclipse.e4.ui.model.application.MApplication; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
MApplication application = context.get(MApplication.class);
if (application != null && application.getContext() != null)
{
context = application.getContext();
}
BTSCommentDao dao;
try
{
dao = loadDao(context, daoFactoryName, BTSCommentDao.class);
} catch (CoreException e)
{
e.printStackTrace();
throw new BTSDBException("No DaoFactory found for BTSCommentDao and factory name: " + daoFactoryName, e);
}
context.set(BTSCommentDao.class, dao);
return dao;
}
示例6: compute
import org.eclipse.e4.ui.model.application.MApplication; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context) {
System.out.println("Intitialize BTSUserController");
// Add the new object to the application context
MApplication application = context.get(MApplication.class);
IEclipseContext ctx = context;
if (application != null && application.getContext() != null) {
ctx = application.getContext();
}
BTSUserController controller = ContextInjectionFactory.make(
BTSUserControllerImpl.class, context);
ctx.set(BTSUserController.class, controller);
return controller;
}
示例7: compute
import org.eclipse.e4.ui.model.application.MApplication; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
System.out.println("Intitialize DBAdminController");
// Add the new object to the application context
DBAdminController controller = ContextInjectionFactory.make(DBAdminControllerImpl.class, context);
MApplication application = context.get(MApplication.class);
if (application == null)
{
context.set(DBAdminController.class, controller);
} else
{
IEclipseContext ctx = application.getContext();
ctx.set(DBAdminController.class, controller);
}
return controller;
}
示例8: compute
import org.eclipse.e4.ui.model.application.MApplication; //导入方法依赖的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;
}
示例9: compute
import org.eclipse.e4.ui.model.application.MApplication; //导入方法依赖的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;
}
示例10: compute
import org.eclipse.e4.ui.model.application.MApplication; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
MApplication application = context.get(MApplication.class);
if (application != null && application.getContext() != null)
{
context = application.getContext();
}
BTSUserGroupDao dao;
try
{
dao = loadDao(context, daoFactoryName,BTSUserGroupDao.class);
} catch (CoreException e)
{
e.printStackTrace();
throw new BTSDBException("No DaoFactory found for BTSUserGroupDao and factory name: " + daoFactoryName, e);
}
context.set(BTSUserGroupDao.class, dao);
return dao;
}
示例11: compute
import org.eclipse.e4.ui.model.application.MApplication; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
MApplication application = context.get(MApplication.class);
if (application != null && application.getContext() != null)
{
context = application.getContext();
}
Backend2ClientUpdateDao dao;
try
{
dao = loadDao(context, daoFactoryName, Backend2ClientUpdateDao.class);
} catch (CoreException e)
{
e.printStackTrace();
throw new BTSDBException("No DaoFactory found for Backend2ClientUpdateDao and factory name: "
+ daoFactoryName, e);
}
context.set(Backend2ClientUpdateDao.class, dao);
return dao;
}
示例12: compute
import org.eclipse.e4.ui.model.application.MApplication; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context) {
System.out
.println("Intitialize PermissionsAndExpressionsEvaluationController");
// Add the new object to the application context
PermissionsAndExpressionsEvaluationController controller = ContextInjectionFactory
.make(PermissionsAndExpressionsEvaluationControllerImpl.class,
context);
MApplication application = context.get(MApplication.class);
if (application == null) {
context.set(PermissionsAndExpressionsEvaluationController.class,
controller);
} else {
IEclipseContext ctx = application.getContext();
ctx.set(PermissionsAndExpressionsEvaluationController.class,
controller);
}
return controller;
}
开发者ID:cplutte,项目名称:bts,代码行数:23,代码来源:PermissionsAndExpressionsEvaluationControllerContextFunction.java
示例13: compute
import org.eclipse.e4.ui.model.application.MApplication; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
MApplication application = context.get(MApplication.class);
if (application != null && application.getContext() != null)
{
context = application.getContext();
}
BTSTextCorpusDao dao;
try
{
dao = loadDao(context, daoFactoryName, BTSTextCorpusDao.class);
} catch (CoreException e)
{
e.printStackTrace();
throw new BTSDBException("No DaoFactory found for BTSTextCorpusDao and factory name: " + daoFactoryName, e);
}
context.set(BTSTextCorpusDao.class, dao);
return dao;
}
示例14: compute
import org.eclipse.e4.ui.model.application.MApplication; //导入方法依赖的package包/类
@Override
public Object compute(final IEclipseContext context, final String contextKey) {
// delegate to ContextInjectionFactory
// instead of creating a new MyTodoServiceImpl with the new operator.
// because MyTodoServiceImpl itself uses injection
IRepositoryService todoService = ContextInjectionFactory.make(RepositoryService.class, context);
// cache the newly created todoService in the application context for
// the next time somebody requests it (this prevents this
// ContextFunction
// from being called again).
// get application ctx (to make it available to all parts)
// and register todoService obj with appCtx
MApplication app = context.get(MApplication.class);
IEclipseContext appCtx = app.getContext();
appCtx.set(IRepositoryService.class, todoService);
// return model for current invocation
// next invocation uses object from application context
return todoService;
}
示例15: compute
import org.eclipse.e4.ui.model.application.MApplication; //导入方法依赖的package包/类
@Override
public Object compute(final IEclipseContext context, final String contextKey) {
// delegate to ContextInjectionFactory
// instead of creating a new MyTodoServiceImpl with the new operator.
// because MyTodoServiceImpl itself uses injection
IBettingScheduleService todoService = ContextInjectionFactory.make(BettingScheduleService.class, context);
// cache the newly created todoService in the application context for
// the next time somebody requests it (this prevents this
// ContextFunction
// from being called again).
// get application ctx (to make it available to all parts)
// and register todoService obj with appCtx
MApplication app = context.get(MApplication.class);
IEclipseContext appCtx = app.getContext();
appCtx.set(IBettingScheduleService.class, todoService);
// return model for current invocation
// next invocation uses object from application context
return todoService;
}