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(); } }
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; }
public void collectAllAffectedDocuments(Collection<DocumentReference> result) { for (UndoableGroup each : myGlobalStack) { result.addAll(each.getAffectedDocuments()); } collectLocalAffectedDocuments(result); }
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); } }