Package org.eclipse.core.internal.databinding.identity

Examples of org.eclipse.core.internal.databinding.identity.IdentitySet


   * @noreference This method is not intended to be referenced by clients.
   */
  protected Set doGetSet(Object source) {
    IObservableSet observable = observe(source);
    try {
      return new IdentitySet(observable);
    } finally {
      observable.dispose();
    }
  }
View Full Code Here


    unhookListeners();
  }

  private void hookListeners() {
    if (keySet != null) {
      knownKeys = new IdentitySet();
      keySet.addSetChangeListener(setChangeListener);
      keySet.addStaleListener(staleListener);
      for (Iterator it = this.keySet.iterator(); it.hasNext();) {
        Object key = it.next();
        hookListener(key);
View Full Code Here

        .get();
    IStaleListener lastStaleListener = (IStaleListener) currentStaleListener
        .get();
    Integer lastIgnore = (Integer) currentIgnoreCount.get();

    Set observableSet = new IdentitySet();
    // Push the new listeners to the top of the stack
    currentGetterCalledSet.set(observableSet);
    currentChangeListener.set(changeListener);
    currentStaleListener.set(staleListener);
    currentIgnoreCount.set(null);
    try {
      runnable.run();
    } finally {
      // Pop the new listener off the top of the stack (by restoring the
      // previous listener)
      currentGetterCalledSet.set(lastObservableSet);
      currentChangeListener.set(lastChangeListener);
      currentStaleListener.set(lastStaleListener);
      checkUnmatchedIgnore(runnable);
      currentIgnoreCount.set(lastIgnore);
    }

    return (IObservable[]) observableSet
        .toArray(new IObservable[observableSet.size()]);
  }
View Full Code Here

   */
  public static IObservable[] runAndCollect(Runnable runnable) {
    Set lastObservableCreatedSet = (Set) currentObservableCreatedSet.get();
    Integer lastIgnore = (Integer) currentIgnoreCount.get();

    Set observableSet = new IdentitySet();
    // Push the new listeners to the top of the stack
    currentObservableCreatedSet.set(observableSet);
    currentIgnoreCount.set(null);
    try {
      runnable.run();
    } finally {
      // Pop the new listener off the top of the stack (by restoring the
      // previous listener)
      currentObservableCreatedSet.set(lastObservableCreatedSet);
      checkUnmatchedIgnore(runnable);
      currentIgnoreCount.set(lastIgnore);
    }

    return (IObservable[]) observableSet
        .toArray(new IObservable[observableSet.size()]);
  }
View Full Code Here

              }
            }
          });
    }
    cachedValues = new IdentityMap();
    staleKeys = new IdentitySet();
    super.firstListenerAdded();
  }
View Full Code Here

    } finally {
      ObservableTracker.setIgnore(false);
    }

    cachedValues = new IdentityMap();
    staleElements = new IdentitySet();
    knownMasterElements.addSetChangeListener(new ISetChangeListener() {
      public void handleSetChange(SetChangeEvent event) {
        for (Iterator it = event.diff.getRemovals().iterator(); it
            .hasNext();) {
          Object key = it.next();
View Full Code Here

    } finally {
      ObservableTracker.setIgnore(false);
    }

    cachedValues = new IdentityMap();
    staleMasterValues = new IdentitySet();
    knownMasterValues.addSetChangeListener(new ISetChangeListener() {
      public void handleSetChange(SetChangeEvent event) {
        for (Iterator it = event.diff.getRemovals().iterator(); it
            .hasNext();) {
          Object key = it.next();
View Full Code Here

      }
    }
  }

  private Set keysFor(Object value) {
    Set keys = new IdentitySet();

    for (Iterator it = masterMap.entrySet().iterator(); it.hasNext();) {
      Map.Entry entry = (Entry) it.next();
      if (entry.getValue() == value) {
        keys.add(entry.getKey());
      }
    }

    return keys;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.internal.databinding.identity.IdentitySet

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.