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


Java EclipseContextFactory.getServiceContext方法代码示例

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


在下文中一共展示了EclipseContextFactory.getServiceContext方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例5: 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

示例6: 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

示例7: 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

示例8: create

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入方法依赖的package包/类
@Override
public Object create() throws CoreException {
  BundleContext bundleContext = FrameworkUtil.getBundle(clazz).getBundleContext();
  IEclipseContext serviceContext = EclipseContextFactory.getServiceContext(bundleContext);
  return ContextInjectionFactory.make(clazz, serviceContext);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:7,代码来源:ServiceContextFactory.java

示例9: getEclipseContext

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入方法依赖的package包/类
public static IEclipseContext getEclipseContext() {
	final IEclipseContext serviceContext = EclipseContextFactory.getServiceContext(FrameworkUtil.getBundle(
			Activator.class).getBundleContext());
	return serviceContext.get(IWorkbench.class).getApplication().getContext();
}
 
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:6,代码来源:EclipseContextHelper.java

示例10: ContributedPreferenceNode

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入方法依赖的package包/类
/**
 * Create a new ContributedPreferenceNode.
 * 
 * @param id
 *            the node id
 * @param label
 *            the label used to display the node in the preference dialog's
 *            tree
 * @param imageDescriptor
 *            the image displayed left of the label in the preference
 *            dialog's tree, or null if none
 * @param pageClass
 *            the preference page implementation, this class must implement
 *            {@link IPreferencePage}
 * @param path
 *            the path of the node to which the contributed node should be
 *            added to
 * @param nodeQualifier
 *            the qualifier used to look up the preference node
 */
public ContributedPreferenceNode(
		String id, 
		String label, 
		ImageDescriptor imageDescriptor,
		Class<? extends IPreferencePage> pageClass, 
		String path, 
		String nodeQualifier) {

	super(id, label, imageDescriptor, pageClass.getName());
	this.path = path;
	this.pageClass = pageClass;

	this.nodeQualifier = (nodeQualifier != null) 
			? nodeQualifier : FrameworkUtil.getBundle(pageClass).getSymbolicName();

	this.context = EclipseContextFactory.getServiceContext(
			FrameworkUtil.getBundle(pageClass).getBundleContext());
	this.logger = context.get(LogService.class);
}
 
开发者ID:fipro78,项目名称:e4-preferences,代码行数:40,代码来源:ContributedPreferenceNode.java

示例11: E4ContextRootImpl

import org.eclipse.e4.core.contexts.EclipseContextFactory; //导入方法依赖的package包/类
public E4ContextRootImpl(BundleContext bundleContext, String name) {
	super(bundleContext, name);

	this.eclipseContext = EclipseContextFactory.getServiceContext(bundleContext);
	
	initializeContext(this.eclipseContext);
}
 
开发者ID:asupdev,项目名称:asup,代码行数:8,代码来源:E4ContextRootImpl.java


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