Package org.eclipse.core.databinding.observable.set

Examples of org.eclipse.core.databinding.observable.set.SetDiff


  public void updateModelToTarget() {
    final IObservableSet modelSet = (IObservableSet) getModel();
    modelSet.getRealm().exec(new Runnable() {
      public void run() {
        SetDiff diff = Diffs.computeSetDiff(Collections.EMPTY_SET,
            modelSet);
        doUpdate(modelSet, (IObservableSet) getTarget(), diff,
            modelToTarget, true, true);
      }
    });
View Full Code Here


  public void updateTargetToModel() {
    final IObservableSet targetSet = (IObservableSet) getTarget();
    targetSet.getRealm().exec(new Runnable() {
      public void run() {
        SetDiff diff = Diffs.computeSetDiff(Collections.EMPTY_SET,
            targetSet);
        doUpdate(targetSet, (IObservableSet) getModel(), diff,
            targetToModel, true, true);
      }
    });
View Full Code Here

   * @return a lazily computed {@link SetDiff} describing the change between
   *         the specified old and new set states.
   * @since 1.3
   */
  public static SetDiff computeLazySetDiff(final Set oldSet, final Set newSet) {
    return new SetDiff() {

      private SetDiff lazyDiff;

      private SetDiff getLazyDiff() {
        if (lazyDiff == null) {
View Full Code Here

   */
  public static SetDiff createSetDiff(Set additions, Set removals) {
    final Set unmodifiableAdditions = Collections
        .unmodifiableSet(additions);
    final Set unmodifiableRemovals = Collections.unmodifiableSet(removals);
    return new SetDiff() {

      public Set getAdditions() {
        return unmodifiableAdditions;
      }

View Full Code Here

    Set set = getSet();
    if (set.contains(o))
      return false;

    SetDiff diff = Diffs.createSetDiff(Collections.singleton(o),
        Collections.EMPTY_SET);
    updateSet(set, diff);

    return true;
  }
View Full Code Here

      public void remove() {
        checkRealm();
        checkForComodification();

        SetDiff diff = Diffs.createSetDiff(Collections.EMPTY_SET,
            Collections.singleton(last));
        updateSet(set, diff);

        iterator.remove(); // stay in sync
View Full Code Here

    Set set = getSet();
    if (!set.contains(o))
      return false;

    SetDiff diff = Diffs.createSetDiff(Collections.EMPTY_SET, Collections
        .singleton(o));
    updateSet(set, diff);

    return true;
  }
View Full Code Here

    additions.removeAll(set);

    if (additions.isEmpty())
      return false;

    SetDiff diff = Diffs.createSetDiff(additions, Collections.EMPTY_SET);
    updateSet(set, diff);

    return true;
  }
View Full Code Here

    removals.retainAll(set);

    if (removals.isEmpty())
      return false;

    SetDiff diff = Diffs.createSetDiff(Collections.EMPTY_SET, removals);
    updateSet(set, diff);

    return true;
  }
View Full Code Here

    removals.removeAll(c);

    if (removals.isEmpty())
      return false;

    SetDiff diff = Diffs.createSetDiff(Collections.EMPTY_SET, removals);
    updateSet(set, diff);

    return true;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.databinding.observable.set.SetDiff

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.