Examples of ScopeKeeper


Examples of org.eclipse.e4.xwt.internal.core.ScopeKeeper

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

Examples of org.eclipse.e4.xwt.internal.core.ScopeKeeper

    }
    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

Examples of org.eclipse.e4.xwt.internal.core.ScopeKeeper

      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

Examples of org.eclipse.e4.xwt.internal.core.ScopeKeeper

        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

Examples of org.eclipse.e4.xwt.internal.core.ScopeKeeper

   * @return <code>true</code> the listener is added, <code>false</code> if
   *         the listener already exists
   */
  public boolean addObservableChangeListener(Object control,
      IChangeListener listener) {
    ScopeKeeper scope = UserData.findScopeKeeper(control);
    if (scope != null) {
      return scope.addChangeListener(listener);
    }
    return false;
  }
View Full Code Here

Examples of org.eclipse.e4.xwt.internal.core.ScopeKeeper

   * @param context
   * @param listener
   */
  public void removeObservableChangeListener(Object control,
      IChangeListener listener) {
    ScopeKeeper scope = UserData.findScopeKeeper(control);
    if (scope != null) {
      scope.removeChangeListener(listener);
    }
  }
View Full Code Here

Examples of org.eclipse.e4.xwt.internal.core.ScopeKeeper

    if (widget != null) {
      loadData.setCurrentWidget(targetObject);
    }
    if (scopedObject == null && widget != null) {
      scopedObject = widget;
      nameScoped = new ScopeKeeper((parent == null ? null : UserData
          .findScopeKeeper((Widget) parent)), widget);
      UserData.bindNameContext((Widget) widget, nameScoped);
    }

    // set first data context and resource dictionary
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.