Package org.eclipse.e4.xwt.core

Examples of org.eclipse.e4.xwt.core.Style


    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

        && target instanceof IObservableValue) {
      return bindValue((IObservableValue) source,
          (IObservableValue) target, dataBinding);
    } else if (source instanceof IObservableSet
        && target instanceof IObservableSet) {
      IValueConverter converter = null;
      int sourceToTargetPolicy = UpdateSetStrategy.POLICY_UPDATE;
      int targetToSourcePolicy = UpdateSetStrategy.POLICY_UPDATE;
      // Set policy to UpdateValueStrategy.
      if (dataBinding != null) {
        switch (dataBinding.getMode()) {
        case OneWay:
          targetToSourcePolicy = UpdateSetStrategy.POLICY_NEVER;
          break;
        case OneTime:
          sourceToTargetPolicy = UpdateSetStrategy.POLICY_NEVER;
          targetToSourcePolicy = UpdateSetStrategy.POLICY_NEVER;
          break;
        default:
          break;
        }
        converter = dataBinding.getConverter();
      }
      UpdateSetStrategy sourceToTarget = new UpdateSetStrategy(
          sourceToTargetPolicy);
      UpdateSetStrategy targetToSource = new UpdateSetStrategy(
          targetToSourcePolicy);
      return bindSet((IObservableSet) target, (IObservableSet) source,
          targetToSource, sourceToTarget, converter);
    } else if (source instanceof IObservableList
        && target instanceof IObservableList) {
      IValueConverter converter = null;
      int sourceToTargetPolicy = UpdateListStrategy.POLICY_UPDATE;
      int targetToSourcePolicy = UpdateListStrategy.POLICY_UPDATE;
      // Set policy to UpdateValueStrategy.
      if (dataBinding != null) {
        switch (dataBinding.getMode()) {
View Full Code Here

   * databinding.observable.value.IObservableValue,
   * org.eclipse.core.databinding.observable.value.IObservableValue)
   */
  private Binding bindValue(IObservableValue source, IObservableValue target,
      IDataBindingInfo dataBinding) {
    IValueConverter converter = null;
    IValidationRule[] validators = null;
    int sourceToTargetPolicy = UpdateValueStrategy.POLICY_UPDATE;
    int targetToSourcePolicy = UpdateValueStrategy.POLICY_UPDATE;
    // Set policy to UpdateValueStrategy.
    if (dataBinding != null) {
View Full Code Here

  public Binding bindList(IObservableList source, IObservableList target,
      UpdateListStrategy sourceToTarget,
      UpdateListStrategy targetToSource, IValueConverter converter) {
    if (converter != null) {
      return bindList(source, target, sourceToTarget, targetToSource,
          converter, new InverseValueConverter(converter));
    } else {
      return bindList(source, target, sourceToTarget, targetToSource,
          null, null);
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.e4.xwt.core.Style

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.