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

Examples of org.eclipse.e4.ui.model.application.commands.MKeyBinding


  }

  @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

          // adding a binding
          if (UIEvents.EventTypes.ADD.equals(event
              .getProperty(UIEvents.EventTags.TYPE))
              && newObj instanceof MKeyBinding) {

            MKeyBinding binding = (MKeyBinding) newObj;
            updateBinding(binding, true, elementObj);
          }
          // removing a binding
          else if (UIEvents.EventTypes.REMOVE.equals(event
              .getProperty(UIEvents.EventTags.TYPE))
              && oldObj instanceof MKeyBinding) {

            MKeyBinding binding = (MKeyBinding) oldObj;
            updateBinding(binding, false, elementObj);
          }
        } else if (elementObj instanceof MKeyBinding) {
          MKeyBinding binding = (MKeyBinding) elementObj;

          String attrName = (String) event
              .getProperty(UIEvents.EventTags.ATTNAME);

          if (UIEvents.EventTypes.SET.equals(event
              .getProperty(UIEvents.EventTags.TYPE))) {
            Object oldObj = event
                .getProperty(UIEvents.EventTags.OLD_VALUE);
            if (UIEvents.KeyBinding.COMMAND.equals(attrName)) {
              MKeyBinding oldBinding = (MKeyBinding) EcoreUtil
                  .copy((EObject) binding);
              oldBinding.setCommand((MCommand) oldObj);
              updateBinding(oldBinding, false,
                  ((EObject) binding).eContainer());
              updateBinding(binding, true, null);
            } else if (UIEvents.KeySequence.KEYSEQUENCE
                .equals(attrName)) {
              MKeyBinding oldBinding = (MKeyBinding) EcoreUtil
                  .copy((EObject) binding);
              oldBinding.setKeySequence((String) oldObj);
              updateBinding(oldBinding, false,
                  ((EObject) binding).eContainer());
              updateBinding(binding, true, null);
            }
          } else if (UIEvents.KeyBinding.PARAMETERS.equals(attrName)) {
            if (UIEvents.EventTypes.ADD.equals(event
                .getProperty(UIEvents.EventTags.TYPE))) {
              Object newObj = event
                  .getProperty(UIEvents.EventTags.NEW_VALUE);
              MKeyBinding oldBinding = (MKeyBinding) EcoreUtil
                  .copy((EObject) binding);
              oldBinding.getParameters().remove(newObj);
              updateBinding(oldBinding, false,
                  ((EObject) binding).eContainer());
              updateBinding(binding, true, null);
            } else if (UIEvents.EventTypes.REMOVE.equals(event
                .getProperty(UIEvents.EventTags.TYPE))) {
              Object oldObj = event
                  .getProperty(UIEvents.EventTags.OLD_VALUE);
              MKeyBinding oldBinding = (MKeyBinding) EcoreUtil
                  .copy((EObject) binding);
              oldBinding.getParameters().add((MParameter) oldObj);
              updateBinding(oldBinding, false,
                  ((EObject) binding).eContainer());
              updateBinding(binding, true, null);
            }
          }
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

  public IDataProvider findDataProvider(Object dataContext) {
    if (dataContext instanceof IDataProvider) {
      return (IDataProvider) dataContext;
    }
    for (IDataProviderFactory factory : dataProviderFactories.values()) {
      IDataProvider dataProvider = factory.create(dataContext);
      if (dataProvider != null) {
        return dataProvider;
      }
    }
    ObjectDataProvider dataProvider = new ObjectDataProvider();
    dataProvider.setObjectInstance(dataContext);
    return dataProvider;
  }
View Full Code Here

    // direct binding
    if (dataContext instanceof IBinding) {
      dataContext = ((IBinding) dataContext).getValue(null);
    }

    IDataProvider dataProvider = getDataProvider(dataContext);

    try {
      if (isSourceControl()) {
        ControlDataBinding controlDataBinding = new ControlDataBinding(
            dataContext, this, dataProvider);
View Full Code Here

TOP

Related Classes of org.eclipse.e4.ui.model.application.commands.MKeyBinding

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.