Package org.eclipse.e4.ui.model.application

Examples of org.eclipse.e4.ui.model.application.MApplication


  }

  @Override
  public ServerResource create(Class<? extends ServerResource> clazz, Request request, Response response)
  {
    IEclipseContext childContext = serviceContext.createChild("ResourceContext");
    diLock.lock(); // The lock is required because ContextInjectionFactory.make() is not thread safe

    try
    {
      InjectedResource serverResource = (InjectedResource) ContextInjectionFactory.make(clazz, childContext);
View Full Code Here


  @Execute
  public void onExecute() {
    eventBroker.subscribe(IThemeEngine.Events.THEME_CHANGED,
        new EventHandler() {
          public void handleEvent(Event event) {
            ITheme currentTheme = (ITheme) event
                .getProperty(IThemeEngine.Events.THEME);
            // if (!prefDarker.getBoolean(
            // THEME_DARKER_PREF_THEMEENABLED, false))
            if (currentTheme.getId().equals(THEME_DARKER_ID)) {
              setupPreferences();
              isLastThemeDarker = true;
              DarkerWeavingHook.enableWeaving();
              hookDarkerCore();
            } else if (isLastThemeDarker) {
View Full Code Here

          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);
    }
View Full Code Here

    // 'running' the UI (if any)...
    return workbench = new E4Workbench(appModel, appContext);
  }

  private MApplication loadApplicationModel(IApplicationContext appContext, IEclipseContext eclipseContext) {
    MApplication theApp = null;

    Location instanceLocation = WorkbenchJFXActivator.getDefault().getInstanceLocation();

    String appModelPath = getArgValue(E4Workbench.XMI_URI_ARG, appContext, false);
    Assert.isNotNull(appModelPath, E4Workbench.XMI_URI_ARG + " argument missing"); //$NON-NLS-1$
View Full Code Here

    ServiceReference reference = context.getServiceReference(ThemeManager.class.getName());
    ThemeManager themeManager = (ThemeManager) context.getService(reference);

    List<Theme> themes = themeManager.getAvailableThemes();
    if (themes.size() > 0) {
      MApplication application = getApplication();

      MCommand switchThemeCommand = null;
      for (MCommand cmd : application.getCommands()) {
        if ("contacts.switchTheme".equals(cmd.getElementId())) { //$NON-NLS-1$
          switchThemeCommand = cmd;
          break;
        }
      }
View Full Code Here

    }
    return null;
  }

  protected boolean isAreadyProcessed(String processorId) {
    MApplication application = getApplication();
    List<String> tags = application.getTags();
    for (String tag : tags) {
      if (processorId.equals(tag)) {
        return true; // already processed
      }
    }
View Full Code Here

      @Override
      public Void call(Boolean param) {
        if( param.booleanValue() ) {
          MUIElement parentME = element.getParent();
          if (parentME instanceof MApplication) {
            MApplication app = (MApplication) parentME;
            app.setSelectedElement(element);
            element.getContext().activate();
          } else if (parentME == null) {
            parentME = (MUIElement) ((EObject) element).eContainer();
            if (parentME instanceof MContext) {
              element.getContext().activate();
View Full Code Here

    try {
      URL url = SettingsDialog.class.getResource(name);
      Map<String, Object> options = new HashMap<String, Object>();
      options.put(IXWTLoader.CLASS_PROPERTY, this);
      options.put(IXWTLoader.CONTAINER_PROPERTY, this);
      XWT.setLoadingContext(new DefaultLoadingContext(this.getClass().getClassLoader()));
      XWT.loadWithOptions(url, options);
    } catch (Throwable e) {
      throw new Error("Unable to load " + name, e);
    }
View Full Code Here

    try {
      URL url = AudioSettingsTab.class.getResource(name);
      Map<String, Object> options = new HashMap<String, Object>();
      options.put(IXWTLoader.CLASS_PROPERTY, this);
      options.put(IXWTLoader.CONTAINER_PROPERTY, this);
      XWT.setLoadingContext(new DefaultLoadingContext(this.getClass().getClassLoader()));
      XWT.loadWithOptions(url, options);
    } catch (Throwable e) {
      throw new Error("Unable to load " + name, e);
    }
View Full Code Here

    try {
      URL url = Application.class.getResource(name);
      Map<String, Object> options = new HashMap<String, Object>();
      options.put(IXWTLoader.CLASS_PROPERTY, this);
      options.put(IXWTLoader.CONTAINER_PROPERTY, this);
      XWT.setLoadingContext(new DefaultLoadingContext(this.getClass().getClassLoader()));
      XWT.loadWithOptions(url, options);
    } catch (Throwable e) {
      throw new Error("Unable to load " + name, e);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.e4.ui.model.application.MApplication

Copyright © 2018 www.massapicom. 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.