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


Java IEclipseContext类代码示例

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


IEclipseContext类属于org.eclipse.e4.core.contexts包,在下文中一共展示了IEclipseContext类的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();
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:BuildPath.java

示例2: postConstruct

import org.eclipse.e4.core.contexts.IEclipseContext; //导入依赖的package包/类
@PostConstruct
public void postConstruct(IEclipseContext context, Composite parent) {
	viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);

	// create the columns
	// not yet implemented
	createColumns(viewer);

	// make lines and header visible
	final Table table = viewer.getTable();
	table.setHeaderVisible(true);
	table.setLinesVisible(true);
	viewer.setContentProvider(ArrayContentProvider.getInstance());
	// attach a selection listener to our jface viewer
	viewer.addSelectionChangedListener(ContextInjectionFactory.make(TermSelectionListener.class, context));

}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:18,代码来源:AlignmentResultsPart.java

示例3: createControls

import org.eclipse.e4.core.contexts.IEclipseContext; //导入依赖的package包/类
@PostConstruct
public void createControls(
		IEclipseContext context, 
		@Preference(nodePath = TermSuiteUI.PLUGIN_ID, value = TermSuiteUIPreferences.WRAP_TEXT) boolean wrap,
		final Composite parent, 
		MPart part,
		ILoggerProvider loggerProvider,
		EModelService modelService) {
	this.logger = loggerProvider.getClassLogger(this.getClass());

	parent.setLayout(new FillLayout());
	text = new StyledText(parent, getTheStyle(wrap, false));
	
	MToolItem wrapButton = (MToolItem)modelService.find(TOOL_ITEM_WRAP_TEXT, part.getToolbar());
	wrapButton.setSelected(wrap);
	
	text.addLineStyleListener(lineStyleListener);
	text.addLineBackgroundListener(lineBackgroundListener);
	text.setWrapIndent(20);
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:21,代码来源:FileEditorPart.java

示例4: createControls

import org.eclipse.e4.core.contexts.IEclipseContext; //导入依赖的package包/类
@PostConstruct
public void createControls(Composite parent,
		IEclipseContext context) {
	
	this.pipelineValidValue.setValue(false);
	this.context = context;
	
	FormToolkit toolkit = new FormToolkit(parent.getDisplay());
    form = toolkit.createScrolledForm(parent);
	form.setText(EDITOR_TITLE);
	Composite body = form.getBody();
	body.setLayout(new ColumnLayout());


	/*
	 * Create the content
	 */
	createPipelineContent(toolkit, form);
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:20,代码来源:PipelinePart.java

示例5: compute

import org.eclipse.e4.core.contexts.IEclipseContext; //导入依赖的package包/类
@Override
public Object compute(IEclipseContext context, String contextKey) {
  Object path = context.get(PreferenceConstants.CLOUDSDK_PATH);
  if (path == null) {
    // record this context as using the preference value
    referencedContexts.add(context);
  }

  CloudSdk.Builder builder = new CloudSdk.Builder();
  Path location = toPath(path);
  if (location != null) {
    builder.sdkPath(location);
  }

  try {
    CloudSdk instance = builder.build();
    instance.validateCloudSdk();
    instance.validateAppEngineJavaComponents();
    return instance;
  } catch (CloudSdkNotFoundException | CloudSdkOutOfDateException
      | AppEngineJavaComponentsNotInstalledException ex) {
    return NOT_A_VALUE;
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:25,代码来源:CloudSdkContextFunction.java

示例6: 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();
	}
	RemoteDBConnectionProvider dao;
	try
	{
		dao = loadDaoFactory(context).createDao(RemoteDBConnectionProvider.class, context);
	} catch (CoreException e)
	{
		e.printStackTrace();
		throw new BTSDBException(
				"No DaoFactory found for DBConnectionProvider and factory name: " + daoFactoryName, e);

	}
	context.set(RemoteDBConnectionProvider.class, dao);

	return dao;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:24,代码来源:RemoteDBConnectionProviderContextFunction.java

示例7: 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();
	}
	RemoteDBLeaseDao dao;
	try
	{
		dao = loadDaoFactory(context).createDao(RemoteDBLeaseDao.class, context);
	} catch (CoreException e)
	{
		e.printStackTrace();
		throw new BTSDBException("No DaoFactory found for DBLeaseDao and factory name: " + daoFactoryName, e);

	}
	context.set(RemoteDBLeaseDao.class, dao);

	return dao;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:23,代码来源:RemoteDBLeaseDaoContextFunction.java

示例8: loadDaoFactory

import org.eclipse.e4.core.contexts.IEclipseContext; //导入依赖的package包/类
private RemoteDAOFactory loadDaoFactory(IEclipseContext context) throws CoreException
{
	IConfigurationElement[] config = ((IExtensionRegistry) context.get(IExtensionRegistry.class.getName()))
			.getConfigurationElementsFor(RemoteDaoConstants.REMOTE_DAO_FACTORY_EXTENSION_POINT_ID);
	for (IConfigurationElement e : config)
	{
		final Object o = e.createExecutableExtension("class");
		if (o instanceof RemoteDAOFactory
				&& (daoFactoryName == null || daoFactoryName.equals(((RemoteDAOFactory) o).getFactoryName())))
		{
			return (RemoteDAOFactory) o;
		}
	}
	throw new BTSDBException("No DaoFactory found for DBLeaseDao and factory name: " + daoFactoryName);

}
 
开发者ID:cplutte,项目名称:bts,代码行数:17,代码来源:RemoteDBLeaseDaoContextFunction.java

示例9: loadDaoFactory

import org.eclipse.e4.core.contexts.IEclipseContext; //导入依赖的package包/类
private RemoteDAOFactory loadDaoFactory(IEclipseContext context) throws CoreException
{
	IConfigurationElement[] config = ((IExtensionRegistry) context.get(IExtensionRegistry.class.getName()))
			.getConfigurationElementsFor(RemoteDaoConstants.REMOTE_DAO_FACTORY_EXTENSION_POINT_ID);
	for (IConfigurationElement e : config)
	{
		final Object o = e.createExecutableExtension("class");
		if (o instanceof RemoteDAOFactory
				&& (daoFactoryName == null || daoFactoryName.equals(((RemoteDAOFactory) o).getFactoryName())))
		{
			return (RemoteDAOFactory) o;
		}
	}
	throw new BTSDBException("No DaoFactory found for BTSUserGroupDao and factory name: " + daoFactoryName);

}
 
开发者ID:cplutte,项目名称:bts,代码行数:17,代码来源:RemoteBTSUserGroupDaoContextFunction.java

示例10: 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();
	}
	RemoteBTSUserDao dao;
	try
	{
		dao = loadDaoFactory(context).createDao(RemoteBTSUserDao.class, context);
	} catch (CoreException e)
	{
		e.printStackTrace();
		throw new BTSDBException("No DaoFactory found for BTSUserDao and factory name: " + daoFactoryName, e);

	}
	context.set(RemoteBTSUserDao.class, dao);

	return dao;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:23,代码来源:RemoteBTSUserDaoContextFunction.java

示例11: loadDaoFactory

import org.eclipse.e4.core.contexts.IEclipseContext; //导入依赖的package包/类
private RemoteDAOFactory loadDaoFactory(IEclipseContext context) throws CoreException
{
	IConfigurationElement[] config = ((IExtensionRegistry) context.get(IExtensionRegistry.class.getName()))
			.getConfigurationElementsFor(RemoteDaoConstants.REMOTE_DAO_FACTORY_EXTENSION_POINT_ID);
	for (IConfigurationElement e : config)
	{
		final Object o = e.createExecutableExtension("class");
		if (o instanceof RemoteDAOFactory
				&& (daoFactoryName == null || daoFactoryName.equals(((RemoteDAOFactory) o).getFactoryName())))
		{
			return (RemoteDAOFactory) o;
		}
	}
	
	// in case no extension point found, look up context
	// this is necessary to run the same plugins on a Eclipse Virgo server for the web application
	RemoteDAOFactory factory = context.get(RemoteDAOFactory.class);
	if (factory != null) return factory;
	
	// if nothing found, throw exception
	throw new BTSDBException("No DaoFactory found for GeneralPurposeDao and factory name: " + daoFactoryName);

}
 
开发者ID:cplutte,项目名称:bts,代码行数:24,代码来源:RemoteDBManagerContextFunction.java

示例12: 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();
	}
	BTSAbstractTextDao dao;
	try
	{
		dao = loadDao(context, daoFactoryName, BTSAbstractTextDao.class);
	} catch (CoreException e)
	{
		e.printStackTrace();
		throw new BTSDBException("No DaoFactory found for BTSAbstractTextDao and factory name: " + daoFactoryName, e);

	}
	context.set(BTSAbstractTextDao.class, dao);

	return dao;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:23,代码来源:BTSAbstractTextDaoContextFunction.java

