本文整理汇总了Java中org.eclipse.e4.core.contexts.ContextInjectionFactory.make方法的典型用法代码示例。如果您正苦于以下问题:Java ContextInjectionFactory.make方法的具体用法?Java ContextInjectionFactory.make怎么用?Java ContextInjectionFactory.make使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.e4.core.contexts.ContextInjectionFactory
的用法示例。
在下文中一共展示了ContextInjectionFactory.make方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runContainerResolverJob
import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的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();
}
示例2: compute
import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
System.out.println("Intitialize CommentController");
// Add the new object to the application context
CommentController controller = ContextInjectionFactory.make(CommentControllerImpl.class, context);
MApplication application = context.get(MApplication.class);
if (application == null)
{
context.set(CommentController.class, controller);
} else
{
IEclipseContext ctx = application.getContext();
ctx.set(CommentController.class, controller);
}
return controller;
}
示例3: openInPassportEditorDialog
import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
private void openInPassportEditorDialog(
ISelection sel) {
StructuredSelection localSelection = (StructuredSelection) sel;
if (localSelection.getFirstElement() != null
&& localSelection.getFirstElement() instanceof TreeNodeWrapper) {
TreeNodeWrapper localTreeNode = (TreeNodeWrapper) localSelection
.getFirstElement();
if (localTreeNode.getObject() != null) {
BTSObject localCorpusObject = (BTSObject) localTreeNode.getObject();
if (localCorpusObject instanceof BTSCorpusObject) {
lemmaNavigatorController.checkAndFullyLoad((BTSCorpusObject) localCorpusObject, true);
IEclipseContext child = context.createChild();
child.set(BTSObject.class, localCorpusObject);
child.set(Shell.class, new Shell());
child.set(BTSCoreConstants.CORE_EXPRESSION_MAY_EDIT, false);
PassportEditorDialog dialog = ContextInjectionFactory.make(
PassportEditorDialog.class, child);
dialog.open();
}
}
}
}
示例4: compute
import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
System.out.println("Intitialize BTSTextCorpusService");
// Add the new object to the application context
MApplication application = context.get(MApplication.class);
IEclipseContext ctx = context;
if (application != null)
{
ctx= application.getContext();
}
BTSTextCorpusService service = ContextInjectionFactory.make(BTSTextCorpusServiceImpl.class, context);
ctx.set(BTSTextCorpusService.class, service);
return service;
}
示例5: compute
import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的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;
}
示例6: compute
import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
System.out.println("Intitialize BTSAnnotationService");
// 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;
}
BTSAnnotationService annotationService = ContextInjectionFactory.make(BTSAnnotationServiceImpl.class, ctx);
ctx.set(BTSAnnotationService.class, annotationService);
return annotationService;
}
示例7: execute
import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Execute
public void execute(@Named(IServiceConstants.ACTIVE_SELECTION) @Optional Object object,
@Named(IServiceConstants.ACTIVE_SHELL) final Shell shell,
IEclipseContext context) {
BTSCorpusObject corpusObject = null;
if (object instanceof BTSCorpusObject)
{
corpusObject = (BTSCorpusObject) object;
}
else if (object instanceof BTSTextSelectionEvent && ((BTSTextSelectionEvent) object).data instanceof BTSCorpusObject)
{
corpusObject = (BTSCorpusObject) ((BTSTextSelectionEvent) object).data;
}
if (corpusObject == null) return;
IEclipseContext child = context.createChild();
child.set(BTSCorpusObject.class, corpusObject);
child.set(Shell.class, shell);
CheckPassportDialog dialog = ContextInjectionFactory.make(
CheckPassportDialog.class, child);
if (dialog.open() == CheckPassportDialog.OK) {
}
}
示例8: init
import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@PostConstruct
public void init(ILoggerProvider loggerProvider, MApplication application, IEclipseContext context) {
loggerProvider.getClassLogger(this.getClass()).debug("Entering [email protected]");
IEclipseContext appContext = application.getContext();
appContext.set(Preferences.class, ContextInjectionFactory.make(Preferences.class, appContext));
appContext.set(PreferenceStore.class, ContextInjectionFactory.make(PreferenceStore.class, appContext));
ContextInjectionFactory.make(Services.class, context);
ProgressManager progressManager = ContextInjectionFactory.make(ProgressManager.class, context);
appContext.set(ProgressManager.class, progressManager);
// bug-fix: add a ProgressViewUpdater to the application context
appContext.set(ProgressViewUpdater.class, ContextInjectionFactory.make(ProgressViewUpdater.class, appContext));
loggerProvider.getClassLogger(this.getClass()).debug("Exiting [email protected]");
}
示例9: createViewer
import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
private void createViewer(Composite container) {
layout = new TreeColumnLayout(true);
container.setLayout(layout);
this.viewer = new TerminologyViewer(viewerConfig, container, SWT.SINGLE| SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
GridDataFactory.fillDefaults().span(4, 1).grab(true, true).applyTo(viewer.getControl());
for(String pName:viewerConfig.getSelectedPropertyNames())
createColumn(PropertyUtil.forName(pName));
viewerConfig.eAdapters().add(new AdapterImpl(){
@Override
public void notifyChanged(Notification msg) {
if(msg.getFeatureID(ETerminoViewerConfig.class) == TermsuiteuiPackage.ETERMINO_VIEWER_CONFIG__SEARCH_STRING
&& msg.getNewValue() != null && !msg.getNewValue().toString().isEmpty())
/*
* This is a non empty search string filter. Expand all nodes
* in order to make selected variant appear.
*/
viewer.expandToLevel(2);
}
});
// attach a selection listener to our jface viewer
TermSelectionListener listener = ContextInjectionFactory.make(TermSelectionListener.class, context);
viewer.addSelectionChangedListener(listener);
menuService.registerContextMenu(viewer.getControl(), POPUP_MENU_ID);
}
示例10: execute
import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Execute
public void execute(final OrderService orderService, final IEclipseContext context) {
LOGGER.info(this.getClass().getSimpleName() + " called. Active Order is: " + activeOrder);
PositionWithArticleInfo posWithArticleInfo = new PositionWithArticleInfo(-1);
PositionWithOrderAndArticleInfoDTO newPosition = new PositionWithOrderAndArticleInfoDTO(posWithArticleInfo,
activeOrder);
PositionMPartFactory positionMPartFactory = ContextInjectionFactory.make(PositionMPartFactory.class, context);
positionMPartFactory.showMPartForPosition(newPosition);
}
示例11: compute
import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
System.out.println("Intitialize ApplicationStartupController");
// Add the new object to the application context
// MApplication application = context.get(MApplication.class);
// IEclipseContext ctx = application.getContext();
ApplicationStartupController controller = ContextInjectionFactory.make(ApplicationStartupControllerImpl.class,
context);
context.set(ApplicationStartupController.class, controller);
return controller;
}
示例12: compute
import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context) {
System.out.println("Intitialize LemmaNavigatorController");
// Add the new object to the application context
MApplication application = context.get(MApplication.class);
IEclipseContext ctx = application.getContext();
LemmaNavigatorController controller = ContextInjectionFactory.make(
LemmaNavigatorControllerImpl.class, context);
ctx.set(LemmaNavigatorController.class, controller);
return controller;
}
示例13: compute
import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context)
{
System.out.println("Intitialize BTSConfigurationDialogController");
// Add the new object to the application context
MApplication application = context.get(MApplication.class);
IEclipseContext ctx = application.getContext();
BTSConfigurationDialogController controller = ContextInjectionFactory.make(
BTSConfigurationDialogControllerImpl.class, context);
ctx.set(BTSConfigurationDialogController.class, controller);
return controller;
}
示例14: createViewer
import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Override
public CompareViewer createViewer(Composite parent, int style) {
if (context == null)
{
context = StaticAccessController.getContext();
}
IEclipseContext child = context.createChild();
child.set(Composite.class, parent);
compareViewer = ContextInjectionFactory.make(
CompareViewerPassportImpl.class, child);
return compareViewer;
}
示例15: compute
import org.eclipse.e4.core.contexts.ContextInjectionFactory; //导入方法依赖的package包/类
@Override
public Object compute(IEclipseContext context) {
System.out.println("Intitialize ThsNavigatorController");
// Add the new object to the application context
MApplication application = context.get(MApplication.class);
IEclipseContext ctx = application.getContext();
ThsNavigatorController controller = ContextInjectionFactory.make(
ThsNavigatorControllerImpl.class, context);
ctx.set(ThsNavigatorController.class, controller);
return controller;
}