Search in sources :

Example 16 with IContributionFactory

use of org.eclipse.e4.core.services.contributions.IContributionFactory in project eclipse.platform.ui by eclipse-platform.

the class UITest method getEngine.

protected IPresentationEngine getEngine() {
    if (engine == null) {
        IContributionFactory contributionFactory = applicationContext.get(IContributionFactory.class);
        Object newEngine = contributionFactory.create(engineURI, applicationContext);
        assertTrue(newEngine instanceof IPresentationEngine);
        applicationContext.set(IPresentationEngine.class.getName(), newEngine);
        engine = (IPresentationEngine) newEngine;
    }
    return engine;
}
Also used : IContributionFactory(org.eclipse.e4.core.services.contributions.IContributionFactory) IPresentationEngine(org.eclipse.e4.ui.workbench.IPresentationEngine)

Aggregations

IContributionFactory (org.eclipse.e4.core.services.contributions.IContributionFactory)16 IEclipseContext (org.eclipse.e4.core.contexts.IEclipseContext)9 IPresentationEngine (org.eclipse.e4.ui.workbench.IPresentationEngine)5 EObject (org.eclipse.emf.ecore.EObject)5 EHandlerService (org.eclipse.e4.core.commands.EHandlerService)3 ParameterizedCommand (org.eclipse.core.commands.ParameterizedCommand)2 MApplication (org.eclipse.e4.ui.model.application.MApplication)2 MDirectMenuItem (org.eclipse.e4.ui.model.application.ui.menu.MDirectMenuItem)2 MHandledMenuItem (org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem)2 IRendererFactory (org.eclipse.e4.ui.workbench.swt.factories.IRendererFactory)2 Composite (org.eclipse.swt.widgets.Composite)2 Widget (org.eclipse.swt.widgets.Widget)2 IOException (java.io.IOException)1 HashSet (java.util.HashSet)1 PostConstruct (javax.annotation.PostConstruct)1 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)1 IStatus (org.eclipse.core.runtime.IStatus)1 InvalidRegistryObjectException (org.eclipse.core.runtime.InvalidRegistryObjectException)1 Status (org.eclipse.core.runtime.Status)1 ExpressionContext (org.eclipse.e4.core.commands.ExpressionContext)1