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

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


  }

  @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

        }
      }
    } else {
      // failed to create the widget, dispose its context if necessary
      if (element instanceof MContext) {
        MContext ctxt = (MContext) element;
        IEclipseContext lclContext = ctxt.getContext();
        if (lclContext != null) {
          lclContext.dispose();
          ctxt.setContext(null);
        }
      }
    }
   
    return widget;
View Full Code Here

      }
    }
  }
 
  private void clearContext(MContext contextME) {
    MContext ctxt = (MContext) contextME;
    IEclipseContext lclContext = ctxt.getContext();
    if (lclContext != null) {
      IEclipseContext parentContext = lclContext.getParent();
      IEclipseContext child = parentContext.getActiveChild();
      if (child == lclContext) {
        child.deactivate();
      }

      ctxt.setContext(null);
      lclContext.dispose();
    }
  }
View Full Code Here

    registerModelListeners();
  }

  private void activateContexts(Object me) {
    if (me instanceof MBindings) {
      MContext contextModel = (MContext) me;
      MBindings container = (MBindings) me;
      List<MBindingContext> bindingContexts = container
          .getBindingContexts();
      IEclipseContext context = contextModel.getContext();
      if (context != null && !bindingContexts.isEmpty()) {
        EContextService cs = context.get(EContextService.class);
        for (MBindingContext element : bindingContexts) {
          cs.activateContext(element.getElementId());
        }
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

    try {
      URL url = AboutPageTab.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 = HelpPageTab.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.ui.MContext

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.