Package org.eclipse.core.databinding.observable.list

Examples of org.eclipse.core.databinding.observable.list.ListDiff


   * @return the differences between oldList and newList
   */
  public static ListDiff computeListDiff(List oldList, List newList) {
    List diffEntries = new ArrayList();
    createListDiffs(new ArrayList(oldList), newList, diffEntries);
    ListDiff listDiff = createListDiff((ListDiffEntry[]) diffEntries
        .toArray(new ListDiffEntry[diffEntries.size()]));
    return listDiff;
  }
View Full Code Here


  /**
   * @param differences
   * @return a list diff with the given entries
   */
  public static ListDiff createListDiff(final ListDiffEntry[] differences) {
    return new ListDiff() {
      public ListDiffEntry[] getDifferences() {
        return differences;
      }
    };
  }
View Full Code Here

  public void updateModelToTarget() {
    final IObservableList modelList = (IObservableList) getModel();
    modelList.getRealm().exec(new Runnable() {
      public void run() {
        ListDiff diff = Diffs.computeListDiff(Collections.EMPTY_LIST,
            modelList);
        doUpdate(modelList, (IObservableList) getTarget(), diff,
            modelToTarget, true, true);
      }
    });
View Full Code Here

  public void updateTargetToModel() {
    final IObservableList targetList = (IObservableList) getTarget();
    targetList.getRealm().exec(new Runnable() {
      public void run() {
        ListDiff diff = Diffs.computeListDiff(Collections.EMPTY_LIST,
            targetList);
        doUpdate(targetList, (IObservableList) getModel(), diff,
            targetToModel, true, true);
      }
    });
View Full Code Here

TOP

Related Classes of org.eclipse.core.databinding.observable.list.ListDiff

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.