Package org.eclipse.e4.xwt.metadata

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


   * .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


      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

          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

  public void prepare(Object target) {
    String routedEvent = getRoutedEvent();
    if (routedEvent != null) {
      Object source = getElementByName(target, getSourceName());
      IMetaclass metaclass = XWT.getMetaclass(source);
      IEvent event = metaclass.findEvent(ModelUtils.normalizeEventName(routedEvent));
      if (event == null) {
        if (routedEvent != null && !routedEvent.toLowerCase().endsWith(IEventConstants.SUFFIX_KEY)) {
          LoggerManager.log("Event " + routedEvent + " is not found in " + source
              .getClass().getName() + ". Please add a suffix \"Event\"!");         
        }
View Full Code Here

      if (name.equalsIgnoreCase(raisedName)) {
        continue;
      }
      String eventPropertyName = IEventConstants.getEventPropertyName(name);
      String eventName = IEventConstants.getEventName(name);
      IEvent event = metaclass.findEvent(eventName);
      IProperty eventProperty = metaclass.findProperty(eventPropertyName);
     
      try {
        controller.setEvent(event, UserData.getWidget(host), manager, eventProperty, IObservableValueListener.class.getDeclaredMethod("changeValueHandle", Object.class, org.eclipse.swt.widgets.Event.class));
      } catch (Exception e) {
View Full Code Here

    if (property == null) {
      if (options.get(IXWTLoader.DESIGN_MODE_PROPERTY) == Boolean.TRUE) {
        return;
      }
      // prepare event
      IEvent event = metaclass.findEvent(attrName);
      if (event == null) {
        return;
      }
      // add events for controls and items.
      if (!(target instanceof Widget)) {
View Full Code Here

    this.property = property;
    IEventHandler controller = UserData.findEventController(observed);
    if (controller == null) {
      controller = UserData.updateEventController(observed);
    }
    IEvent event = property.getEvent();

    IObservableValueListener manager = UserData.getObservableValueManager(observed);
    if (manager == null) {
      manager = new ObservableValueManager(observed);
      UserData.setObservableValueManager(observed, manager);
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

  public IMetaclass register(Class<?> javaClass) {
    return register(javaClass, null);
  }

  public IMetaclass register(Class<?> javaClass, IMetaclass superMetaclass) {
    IMetaclass metaclass = getMetaclass(javaClass);
    if (metaclass != null) {
      return metaclass;
    }
    if (superMetaclass == null) {
      Class<?> superclass = javaClass.getSuperclass();
      if (superclass != null && superclass != Object.class) {
        register(superclass, null);
      }
      superMetaclass = getMetaclass(superclass);
    }
    IMetaclass thisMetaclass = createMetaclass(javaClass, superMetaclass);
    register(thisMetaclass);
    return thisMetaclass;
  }
View Full Code Here

TOP

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

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.