Пример #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);
   }
 }