当前位置: 首页>>代码示例>>Java>>正文


Java ContextInjectionFactory.make方法代码示例

本文整理汇总了Java中org.eclipse.e4.core.contexts.ContextInjectionFactory.make方法的典型用法代码示例。如果您正苦于以下问题:Java ContextInjectionFactory.make方法的具体用法?Java ContextInjectionFactory.make怎么用?Java ContextInjectionFactory.make使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.e4.core.contexts.ContextInjectionFactory的用法示例。


在下文中一共展示了ContextInjectionFactory.make方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: runContainerResolverJob

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的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();
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:BuildPath.java

示例2: compute

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
	System.out.println("Intitialize  CommentController");
	// Add the new object to the application context
	CommentController controller = ContextInjectionFactory.make(CommentControllerImpl.class, context);

	MApplication application = context.get(MApplication.class);

	if (application == null)
	{
		context.set(CommentController.class, controller);
	} else
	{
		IEclipseContext ctx = application.getContext();
		ctx.set(CommentController.class, controller);
	}

	return controller;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:21,代码来源:CommentControllerContextFunction.java

示例3: openInPassportEditorDialog

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
private void openInPassportEditorDialog(
		ISelection sel) {
	StructuredSelection localSelection = (StructuredSelection) sel;
	if (localSelection.getFirstElement() != null
			&& localSelection.getFirstElement() instanceof TreeNodeWrapper) {
		TreeNodeWrapper localTreeNode = (TreeNodeWrapper) localSelection
				.getFirstElement();
		if (localTreeNode.getObject() != null) {
			BTSObject localCorpusObject = (BTSObject) localTreeNode.getObject();
			if (localCorpusObject instanceof BTSCorpusObject) {
				lemmaNavigatorController.checkAndFullyLoad((BTSCorpusObject) localCorpusObject, true);
				IEclipseContext child = context.createChild();
				child.set(BTSObject.class, localCorpusObject);
				child.set(Shell.class, new Shell());
				child.set(BTSCoreConstants.CORE_EXPRESSION_MAY_EDIT, false);

				PassportEditorDialog dialog = ContextInjectionFactory.make(
						PassportEditorDialog.class, child);
				dialog.open();
			}
		}
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:24,代码来源:LemmaNavigator.java

示例4: compute

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
	System.out.println("Intitialize BTSTextCorpusService");
	// Add the new object to the application context
	MApplication application = context.get(MApplication.class);
	IEclipseContext ctx = context;
	if (application != null)
	{
		ctx= application.getContext();
	}
	BTSTextCorpusService service =  ContextInjectionFactory.make(BTSTextCorpusServiceImpl.class, context);

	ctx.set(BTSTextCorpusService.class, service);

	return service;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:18,代码来源:BTSTextCorpusServiceContextFunction.java

示例5: compute

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的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;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:22,代码来源:BTSThsEntryServiceContextFunction.java

示例6: compute

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
	System.out.println("Intitialize BTSAnnotationService");
	// 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;
	}

	BTSAnnotationService annotationService =  ContextInjectionFactory.make(BTSAnnotationServiceImpl.class, ctx);
	ctx.set(BTSAnnotationService.class, annotationService);

	return annotationService;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:22,代码来源:BTSAnnotationServiceContextFunction.java

示例7: execute

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Execute
public void execute(@Named(IServiceConstants.ACTIVE_SELECTION) @Optional Object object,
		@Named(IServiceConstants.ACTIVE_SHELL) final Shell shell,
		IEclipseContext context) {
	BTSCorpusObject corpusObject = null;
	if (object instanceof BTSCorpusObject)
	{
		corpusObject = (BTSCorpusObject) object;
	}
	else if (object instanceof BTSTextSelectionEvent && ((BTSTextSelectionEvent) object).data instanceof BTSCorpusObject)
	{
		corpusObject = (BTSCorpusObject) ((BTSTextSelectionEvent) object).data;
	}
	if (corpusObject == null) return;
	IEclipseContext child = context.createChild();
	child.set(BTSCorpusObject.class, corpusObject);
	child.set(Shell.class, shell);
	
	CheckPassportDialog dialog = ContextInjectionFactory.make(
			CheckPassportDialog.class, child);

	if (dialog.open() == CheckPassportDialog.OK) {
		
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:26,代码来源:CheckPassportCompletenessHandler.java

示例8: init

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的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]");
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:14,代码来源:ProgressViewAddon.java

示例9: createViewer

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
private void createViewer(Composite container) {
	
	layout = new TreeColumnLayout(true);
	container.setLayout(layout);
	this.viewer = new TerminologyViewer(viewerConfig, container, SWT.SINGLE| SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
	GridDataFactory.fillDefaults().span(4, 1).grab(true, true).applyTo(viewer.getControl());
       
	for(String pName:viewerConfig.getSelectedPropertyNames()) 
		createColumn(PropertyUtil.forName(pName));
	viewerConfig.eAdapters().add(new AdapterImpl(){
		@Override
		public void notifyChanged(Notification msg) {
			if(msg.getFeatureID(ETerminoViewerConfig.class) == TermsuiteuiPackage.ETERMINO_VIEWER_CONFIG__SEARCH_STRING
				&& msg.getNewValue() != null && !msg.getNewValue().toString().isEmpty())
				/*
				 * This is a non empty search string filter. Expand all nodes
				 * in order to make selected variant appear.
				 */
				viewer.expandToLevel(2);

		}
	});
	
	// attach a selection listener to our jface viewer
	TermSelectionListener listener = ContextInjectionFactory.make(TermSelectionListener.class, context);
	viewer.addSelectionChangedListener(listener);
	  
	menuService.registerContextMenu(viewer.getControl(), POPUP_MENU_ID);
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:30,代码来源:TerminologyPart.java

示例10: execute

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Execute
public void execute(final OrderService orderService, final IEclipseContext context) {
	LOGGER.info(this.getClass().getSimpleName() + " called. Active Order is: " + activeOrder);
	
	PositionWithArticleInfo posWithArticleInfo = new PositionWithArticleInfo(-1);
	PositionWithOrderAndArticleInfoDTO newPosition = new PositionWithOrderAndArticleInfoDTO(posWithArticleInfo,
			activeOrder);
	
	PositionMPartFactory positionMPartFactory = ContextInjectionFactory.make(PositionMPartFactory.class, context);
	positionMPartFactory.showMPartForPosition(newPosition);
}
 
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:12,代码来源:PositionAddHandler.java

示例11: compute

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
	System.out.println("Intitialize ApplicationStartupController");
	// Add the new object to the application context
	// MApplication application = context.get(MApplication.class);
	// IEclipseContext ctx = application.getContext();

	ApplicationStartupController controller = ContextInjectionFactory.make(ApplicationStartupControllerImpl.class,
			context);
	context.set(ApplicationStartupController.class, controller);

	return controller;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:15,代码来源:ApplicationStartupControllerContextFunction.java

示例12: compute

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context) {
	System.out.println("Intitialize LemmaNavigatorController");

	// Add the new object to the application context
	MApplication application = context.get(MApplication.class);
	IEclipseContext ctx = application.getContext();

	LemmaNavigatorController controller = ContextInjectionFactory.make(
			LemmaNavigatorControllerImpl.class, context);
	ctx.set(LemmaNavigatorController.class, controller);

	return controller;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:15,代码来源:LemmaNavigatorControllerContextFunction.java

示例13: compute

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
	System.out.println("Intitialize BTSConfigurationDialogController");
	// Add the new object to the application context
	MApplication application = context.get(MApplication.class);
	IEclipseContext ctx = application.getContext();

	BTSConfigurationDialogController controller = ContextInjectionFactory.make(
			BTSConfigurationDialogControllerImpl.class, context);
	ctx.set(BTSConfigurationDialogController.class, controller);

	return controller;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:15,代码来源:BTSConfigurationDialogControllerContextFunction.java

示例14: createViewer

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Override
public CompareViewer createViewer(Composite parent, int style) {
	
	if (context == null)
	{
		context = StaticAccessController.getContext();
	}
	IEclipseContext child = context.createChild();
	child.set(Composite.class, parent);
	compareViewer = ContextInjectionFactory.make(
			CompareViewerPassportImpl.class, child);
	return compareViewer;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:14,代码来源:CompareViewerFactoryPassportImpl.java

示例15: compute

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context) {
	System.out.println("Intitialize ThsNavigatorController");

	// Add the new object to the application context
	MApplication application = context.get(MApplication.class);
	IEclipseContext ctx = application.getContext();

	ThsNavigatorController controller = ContextInjectionFactory.make(
			ThsNavigatorControllerImpl.class, context);
	ctx.set(ThsNavigatorController.class, controller);

	return controller;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:15,代码来源:ThsNavigatorControllerContextFunction.java


注:本文中的org.eclipse.e4.core.contexts.ContextInjectionFactory.make方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。