Package org.eclipse.e4.core.contexts

Examples of org.eclipse.e4.core.contexts.IEclipseContext


  public String getDataBindMessage() {
    StringBuffer message = new StringBuffer("");
    Iterator<Element> widgetIt = widgetList.iterator();
    Set<Element> keys = bindingMap.keySet();
    while (widgetIt.hasNext()) {
      Element element = widgetIt.next();
      int parentHasError = validateParentElementError(element);
      if (parentHasError == 0) {
        String content = getCurrentWidgetPosition(element);
        if (!message.toString().equals("")) {
          content += "+ ";
        }
        content = content + element.getName();
        if (XWT.isTracking(Tracking.NAME)) {
          Attribute nameAttr = element.getAttribute("Name");
          if (nameAttr == null) {
            nameAttr = element.getAttribute(IConstants.XWT_X_NAMESPACE, "Name");
          }
          if (nameAttr != null) {
            content += " <" + nameAttr.getContent() + ">";
          }
        }
View Full Code Here


  public Control load(ILoadingContext loadingContext, InputStream stream, URL input, Map<String, Object> options) throws Exception {
    // Detect from url or file path.
    long start = System.currentTimeMillis();
    Control control = null;
    ElementManager manager = new ElementManager();
    if (input != null) {
      Element element = null;
      if (stream == null) {
        element = manager.load(input, (IBeforeParsingCallback) options.get(IXWTLoader.BEFORE_PARSING_CALLBACK));
      }
      else {
        IBeforeParsingCallback callback = (IBeforeParsingCallback) options.get(IXWTLoader.BEFORE_PARSING_CALLBACK);
        InputStream inputStream = stream;
        if (callback != null) {
          int size = stream.read();
          byte[] buffer = new byte[size];
          stream.read(buffer);
          String content = new String(buffer);
          stream.close();
          content = callback.onParsing(content);
          inputStream = new ByteArrayInputStream(content.getBytes());
          element = manager.load(stream, input);         
        }
        element = manager.load(inputStream, input);
      }
      IRenderingContext context = new ExtensionContext(loadingContext,
          manager, manager.getRootElement().getNamespace());
      Object visual = createCLRElement(context, element, options);
      if (TRACE_BENCH) {
        System.out.println("Loaded: "
            + (System.currentTimeMillis() - start) + "  "
            + input.toString());
View Full Code Here

import org.eclipse.e4.xwt.javabean.Controller;

public class JavaLanguageSupport implements ILanguageSupport {

  public IEventHandler createEventHandler() {
    return new Controller();
  }
View Full Code Here

      return ObjectToObject.instance;
    }
    if (String.class == source && target.isEnum()) {
      return new StringToEnum(target);
    }
    ValueConvertorRegister convertorRegister = (ValueConvertorRegister)
        getService(ValueConvertorRegister.class);
    if (convertorRegister == null) {
      return null;
    }
    return convertorRegister.findConverter(source, target);
  }
View Full Code Here

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

TOP

Related Classes of org.eclipse.e4.core.contexts.IEclipseContext

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.