本文整理汇总了Java中org.eclipse.e4.core.contexts.IEclipseContext.set方法的典型用法代码示例。如果您正苦于以下问题:Java IEclipseContext.set方法的具体用法?Java IEclipseContext.set怎么用?Java IEclipseContext.set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.e4.core.contexts.IEclipseContext
的用法示例。
在下文中一共展示了IEclipseContext.set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runContainerResolverJob
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
public static void runContainerResolverJob(IJavaProject javaProject) {
IEclipseContext context = EclipseContextFactory.getServiceContext(
FrameworkUtil.getBundle(BuildPath.class).getBundleContext());
final IEclipseContext childContext =
context.createChild(LibraryClasspathContainerResolverJob.class.getName());
childContext.set(IJavaProject.class, javaProject);
Job job =
ContextInjectionFactory.make(LibraryClasspathContainerResolverJob.class, childContext);
job.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(IJobChangeEvent event) {
childContext.dispose();
}
});
job.schedule();
}
示例2: compute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
System.out.println("Intitialize services");
// 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;
}
BTSLemmaEntryService listEntryService = ContextInjectionFactory.make(BTSLemmaEntryServiceImpl.class, ctx);
ctx.set(BTSLemmaEntryService.class, listEntryService);
return listEntryService;
}
示例3: 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();
}
BTSAnnotationDao dao;
try
{
dao = loadDao(context, daoFactoryName, BTSAnnotationDao.class);
} catch (CoreException e)
{
e.printStackTrace();
throw new BTSDBException("No DaoFactory found for BTSAnnotationDao and factory name: " + daoFactoryName, e);
}
context.set(BTSAnnotationDao.class, dao);
return dao;
}
示例4: 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;
}
示例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();
}
DBLeaseDao dao;
try
{
dao = loadDao(context, daoFactoryName,DBLeaseDao.class);
} catch (CoreException e)
{
e.printStackTrace();
throw new BTSDBException("No DaoFactory found for DBLeaseDao and factory name: " + daoFactoryName, e);
}
context.set(DBLeaseDao.class, dao);
return dao;
}
示例6: compute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的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;
}
示例7: compute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context) {
System.out.println("Intitialize EditingDomainController");
// Add the new object to the application context
EditingDomainController controller = ContextInjectionFactory.make(
EditingDomainControllerImpl.class, context);
MApplication application = context.get(MApplication.class);
if (application == null) {
context.set(EditingDomainController.class, controller);
} else {
IEclipseContext ctx = application.getContext();
ctx.set(EditingDomainController.class, controller);
}
return controller;
}
示例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();
}
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;
}
示例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();
}
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;
}
示例10: init
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@PostConstruct
public void init(ILoggerProvider loggerProvider, MApplication application, IEclipseContext context) {
loggerProvider.getClassLogger(this.getClass()).debug("Entering [email protected]");
IEclipseContext appContext = application.getContext();
appContext.set(Preferences.class, ContextInjectionFactory.make(Preferences.class, appContext));
appContext.set(PreferenceStore.class, ContextInjectionFactory.make(PreferenceStore.class, appContext));
ContextInjectionFactory.make(Services.class, context);
ProgressManager progressManager = ContextInjectionFactory.make(ProgressManager.class, context);
appContext.set(ProgressManager.class, progressManager);
// bug-fix: add a ProgressViewUpdater to the application context
appContext.set(ProgressViewUpdater.class, ContextInjectionFactory.make(ProgressViewUpdater.class, appContext));
loggerProvider.getClassLogger(this.getClass()).debug("Exiting [email protected]");
}
示例11: addServicesToContext
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
private void addServicesToContext(IEclipseContext cont) {
cont.set(LinguisticResourcesService.class, ContextInjectionFactory.make(LinguisticResourcesServiceImpl.class, cont));
cont.set(ResourceService.class, ContextInjectionFactory.make(ResourceServiceImpl.class, cont));
cont.set(NLPService.class, ContextInjectionFactory.make(NLPServiceImpl.class, cont));
cont.set(ETerminologyService.class, ContextInjectionFactory.make(TerminologyServiceImpl.class, cont));
cont.set(CorpusService.class, ContextInjectionFactory.make(CorpusServiceImpl.class, cont));
cont.set(TaggerService.class, ContextInjectionFactory.make(TaggerServiceImpl.class, cont));
cont.set(TermSuiteSelectionService.class, ContextInjectionFactory.make(TermSuiteSelectionServiceImpl.class, cont));
cont.set(AlignmentService.class, ContextInjectionFactory.make(AlignmentServiceImpl.class, cont));
}
示例12: compute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
System.out.println("Intitialize BTSUserService");
// Add the new object to the application context
BTSUserService userService = ContextInjectionFactory.make(BTSUserServiceImpl.class, context);
MApplication application = context.get(MApplication.class);
// IEclipseContext ctx = application.getContext();
context.set(BTSUserService.class, userService);
return userService;
}
示例13: compute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
System.out.println("Intitialize ApplicationUpdateController");
// Add the new object to the application context
ApplicationUpdateController controller = ContextInjectionFactory.make(ApplicationUpdateControllerImpl.class,
context);
context.set(ApplicationUpdateController.class, controller);
return controller;
}
示例14: createPartControl
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@PostConstruct
public void createPartControl(Composite parent) {
if (parentShell == null)
{
parentShell = new Shell();
}
try {
part = partService.findPart(PART_ID);
} catch (Exception e) {
// logger.warn("Part Service couldn't find org.fuberlin.bts.ui.corpus.egy.annotations.TextAnnotationsPart ");
e.printStackTrace();
}
parent.setLayout(new GridLayout());
((GridLayout) parent.getLayout()).marginHeight = 0;
((GridLayout) parent.getLayout()).marginWidth = 0;
// contextService
// .activateContext("org.eclipse.ui.contexts.dialogAndWindow");
IEclipseContext child = context.createChild();
child.set(Composite.class, parent);
child.set(IBTSEditor.class, TextAnnotationsPart.this);
textAnnotatationEditor = ContextInjectionFactory.make(
TextAnnotationsComposite.class, child);
// load annotatin styling settings node
Preferences rootNode = ConfigurationScope.INSTANCE.getNode("org.bbaw.bts.ui.corpus");
annotationSettings = (EclipsePreferences) rootNode.node(BTSCorpusConstants.PREF_ANNOTATION_SETTINGS);
AnnotationToolbarItemCreator.processAndUpateToolbarItemsAnnotationShortcut(part, annotationSettings);
Map<String, Boolean> filters = (Map<String, Boolean>) context.get("org.bbaw.bts.corpus.annotationsPart.filter");
textAnnotatationEditor.setFilters(filters );
if (text != null)
{
loadInput(text);
}
parent.layout();
parent.pack();
constructed = true;
}
示例15: createSearchViewer
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public SearchViewer createSearchViewer(Composite parent, int style, BTSConfigItem relationConfig, IEclipseContext context) {
if (context == null)
{
context = StaticAccessController.getContext();
}
IEclipseContext child = context.createChild();
child.set(Composite.class, parent);
child.set(BTSConfigItem.class, relationConfig);
child.set(BTSUIConstants.SELECTION_TYPE,
BTSUIConstants.SELECTION_TYPE_SECONDARY);
searchViewer = ContextInjectionFactory.make(
ThsNavigator.class, child);
return searchViewer;
}