Examples of IContributionFactory


Examples of org.eclipse.e4.core.services.contributions.IContributionFactory

      IEventBroker eventBroker,
      ThemeManager themeManager) {
    if( factoryUrl == null ) {
      factoryUrl = defaultFactoryUrl;
    }
    IContributionFactory contribFactory = context.get(IContributionFactory.class);
    this.factory = (RendererFactory) contribFactory.create(factoryUrl, context);
    this.modelService = modelService;
   
    ifcontext.get(EBindingService.class.getName()) != null ) {
      KeyBindingDispatcher dispatcher = ContextInjectionFactory.make(KeyBindingDispatcher.class, context);
      context.set(KeyBindingDispatcher.class, dispatcher);
View Full Code Here

Examples of org.eclipse.e4.core.services.contributions.IContributionFactory

    if (!appContext.containsKey("org.eclipse.e4.ui.workbench.modeling.EModelService")) {
      throw new IllegalStateException("Core services not available. Please make sure that a declarative service implementation (such as the bundle 'org.eclipse.equinox.ds') is available!");
    }

    // Get the factory to create DI instances with
    IContributionFactory factory = (IContributionFactory) appContext.get(IContributionFactory.class.getName());

    // Install the life-cycle manager for this session if there's one
    // defined
    String lifeCycleURI = getArgValue(E4Workbench.LIFE_CYCLE_URI_ARG, applicationContext, false);
    if (lifeCycleURI != null) {
      lcManager = factory.create(lifeCycleURI, appContext);
      if (lcManager != null) {
        // Let the manager manipulate the appContext if desired
        Boolean rv = (Boolean) ContextInjectionFactory.invoke(lcManager, PostContextCreate.class, appContext, Boolean.TRUE);
        if( rv != null && ! rv.booleanValue() ) {
          return null;
        }
      }
    }
    // Create the app model and its context
    MApplication appModel = loadApplicationModel(applicationContext, appContext);
    appModel.setContext(appContext);

    // Set the app's context after adding itself
    appContext.set(MApplication.class.getName(), appModel);

    // let the life cycle manager add to the model
    if (lcManager != null) {
      ContextInjectionFactory.invoke(lcManager, ProcessAdditions.class, appContext, null);
      ContextInjectionFactory.invoke(lcManager, ProcessRemovals.class, appContext, null);
    }

    // Create the addons
    IEclipseContext addonStaticContext = EclipseContextFactory.create();
    for (MAddon addon : appModel.getAddons()) {
      addonStaticContext.set(MAddon.class, addon);
      Object obj = factory.create(addon.getContributionURI(), appContext, addonStaticContext);
      addon.setObject(obj);
    }

    // Parse out parameters from both the command line and/or the product
    // definition (if any) and put them in the context
View Full Code Here

Examples of org.eclipse.e4.core.services.contributions.IContributionFactory

    if (resourceHandler == null) {
      resourceHandler = "bundleclass://org.eclipse.e4.ui.workbench/" + ResourceHandler.class.getName();
    }

    IContributionFactory factory = eclipseContext.get(IContributionFactory.class);

    handler = (IModelResourceHandler) factory.create(resourceHandler, eclipseContext);

    Resource resource = handler.loadMostRecentModel();
    theApp = (MApplication) resource.getContents().get(0);

    return theApp;
View Full Code Here

Examples of org.eclipse.e4.core.services.contributions.IContributionFactory

      if( contribution.getContributionURI() == null ) {
        logger.error("No contribution uri defined");
        return null;
      }
     
      IContributionFactory cf = (IContributionFactory) context.get(IContributionFactory.class.getName());
      rv = cf.create(contribution.getContributionURI(), context);
      contribution.setObject(rv);
    }
    return rv;
  }
View Full Code Here

Examples of org.eclipse.e4.core.services.contributions.IContributionFactory

    do {
      element.getContext().set(cl.getName(), widget.getWidget());
      cl = cl.getSuperclass();
    } while( ! cl.getName().equals("java.lang.Object") );
   
    IContributionFactory contributionFactory = (IContributionFactory) element.getContext().get(IContributionFactory.class
        .getName());
    Object newPart = contributionFactory.create(element.getContributionURI(), element.getContext());
    element.setObject(newPart);
   
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.