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


Java ContextInjectionFactory.inject方法代码示例

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


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

示例1: execute

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Execute
public void execute(@Named(IServiceConstants.ACTIVE_SHELL) final Shell shell,
		BTSConfigurationController configurationController, EventBroker eventBroker,
		IEclipseContext context)
{

	NewConfigurationDialog dialog = new NewConfigurationDialog(shell);
	ContextInjectionFactory.inject(
			dialog, context);
	if (dialog.open() == dialog.OK)
	{
		System.out.println("Realm.runWithDefault in NewConfigurationHandler");
		final BTSConfiguration config = dialog.getConfiguration();
		configurationController.save(config);
		eventBroker.post("model_new/asyncEvent", config);
	}

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

示例2: execute

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Execute
public void execute(@Active MPart activePart, @Active Shell shell,
		IEclipseContext context, @Optional @Named("org.bbaw.bts.ui.main.commandparameter.viewerFilter") String viewerFilterString,
		@Optional @Named("org.bbaw.bts.ui.main.commandparameter.searchString") String searchString,
		@Optional @Named("org.bbaw.bts.ui.main.commandparameter.searchOptions") String searchOptions) {
	Object o = activePart.getObject();
	if (o instanceof SearchViewer) {
		SearchViewer searchViewer = (SearchViewer) o;
		SimpleSearchQueryDialog dialog = new SimpleSearchQueryDialog(shell);
		ContextInjectionFactory.inject(dialog, context);
		dialog.create();
		dialog.setSearchString(searchString);
		if (searchOptions != null) {
			dialog.setNameOnly(searchOptions.contains(SearchViewer.OPT_NAME_ONLY));
			dialog.setIdOnly(searchOptions.contains(SearchViewer.OPT_ID_ONLY));
		}
		dialog.setTitle("Object Search");
		if (dialog.open() == SimpleSearchQueryDialog.OK) {
			if (dialog.getQueryRequest() != null) {
				searchViewer.search(dialog.getQueryRequest(), null, viewerFilterString);
			}
		}
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:25,代码来源:OpenSearchQueryDialogHandler.java

示例3: execute

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Execute
public void execute(IEclipseContext context) {
	IEclipseContext child = context.createChild();
	
	StatusMessageDialog dialog = new StatusMessageDialog();
			
	ContextInjectionFactory.inject(
					dialog, child);
	dialog.create();

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

示例4: makeFilter

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
private BTSObjectsByListEntryFilter makeFilter(Class clazz, IEclipseContext context) throws InstantiationException, IllegalAccessException {
	BTSObjectsByListEntryFilter filter =  (BTSObjectsByListEntryFilter) clazz.newInstance();
	ContextInjectionFactory.inject(filter, context);
	return filter;

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

示例5: execute

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Execute
public void execute(@Optional @Named(IServiceConstants.ACTIVE_SELECTION) BTSDBBaseObject selection,
		@Named(IServiceConstants.ACTIVE_SHELL) final Shell shell,
		IEclipseContext context, MoveObjectAmongProjectDBCollectionHandlerController moveController, BTSProjectController projectController,
		@Optional @Named(BTSCoreConstants.PARAM_ID_MOVE_OBEJECT_AMONG_PROJECT_TARGET_DBCOLLECTIONS) String targetDBCollectionPath) {
	String sourceDBCollectionPath = selection.getDBCollectionKey();

	// if parameter not null
	if (targetDBCollectionPath != null && !targetDBCollectionPath.equals(selection.getDBCollectionKey()))
	{
		moveController.move(selection, targetDBCollectionPath, sourceDBCollectionPath);
	}
	else 
	{
		// get input treenode from moveController
		TreeNodeWrapper rootNode = moveController.getMoveOptionsRootNode(selection);

		// get filter from move service
		BTSFilter moveDBCollectionFilter  = moveController.getMoveDBCollectionFilter(selection);
		
		BTSProject currentProject = projectController.findProjectByProjectPrefix(selection.getProject());
		
		// create dialog, insert rootNode
		MoveObjectAmongProjectDBCollectionSelectionDialog dialog = new MoveObjectAmongProjectDBCollectionSelectionDialog(shell, 
				rootNode, moveDBCollectionFilter, selection, currentProject);
		dialog.create();

		ContextInjectionFactory.inject(dialog, context);

		if (dialog.open() == Dialog.OK)
		{
			// get selection result
			targetDBCollectionPath = dialog.getTargetDBCollectionPath();
			
			// if not null
			if (targetDBCollectionPath != null && !targetDBCollectionPath.equals(selection.getDBCollectionKey()))
			{
				moveController.move(selection, targetDBCollectionPath, sourceDBCollectionPath);
			}
		}
		//
	}
	
}
 
开发者ID:cplutte,项目名称:bts,代码行数:45,代码来源:MoveObjectAmongProjectDBCollectionHandler.java

示例6: makeFilter

import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
private ViewerFilter makeFilter(Class clazz, IEclipseContext context) throws InstantiationException, IllegalAccessException {
	ViewerFilter filter =  (ViewerFilter) clazz.newInstance();
	ContextInjectionFactory.inject(filter, context);
	return filter;

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


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