Package org.eclipse.e4.xwt.converters

Examples of org.eclipse.e4.xwt.converters.SetToIObservableCollection


   */
  public static Widget findRootWidget(Object element) {
    Widget root = null;
    Widget current = getWidget(element);
    while (current != null) {
      ScopeKeeper scopeKeeper = findScopeKeeper(current);
      if (scopeKeeper != null) {
        root = current;
      }
      current = getTreeParent(current);
    }
View Full Code Here


    }
    return control;
  }

  public static ScopeKeeper findScopeKeeper(Object element) {
    ScopeKeeper scopeKeeper = getLocalScopeKeeper(element);
    if (scopeKeeper != null) {
      return scopeKeeper;
    }
    Widget parent = getTreeParent(element);
    if (parent != null) {
View Full Code Here

      return null;
    }
    UserData dataDictionary = (UserData) widget
        .getData(IUserDataConstants.XWT_USER_DATA_KEY);
    if (dataDictionary != null) {
      ScopeKeeper nameContext = (ScopeKeeper) dataDictionary
          .getData(IUserDataConstants.XWT_NAMECONTEXT_KEY);
      if (nameContext != null) {
        Object element = nameContext.getNamedObject(name);
        if (element != null) {
          return element;
        }
      }
    }
View Full Code Here

        IUserDataConstants.XWT_RESOURCES_KEY);
  }

  public static void setObjectName(Object object, String name) {
    Widget widget = getWidget(object);
    ScopeKeeper nameScoped;
    if (UserData.findElementByName(widget, name) != null) {
      // throw an exception or log a message?
      return;
    }
    Widget parent = UserData.getTreeParent(widget);
    UserData dataDictionary = (UserData) parent
        .getData(IUserDataConstants.XWT_USER_DATA_KEY);
    if (dataDictionary != null) {
      if (dataDictionary.getData(IUserDataConstants.XWT_NAMECONTEXT_KEY) != null) {
        nameScoped = (ScopeKeeper) dataDictionary
            .getData(IUserDataConstants.XWT_NAMECONTEXT_KEY);
      } else {
        ScopeKeeper parentNameScope = findScopeKeeper(parent);
        nameScoped = new ScopeKeeper(parentNameScope, widget);
        bindNameContext(parent, nameScoped);
      }
      nameScoped.addNamedObject(name, widget);
    }
    // throw an exception or log a message?
View Full Code Here

  protected void autoLayout(Composite composite, Element element) {
    if (element == null) {
      return;
    }
    Attribute bounds = element.getAttribute("bounds");
    if (bounds == null) {
      bounds = element.getAttribute("bounds", IConstants.XWT_NAMESPACE);
    }
    Attribute size = element.getAttribute("size");
    if (size == null) {
      size = element.getAttribute("size", IConstants.XWT_NAMESPACE);
    }
    if (bounds == null && size == null) {
      composite.pack();
View Full Code Here

        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() + ">";
          }
        }
        message.append(content);
        if (XWT.isTracking(Tracking.DATABINDING)) {
          if (keys.contains(element)) {
View Full Code Here

    String bindingMessage = "";
    if (swtObject instanceof Binding) {
      String error = "";
      Binding newInstance = (Binding) swtObject;
      String path = null;
      Attribute attr = element.getAttribute("Path");
      if (null == attr)
        attr = element.getAttribute("path");
      if (null != attr)
        path = attr.getContent();
      Object dataContext2 = null;
      try {
        dataContext2 = newInstance.getValue(null);
        if (path != null && path.length() > 0) {
          String[] paths = path.trim().split("\\.");
View Full Code Here

    // 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);
View Full Code Here

  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

TOP

Related Classes of org.eclipse.e4.xwt.converters.SetToIObservableCollection

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.