• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java EclipseContextFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.e4.core.contexts.EclipseContextFactory的典型用法代码示例。如果您正苦于以下问题:Java EclipseContextFactory类的具体用法?Java EclipseContextFactory怎么用?Java EclipseContextFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EclipseContextFactory类属于org.eclipse.e4.core.contexts包,在下文中一共展示了EclipseContextFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: runContainerResolverJob

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的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: initProvisioningAgent

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的package包/类
protected void initProvisioningAgent() {
	try {
		// Inject references
		BundleContext bundleContext = FrameworkUtil.getBundle(CheckUpdatesManager.class).getBundleContext();
		IEclipseContext serviceContext = EclipseContextFactory.getServiceContext(bundleContext);
		ContextInjectionFactory.inject(this, serviceContext);
		// get p2 agent for current system(Eclipse instance in this
		// case)
		// the location for the currently running system is null (see
		// docs)
		p2Agent = agentProvider.createAgent(null);
		session = new ProvisioningSession(p2Agent);
		artifactRepoManager = (IArtifactRepositoryManager) p2Agent
				.getService(IArtifactRepositoryManager.class.getName());
		metadataRepoManager = (IMetadataRepositoryManager) p2Agent
				.getService(IMetadataRepositoryManager.class.getName());

	} catch (Exception e) {
		System.exit(1);
	}
}
 
开发者ID:wso2,项目名称:developer-studio,代码行数:22,代码来源:CheckUpdatesManager.java


示例3: initProvisioningAgent

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的package包/类
protected void initProvisioningAgent() throws RuntimeException {
	try {
		// Inject references
		BundleContext bundleContext = FrameworkUtil.getBundle(UpdateManager.class).getBundleContext();
		IEclipseContext serviceContext = EclipseContextFactory.getServiceContext(bundleContext);
		ContextInjectionFactory.inject(this, serviceContext);
		// get p2 agent for current system(Eclipse instance in this
		// case)
		// the location for the currently running system is null (see
		// docs)
		p2Agent = agentProvider.createAgent(null);
		session = new ProvisioningSession(p2Agent);
		artifactRepoManager = (IArtifactRepositoryManager) p2Agent
				.getService(IArtifactRepositoryManager.class.getName());
		metadataRepoManager = (IMetadataRepositoryManager) p2Agent
				.getService(IMetadataRepositoryManager.class.getName());

	} catch (Exception e) {
		throw new RuntimeException(Messages.UpdateManager_14, e);
	}
}
 
开发者ID:wso2,项目名称:developer-studio,代码行数:22,代码来源:UpdateManager.java


示例4: openResourceEditor

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的package包/类
public synchronized void openResourceEditor(final IEditorInputResource eir){

		if(eir == null){
			logger.severe("Can not open editor! Specified editor resource is NULL!");
			return;
		}
		
		Display.getDefault().asyncExec(new Runnable() {
			@Override
			public void run() {
				IExplorerService explorerService = CloudscaleContext.getGlobalContext().get(IExplorerService.class);
				explorerService.setSelection(eir);

				IEclipseContext staticContext = EclipseContextFactory.create();
				staticContext.set(IEditorInputResource.class, eir);
				CommandExecutor.getInstance().execute("eu.cloudscaleproject.env.toolchain.openAlternative", staticContext);
				staticContext.dispose();

			}
		});
	}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:22,代码来源:ResourceRegistry.java


