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

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


  }

  @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

        Button b = new Button("Add new Part");
        b.setOnAction(new EventHandler<ActionEvent>() {
          @SuppressWarnings("unchecked")
          @Override
          public void handle(ActionEvent event) {
            MElementContainer container = dd.getSelectionModel().getSelectedItem();
           
            MPart p = BasicFactoryImpl.eINSTANCE.createPart();
            p.setLabel("New Part");
            p.setContributionURI("bundleclass://at.bestsolution.efxclipse.testcases.e4/at.bestsolution.efxclipse.testcases.e4.parts.ContentPanel");
            container.getChildren().add(p);
          }
        });
        hbox.getChildren().add(b);
        vbox.getChildren().add(hbox);
      }
     
      {
        HBox hbox = new HBox(10);
       
        final ComboBox<MElementContainer> dd = new ComboBox<>();
        dd.setCellFactory(new Callback<ListView<MElementContainer>, ListCell<MElementContainer>>() {
         
          @Override
          public ListCell<MElementContainer> call(ListView<MElementContainer> param) {
            return new ListCell<MElementContainer>() {
              @Override
              protected void updateItem(MElementContainer item, boolean empty) {
                super.updateItem(item, empty);
                if( item != null ) {
                  setText(item.getClass().getSimpleName())
                }
              }
            };
          }
        });
        dd.setItems(FXCollections.observableArrayList(modelService.findElements(perspective == null ? application : perspective, null, MElementContainer.class, null)));
        hbox.getChildren().add(dd);
       
        Button b = new Button("Remove last Part");
        b.setOnAction(new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent event) {
            MElementContainer container = dd.getSelectionModel().getSelectedItem();
            container.getChildren().remove(container.getChildren().size()-1);
          }
        });
        hbox.getChildren().add(b);
        vbox.getChildren().add(hbox);
      }
     
      {
        HBox hbox = new HBox(10);
       
        final ComboBox<MElementContainer> dd = new ComboBox<>();
        dd.setCellFactory(new Callback<ListView<MElementContainer>, ListCell<MElementContainer>>() {
         
          @Override
          public ListCell<MElementContainer> call(ListView<MElementContainer> param) {
            return new ListCell<MElementContainer>() {
              @Override
              protected void updateItem(MElementContainer item, boolean empty) {
                super.updateItem(item, empty);
                if( item != null ) {
                  setText(item.getClass().getSimpleName())
                }
              }
            };
          }
        });
        dd.setItems(FXCollections.observableArrayList(modelService.findElements(perspective == null ? application : perspective, null, MElementContainer.class, null)));
        hbox.getChildren().add(dd);
       
        Button b = new Button("Move last Part");
        b.setOnAction(new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent event) {
            MElementContainer container = dd.getSelectionModel().getSelectedItem();
            Object o = container.getChildren().remove(container.getChildren().size()-1);
            container.getChildren().add(container.getChildren().size()-1, o);
          }
        });
        hbox.getChildren().add(b);
        vbox.getChildren().add(hbox);
      }
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.ui.MElementContainer

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.