Package org.eclipse.e4.core.commands

Examples of org.eclipse.e4.core.commands.EHandlerService


  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

    }
    return value;
  }

  public boolean isSourcePropertyReadOnly() {
    IDataProvider dataProvider = getDataProvider();
    try {
      return ScopeManager.isPropertyReadOnly(dataProvider,
          getPathPropertySegments());
    } catch (XWTException e) {
    }
View Full Code Here

    return valueProperty;
  }

  protected static IValueProperty doCreateValueProperty(Object type,
      String fullPath) {
    IDataProvider dataProvider = XWT.findDataProvider(type);
    return dataProvider.createValueProperty(type, fullPath);
  }
View Full Code Here

        targetToSource = new UpdateValueStrategy(
            UpdateValueStrategy.POLICY_UPDATE);
      }

      // Add converter to UpdateValueStrategy.
      IDataProvider sourceDataProvider = XWT.findDataProvider(source);
      Object sourceValueType = sourceDataProvider.getDataType(null);
      if (sourceValueType == null) {
        sourceValueType = Object.class;
      }
      IDataProvider targetDataProvider = XWT.findDataProvider(target);
      Object targetValueType = targetDataProvider.getDataType(null);
      if (targetValueType == null) {
        targetValueType = Object.class;
      }
      Class<?> sourceType = (sourceValueType instanceof Class<?>) ? (Class<?>) sourceValueType
          : sourceValueType.getClass();
View Full Code Here

          getConverter());
    }

    IObservableValue observableWidget = getObservableWidget();

    IDataProvider dataProvider = getDataProvider();
    if (dataProvider != null) {
      BindingGate bindingGate = getBindingGate();
      if (bindingGate != null) {
        Object target = getControl();
        if (target instanceof Text
View Full Code Here

  public void removeDataProviderFactory(IDataProviderFactory dataProviderFactory) {
    if (dataProviderFactory == null) {
      return;
    }
    for (String name : dataProviderFactories.keySet()) {
      IDataProviderFactory value = dataProviderFactories.get(name);
      if (dataProviderFactory == value) {
        dataProviderFactories.remove(name);
      }
    }
  }
View Full Code Here

  }

  protected IMetaclass createMetaclass(Class<?> javaClass,
      IMetaclass superMetaclass) {
    if (service != null) {
      IMetaclassFactory factory = service.findFactory(javaClass);
      if (factory != null) {
        return factory.create(javaClass, superMetaclass, xwtLoader);
      }
    }
    boolean lazyLoading = false; // TODO Get value from preference
    return new Metaclass(javaClass, superMetaclass, lazyLoading, xwtLoader);
  }
View Full Code Here

    factories.add(metaclassFactory);
  }

  public IMetaclassFactory findFactory(Class<?> javaClass) {
    for (int i = factories.size() - 1; i >= 0; i--) {
      IMetaclassFactory factory = factories.get(i);
      if (factory.isFactoryOf(javaClass)) {
        return factory;
      }
    }
    return null;
  }
View Full Code Here

    }
    return convertedValue(dataContext);
  }

  private Object convertedValue(Object value) {
    IValueConverter converter = getConverter();
    if (converter != null) {
      value = converter.convert(value);
    }
    return value;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.e4.core.commands.EHandlerService

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.