示例5: createConfigAlternative

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的package包/类
private void createConfigAlternative()
{
	ResourceProvider resourceProvider = ResourceRegistry.getInstance().getResourceProvider(alternative.getProject(), alternative.getTool().getConfig().getID());
	IConfigurationElement e = ToolchainExtensions.getInstance().findResourceProviderFactoryElement(alternative.getTool().getConfig().getID());

	String wizardCmd = e.getAttribute("wizard");
	if (wizardCmd == null)
	{
		throw new IllegalStateException("Wizard command missing...");
	}
	
	
	IEclipseContext staticContext = EclipseContextFactory.create();
	staticContext.set(ResourceProvider.class, resourceProvider);
	staticContext.set(IEditorInputResource.class, alternative);

	CommandExecutor.getInstance().execute(wizardCmd, staticContext);
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:19,代码来源:InputEditorView.java


示例6: ExplorerNode

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的package包/类
public ExplorerNode(IEclipseContext context, String id, IExplorerNodeChildren children) {
	
	this.id = id;
	this.context = EclipseContextFactory.create(this.getClass().getSimpleName() + "("+ id + ")");
	
	if(context != null){
		this.context.setParent(context);
		CloudscaleContext.inject(this, this.context);
	}
	
	
	if(children != null){
		addNodeChildren(children);
	}
	
	//retrieve children from extension points
	for(IExplorerNodeChildrenProvider childrenProvider : ExplorerExtensions.getInstance().getNodeChildrenProviders()){
		if(childrenProvider.canCreate(this)){
			addNodeChildren(childrenProvider.create(this));
		}
	}
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:23,代码来源:ExplorerNode.java


示例7: setUp

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	image = new Image(device, 1, 1);
	languages = new LanguageService(Locale.ENGLISH.getLanguage());

	context = EclipseContextFactory.create("test context");
	context.set(Logger.class, log);
	context.set(IEventBroker.class, eventBroker);
	context.set(LanguageService.class, languages);
	context.set(IDataService.class, dataService);
	context.set(IBrowserManager.class, browserManager);

	term1 = data.createTerm("term 1");
	term2 = data.createTerm("term 2");
	person1 = data.createPerson("person1", "1");
	person2 = data.createPerson("person2", "2");
	person3 = data.createPerson("person3", "3");
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:19,代码来源:CentralAssociationsModelTest.java


示例8: startSimulator

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的package包/类
public static Object startSimulator(final ExecutionEvent event, final String engineTypeId) {
	try {
		final SimulationUIService simulationUiService = Objects.requireNonNull(EclipseContextFactory.getServiceContext(FrameworkUtil.getBundle(SimulatorHandlerHelper.class).getBundleContext()).get(SimulationUIService.class), "unable to get simulation UI service");
		if(simulationUiService.getCurrentState().getSimulationEngine() != null) {
			final MessageBox messageBox = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
	        messageBox.setMessage("A simulation is already active. Do you want to stop the current simulation?");
	        messageBox.setText("Stop Current Simulation");
	        if(messageBox.open() == SWT.NO) {
	        	return null;
	        }
		}
		
		if(event.getApplicationContext() instanceof IEvaluationContext) {
			final IEvaluationContext appContext = (IEvaluationContext)event.getApplicationContext();
			final ISelection selection = (ISelection)appContext.getVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME);
			final SimulationLaunchShortcut launchShortcut = new SimulationLaunchShortcut();
			launchShortcut.launch(selection, engineTypeId, ILaunchManager.RUN_MODE);
		}
	} catch(final Exception ex) {
		final Status status = new Status(IStatus.ERROR, FrameworkUtil.getBundle(SimulatorHandlerHelper.class).getSymbolicName(), "Error", ex);
		StatusManager.getManager().handle(status, StatusManager.SHOW | StatusManager.LOG);
	}
	
	return null;
}
 
开发者ID:smaccm,项目名称:smaccm,代码行数:26,代码来源:SimulatorHandlerHelper.java


示例9: setUp

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的package包/类
/** Set up. */
@Before
public void setUp() {
  BundleContext bundleContext = FrameworkUtil.getBundle(getClass()).getBundleContext();
  context = EclipseContextFactory.getServiceContext(bundleContext);
  assertNotNull(context);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:8,代码来源:CloudSdkContextFunctionTest.java


示例10: execute

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的package包/类
@Execute
	public void execute() {
		
		TextViewerOperationAction action = null;
		Bundle bundle = FrameworkUtil.getBundle(getClass());
		BundleContext bundleContext = bundle.getBundleContext();
		IEclipseContext context = EclipseContextFactory.getServiceContext(bundleContext);
		action = (TextViewerOperationAction) context.get(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
		
//		TextViewerOperationAction action = new TextViewerOperationAction(bundle, prefix, viewer, operationCode);
		action.run();
	}
 
开发者ID:cplutte,项目名称:bts,代码行数:13,代码来源:Handler.java


示例11: CreateBroker

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的package包/类
public static void CreateBroker(String pluginId) {

		Bundle bundle = Platform.getBundle(pluginId);
		IEclipseContext eclipseContext = EclipseContextFactory.getServiceContext(bundle.getBundleContext());
		eclipseContext.set(org.eclipse.e4.core.services.log.Logger.class, null);
		iEventBroker = eclipseContext.get(IEventBroker.class);
	}
 
开发者ID:wso2,项目名称:developer-studio,代码行数:8,代码来源:EsbEditorEvent.java


示例12: createDiReader

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的package包/类
private void createDiReader() {
	IEclipseContext staticContext = EclipseContextFactory.create();
	staticContext.set("myViewer", tableViewer);
	staticContext.set("myList", pluginAuthors);
	extensionReader = ContextInjectionFactory.make(ExtensionReader.class,
			context, staticContext);
	staticContext.dispose();
}
 
开发者ID:scela,项目名称:EclipseCon2014,代码行数:9,代码来源:SamplePart.java


示例13: CloudScaleProjectWizard

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的package包/类
public CloudScaleProjectWizard() {
	super();

	IEclipseContext context = EclipseContextFactory
			.getServiceContext(Activator.getContext());
	ContextInjectionFactory.inject(this, context);
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:8,代码来源:CloudScaleProjectWizard.java


示例14: execute

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的package包/类
public Object execute(ExecutionEvent event) throws ExecutionException {
	extractUniversalCount(event);	// initialize uArg
	// Pass the non-e4 handler so it can be injected into the command if necessary
	IEclipseContext ctx = EclipseContextFactory.create();
	addToContext(ctx);
	return ContextInjectionFactory.invoke(e4cmd, Execute.class, getContext(), ctx, null);
}
 
开发者ID:MulgaSoft,项目名称:e4macs,代码行数:8,代码来源:E4CmdHandler.java


示例15: setUp

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	bibTex = new File(FILE_NAME);

	context = EclipseContextFactory.create("test context");
	context.set(Logger.class, log);
	context.set(IDataService.class, data);
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:9,代码来源:MetadataFormatBibtexTest.java


示例16: setUp

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	dcXml = new File(FILE_NAME);

	context = EclipseContextFactory.create("test context");
	context.set(Logger.class, log);
	context.set(IDataService.class, data);
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:9,代码来源:MetadataFormatDCTest.java


示例17: setUp

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	modsXml = new File(FILE_NAME);

	context = EclipseContextFactory.create("test context");
	context.set(Logger.class, log);
	context.set(IDataService.class, data);
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:9,代码来源:MetadataFormatModsTest.java


示例18: setUp

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	localeOld = Locale.getDefault();
	Locale.setDefault(Locale.ENGLISH);

	context = EclipseContextFactory.create("test context");
	context.set(Logger.class, log);
	context.set(IDataService.class, data);
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:10,代码来源:COinSHelperTest.java


示例19: setUp

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	file1 = new File(FILE1);
	file2 = new File(FILE2);
	file3 = new File(FILE3);

	context = EclipseContextFactory.create("test context");
	context.set(Logger.class, log);
	context.set(IDataService.class, data);
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:11,代码来源:RDFaExtractorTest.java


示例20: setUp

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	image = new Image(device, 1, 1);
	languages = new LanguageService(Locale.ENGLISH.getLanguage());

	context = EclipseContextFactory.create("test context");
	context.set(Logger.class, log);
	context.set(IEventBroker.class, eventBroker);
	context.set(LanguageService.class, languages);
	context.set(IDataService.class, dataService);

	items = new IItem[10];
	items[0] = data.createTerm("Term1");
	items[1] = data.createTerm("Term2");
	items[2] = data.createTerm("Term3");
	items[3] = data.createTerm("Term4");
	items[4] = data.createTerm("Term5");
	items[5] = data.createTerm("Term6");
	items[6] = data.createPerson("Person1", "First1");
	items[7] = data.createPerson("Person1", "First1");
	items[8] = data.createPerson("Person1", "First1");
	items[9] = data.createPerson("Person1", "First1");
	data.createRelation(items[0], items[1]);
	data.createRelation(items[0], items[2]);
	data.createRelation(items[0], items[3]);
	data.createRelation(items[0], items[5]);
	data.createRelation(items[0], items[6]);
	data.createRelation(items[0], items[9]);

	center = new ItemAdapter(items[0], image, context);
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:32,代码来源:AssociationsModelTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SafetyNet类代码示例发布时间:2022-05-22
下一篇:
Java Id类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap