예제 #1
0
  public void removeFromStacks(UndoableGroup group) {
    if (group.getAffectedDocuments().isEmpty()) return;

    if (group.isGlobal()) {
      assert myGlobalStack.getLast() == group;
      myGlobalStack.removeLast();
    }
    for (DocumentReference each : group.getAffectedDocuments()) {
      LinkedList<UndoableGroup> stack = getStack(each);
      assert stack.getLast() == group;
      stack.removeLast();
    }
  }
예제 #2
0
  public Set<DocumentReference> collectClashingActions(UndoableGroup group) {
    Set<DocumentReference> result = new THashSet<DocumentReference>();

    for (DocumentReference each : group.getAffectedDocuments()) {
      UndoableGroup last = getStack(each).getLast();
      if (last != group) {
        result.addAll(last.getAffectedDocuments());
      }
    }

    if (group.isGlobal()) {
      UndoableGroup last = myGlobalStack.getLast();
      if (last != group) {
        result.addAll(last.getAffectedDocuments());
      }
    }

    return result;
  }
예제 #3
0
 public void collectAllAffectedDocuments(Collection<DocumentReference> result) {
   for (UndoableGroup each : myGlobalStack) {
     result.addAll(each.getAffectedDocuments());
   }
   collectLocalAffectedDocuments(result);
 }
예제 #4
0
 public void addToStacks(UndoableGroup group) {
   if (group.isGlobal()) doAddToStack(myGlobalStack, group, UndoManagerImpl.GLOBAL_UNDO_LIMIT);
   for (DocumentReference each : group.getAffectedDocuments()) {
     doAddToStack(getStack(each), group, UndoManagerImpl.LOCAL_UNDO_LIMIT);
   }
 }