示例13: loadDaoFactory

import org.eclipse.e4.core.contexts.IEclipseContext; //导入依赖的package包/类
private RemoteDAOFactory loadDaoFactory(IEclipseContext context) throws CoreException
{
	IConfigurationElement[] config = ((IExtensionRegistry) context.get(IExtensionRegistry.class.getName()))
			.getConfigurationElementsFor(RemoteDaoConstants.REMOTE_DAO_FACTORY_EXTENSION_POINT_ID);
	for (IConfigurationElement e : config)
	{
		final Object o = e.createExecutableExtension("class");
		if (o instanceof RemoteDAOFactory
				&& (daoFactoryName == null || daoFactoryName.equals(((RemoteDAOFactory) o).getFactoryName())))
		{
			return (RemoteDAOFactory) o;
		}
	}
	throw new BTSDBException("No DaoFactory found for BTSUserDao and factory name: " + daoFactoryName);

}
 
开发者ID:cplutte,项目名称:bts,代码行数:17,代码来源:RemoteBTSIDReservationObjectDaoContextFunction.java

示例14: loadDaoFactory

import org.eclipse.e4.core.contexts.IEclipseContext; //导入依赖的package包/类
private RemoteDAOFactory loadDaoFactory(IEclipseContext context) throws CoreException
{
	IConfigurationElement[] config = ((IExtensionRegistry) context.get(IExtensionRegistry.class.getName()))
			.getConfigurationElementsFor(RemoteDaoConstants.REMOTE_DAO_FACTORY_EXTENSION_POINT_ID);
	for (IConfigurationElement e : config)
	{
		final Object o = e.createExecutableExtension("class");
		if (o instanceof RemoteDAOFactory
				&& (daoFactoryName == null || daoFactoryName.equals(((RemoteDAOFactory) o).getFactoryName())))
		{
			return (RemoteDAOFactory) o;
		}
	}
	throw new BTSDBException("No DaoFactory found for GeneralPurposeDao and factory name: " + daoFactoryName);

}
 
开发者ID:cplutte,项目名称:bts,代码行数:17,代码来源:RemoteGeneralPurposeDaoContextFunction.java

示例15: 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();
	}
	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;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:23,代码来源:BTSTextCorpusDaoContextFunction.java


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