Package org.eclipse.e4.xwt.metadata

Examples of org.eclipse.e4.xwt.metadata.IProperty


   * .conversion.IConverter)
   */
  public void registerConvertor(IConverter converter) {
    Class<?> source = (Class<?>) converter.getFromType();
    Class<?> target = (Class<?>) converter.getToType();
    ValueConvertorRegister convertorRegister = (ValueConvertorRegister)
        getService(ValueConvertorRegister.class);
    convertorRegister.register(source, target, converter);
  }
View Full Code Here


          ObservableTreeContentProvider xwtContentProvider = (ObservableTreeContentProvider) contentProvider;
          xwtContentProvider.updateContext(viewer, value);
        }
        if (contentProvider instanceof ObservableTreeContentProvider) {
          ObservableTreeContentProvider listContentProvider = (ObservableTreeContentProvider) contentProvider;
          viewer.setLabelProvider(new ObservableMapLabelProvider(
              viewer, listContentProvider.getKnownElements(),
              propertyNames));
        }
      }
      else {
        IContentProvider contentProvider = viewer.getContentProvider();
        if (value instanceof List<?> || value.getClass().isArray()) {
          if (contentProvider == null) {
            contentProvider = new ObservableListContentProvider();
            viewer.setContentProvider(contentProvider);
          }
          if (propertyNames != null && propertyNames.length > 0 && hasDefaultLabelProvider(viewer)
              && contentProvider instanceof ObservableListContentProvider) {
            ObservableListContentProvider listContentProvider = (ObservableListContentProvider) contentProvider;
            viewer.setLabelProvider(new ObservableMapLabelProvider(
                viewer, listContentProvider.getKnownElements(),
                propertyNames));
          }
        } else if (value instanceof Set<?>) {
          if (contentProvider == null) {
            contentProvider = new ObservableSetContentProvider();
            viewer.setContentProvider(contentProvider);
          }
          if (propertyNames != null && propertyNames.length > 0 && hasDefaultLabelProvider(viewer)
              && contentProvider instanceof ObservableSetContentProvider) {
            ObservableSetContentProvider setContentProvider = (ObservableSetContentProvider) contentProvider;
            viewer.setLabelProvider(new ObservableMapLabelProvider(
                viewer, setContentProvider.getKnownElements(), propertyNames));
          }
        }
      }
    }
View Full Code Here

      String[] propertyNames = JFacesHelper.getViewerProperties(viewer);
      if (target instanceof AbstractTreeViewer) {
        IContentProvider contentProvider = (IContentProvider) viewer.getContentProvider();
        if (contentProvider instanceof ObservableTreeContentProvider) {
          ObservableTreeContentProvider xwtContentProvider = (ObservableTreeContentProvider) contentProvider;
          xwtContentProvider.updateContext(viewer, value);
        }
        if (contentProvider instanceof ObservableTreeContentProvider) {
          ObservableTreeContentProvider listContentProvider = (ObservableTreeContentProvider) contentProvider;
          viewer.setLabelProvider(new ObservableMapLabelProvider(
              viewer, listContentProvider.getKnownElements(),
              propertyNames));
        }
      }
      else {
        IContentProvider contentProvider = viewer.getContentProvider();
        if (value instanceof List<?> || value.getClass().isArray()) {
          if (contentProvider == null) {
            contentProvider = new ObservableListContentProvider();
            viewer.setContentProvider(contentProvider);
          }
          if (propertyNames != null && propertyNames.length > 0 && hasDefaultLabelProvider(viewer)
              && contentProvider instanceof ObservableListContentProvider) {
            ObservableListContentProvider listContentProvider = (ObservableListContentProvider) contentProvider;
            viewer.setLabelProvider(new ObservableMapLabelProvider(
                viewer, listContentProvider.getKnownElements(),
                propertyNames));
          }
        } else if (value instanceof Set<?>) {
          if (contentProvider == null) {
            contentProvider = new ObservableSetContentProvider();
View Full Code Here

            propertyName, updateSourceTrigger, observeKind);
      }

      if (observable == null
          && dataProvider instanceof IObjectDataProvider) {
        IMetaclass mateclass = XWT.getMetaclass(type);
        IProperty property = mateclass.findProperty(propertyName);
        if (property instanceof EventProperty) {
          observable = new EventPropertyObservableValue(object,
              (EventProperty) property);
        }
      }
View Full Code Here

    IBaseLabelProvider labelProvider = viewer.getLabelProvider();
    return (labelProvider == null || labelProvider.getClass() == DefaultViewerLabelProvider.class);
  }

  protected Class<?> getElementType() {
    IProperty property = getDelegate();
    Class<?> type = property.getType();
    if (type == null) {
      return Object.class;
    }
    if (type.isArray()) {
      return type.getComponentType();
View Full Code Here

      }

      if (observable == null
          && dataProvider instanceof IObjectDataProvider) {
        IMetaclass mateclass = XWT.getMetaclass(type);
        IProperty property = mateclass.findProperty(propertyName);
        if (property instanceof EventProperty) {
          observable = new EventPropertyObservableValue(object,
              (EventProperty) property);
        }
      }
View Full Code Here

    Object oldValue = null;
    if (targetName != null) {
      setterTarget = TriggerBase.getElementByName(element, targetName);
    }
    IMetaclass metaclass = XWT.getMetaclass(setterTarget);
    IProperty prop = metaclass.findProperty(propName);
    if (prop != null && propValue != null) {
      Object toValue = XWT.convertFrom(prop.getType(), propValue);
      try {
        oldValue = prop.getValue(setterTarget);
        if (update) {
          prop.setValue(setterTarget, toValue);
        }
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
View Full Code Here

    Object setterTarget = element;
    if (targetName != null) {
      setterTarget = TriggerBase.getElementByName(element, targetName);
    }
    IMetaclass metaclass = XWT.getMetaclass(setterTarget);
    IProperty prop = metaclass.findProperty(propName);
    if (prop != null) {
      try {
        prop.setValue(setterTarget, value);
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
  }
View Full Code Here

      if (propertyElement != null) {
        String propertyName = propertyElement.toString();
        if (propertyName != null) {
          try {
            IMetaclass metaclass = XWT.getMetaclass(dataContext);
            IProperty property = metaclass.findProperty(propertyName.toLowerCase());
            if (property != null) {
              dataContext = property.getValue(dataContext);
              if (dataContext != null) {   
                Class<?> type = dataContext.getClass();
                Class<?> propertyType = property.getType();
                if (propertyType != null && !propertyType.isAssignableFrom(type)) {
                  dataContext = ObjectUtil.resolveValue(dataContext, type, propertyType, dataContext);
                }
              }
            }
View Full Code Here

    for (String name : getEventNames()) {
      if (name.equalsIgnoreCase(raisedName)) {
        continue;
      }
      String eventPropertyName = IEventConstants.getEventPropertyName(name);
      IProperty eventProperty = metaclass.findProperty(eventPropertyName);

      IObservableValue value = manager.getValue(eventProperty);
      if (value != null) {
        value.setValue(false);
      }
View Full Code Here

TOP

Related Classes of org.eclipse.e4.xwt.metadata.IProperty

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.