本文整理汇总了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);
}
}
示例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);
}
}
}
}
示例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) {
}
}
示例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;
}
示例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);
}
}
//
}
}
示例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;
}