Package org.eclipse.e4.xwt.jface

Examples of org.eclipse.e4.xwt.jface.ObservableTreeContentProvider


  public void registerService(Class<?> serviceType, Object service) {
    registrations.put(serviceType, service);
  }

  protected Object createCLRElement(IRenderingContext context, Element element, Map<String, Object> options) {
    IVisualElementLoader loader = findElementLoader(element);
    if (loader != null) {
      return loader.createCLRElement(element, options);
    }
    loader = createElementLoader(context, element);
    Object visualObject = loader.createCLRElement(element, options);
    removeElementLoader(element);
    return visualObject;
  }
View Full Code Here


    removeElementLoader(element);
    return visualObject;
  }

  protected IVisualElementLoader findElementLoader(DocumentObject element) {
    IVisualElementLoader loader = elementsLoaders.get(element);
    if (loader != null) {
      return loader;
    }
    if (element.getParent() != null) {
      return findElementLoader(element.getParent());
View Full Code Here

    }
    return null;
  }

  protected IVisualElementLoader createElementLoader(IRenderingContext context, DocumentObject element) {
    IVisualElementLoader creator = loaderFactory.createElementLoader(context, xwtLoader);
    elementsLoaders.put(element, creator);
    return creator;
  }
View Full Code Here

  public void setValue(Object target, Object value) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchFieldException {
    if (!(value instanceof Style)) {
      throw new XWTException("Style is expected.");
    }
    Style style = (Style) value;
    style.apply(target);
  }
View Full Code Here

              + bindings[i].getPath());
          return null;
        }
      }

      observableValue = new AggregateObservableValue(values,
          getConverter());
    }

    IObservableValue observableWidget = getObservableWidget();
View Full Code Here

  @Override
  protected Control createDialogArea(Composite parent) {
    Control control = super.createDialogArea(parent);

    if (bindingContext == null) {
      bindingContext = new BindingContext(parent);
    }
    validationStatus = bindingContext.getStatus();
    validationStatus.addChangeListener(new IChangeListener() {
      public void handleChange(ChangeEvent event) {
        IStatus status = (IStatus) validationStatus.getValue();
        setMessage(status.getMessage(), status.getSeverity());
      }
    });

    ClassLoader classLoader = Thread.currentThread()
        .getContextClassLoader();
    try {
      Thread.currentThread().setContextClassLoader(
          contentCLS.getClassLoader());
      HashMap<String, Object> newOptions = new HashMap<String, Object>();
      newOptions.put(XWTLoader.CONTAINER_PROPERTY, parent);
      Object dataContext = getDataContext();
      if (dataContext != null) {
        newOptions.put(XWTLoader.DATACONTEXT_PROPERTY, dataContext);
      }
      BindingContext bindingContext = getBindingContext();
      if (bindingContext != null) {
        newOptions.put(XWTLoader.BINDING_CONTEXT_PROPERTY,
            bindingContext);
      }
      newOptions.put(XWTLoader.CLASS_PROPERTY, contentCLS);
View Full Code Here

    IDataProvider dataProvider = getDataProvider(dataContext);

    try {
      if (isSourceControl()) {
        ControlDataBinding controlDataBinding = new ControlDataBinding(
            dataContext, this, dataProvider);
        return controlDataBinding.getValue(targetType);
      }
    } catch (XWTException e) {
      // in case the property cannot be bound. return value
    }
View Full Code Here

      }
    } catch (XWTException e) {
      // in case the property cannot be bound. return value
    }

    DataBinding dataBinding = null;
    if (dataProvider != null
        && (path != null || dataContext instanceof IObservable)) {
      dataBinding = new DataBinding(this, dataProvider);
    }
    if (dataBinding != null) {
      return dataBinding.getValue(targetType);
    }
    return convertedValue(dataContext);
  }
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);
        }
      }

      if (observable != null) {
View Full Code Here

    return observableValue;
  }

  private BindingGate getBindingGate() {
    if (this.bindingGate == null) {
      IBindingContext dataBindingContext = XWT
          .getBindingContext(getControl());
      this.bindingGate = new BindingGate(dataBindingContext);
    }

    return this.bindingGate;
View Full Code Here

TOP

Related Classes of org.eclipse.e4.xwt.jface.ObservableTreeContentProvider

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.