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


Java IEclipseContext.get方法代码示例

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


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

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

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

示例3: compute

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

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

示例4: compute

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

	BTSStatusMessageService service = ContextInjectionFactory.make(BTSStatusMessageServiceImpl.class, ctx);
	ctx.set(BTSStatusMessageService.class, service);

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

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

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

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

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

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

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

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

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

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

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

	return dao;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:23,代码来源:BTSLemmaEntryDaoContextFunction.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();
	}
	BTSConfigurationDao dao;
	try
	{
		dao = loadDao(context, daoFactoryName, BTSConfigurationDao.class);
	} catch (CoreException e)
	{
		e.printStackTrace();
		throw new BTSDBException("No DaoFactory found for BTSConfigurationDao and factory name: " + daoFactoryName,
				e);

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

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

示例11: compute

import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的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

示例12: compute

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

		 BTSCommentService service = ContextInjectionFactory.make( BTSCommentServiceImpl.class, ctx);
		ctx.set( BTSCommentService.class, service);

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

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

示例14: compute

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

	BTSProjectController controller = ContextInjectionFactory.make(BTSProjectControllerImpl.class, context);
	context.set(BTSProjectController.class, controller);

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

示例15: CommandProvider

import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
public CommandProvider(IEvaluationContext evaluationContext) {
	this.evaluationContext = evaluationContext;
	IEclipseContext context = ((ExpressionContext) evaluationContext).eclipseContext;
	ehandlerService = context.get(EHandlerService.class);
	handlerService  = context.get(IHandlerService.class);
	commandService  = context.get(ICommandService.class);
	commandById = new HashMap<>();
}
 
开发者ID:dakaraphi,项目名称:eclipse-plugin-commander,代码行数:9,代码来源:CommandProvider.java


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