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

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


  }

  @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

          // now remove the selected element
          removeGui(selectedElement);
        }
       
        if (element instanceof MContribution) {
          MContribution contribution = (MContribution) element;
          Object client = contribution.getObject();
          IEclipseContext parentContext = renderer.getModelContext(element);
          if (parentContext != null && client != null) {
            try {
              ContextInjectionFactory.invoke(client,
                  PersistState.class, parentContext, null);
            } catch (Exception e) {
              e.printStackTrace();
            }
          }
        }
       
        renderer.destroyWidget(element);
       
        if (element instanceof MContribution) {
          MContribution contribution = (MContribution) element;
          Object client = contribution.getObject();
          IEclipseContext parentContext = renderer.getModelContext(element);
          if (parentContext != null && client != null) {
            try {
              ContextInjectionFactory.uninject(client, parentContext);
            } catch (Exception e) {
              e.printStackTrace();
            }
          }
          contribution.setObject(null);
        }

        // dispose the context
        if (element instanceof MContext) {
          clearContext((MContext) element);
View Full Code Here

    return cmd;
  }
 
  protected boolean canExecute(M item, IEclipseContext context) {
    if( item instanceof MContribution ) {
      MContribution contribution = (MContribution) item;
      Object object = getContributionObject(context, contribution);
      if( object == null ) {
        return false;
      }
     
View Full Code Here

    return false;
  }
 
  protected void executeAction(M item, IEclipseContext context) {
    if( item instanceof MContribution ) {
      MContribution contribution = (MContribution) item;
      Object object = getContributionObject(context, contribution);
      if( object == null ) {
        return;
      }
     
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.MContribution

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.