private void removeAllChildren() { IUndoableOperation[] nonTriggers = children.toArray(new IUndoableOperation[children.size()]); for (int i = 0; i < nonTriggers.length; i++) { children.remove(nonTriggers[i]); nonTriggers[i].dispose(); } }
private void removeAllChildren() { IUndoableOperation[] nonTriggers = children.toArray(new IUndoableOperation[children.size()]); for (IUndoableOperation nonTrigger : nonTriggers) { children.remove(nonTrigger); nonTrigger.dispose(); } }
private void removeAllChildren() { IUndoableOperation[] nonTriggers = children.toArray(new IUndoableOperation[children.size()]); for (int i = 0; i < nonTriggers.length; i++) { children.remove(nonTriggers[i]); nonTriggers[i].dispose(); } }
public void dispose() { for (final Iterator it = _stepOperations.iterator(); it.hasNext();) { IUndoableOperation op = (IUndoableOperation) it.next(); op.dispose(); } }
private void internalRemove(IUndoableOperation operation) { operation.dispose(); notifyRemoved(operation); }
private void internalRemove(IUndoableOperation operation) { operation.dispose(); notifyRemoved(operation); }
private void internalRemove(IUndoableOperation operation) { operation.dispose(); notifyRemoved(operation); }
@Override public void remove(IUndoableOperation operation) { if (operation == triggeringOperation) { // the triggering operation is being removed, so we must replace // this composite with its individual triggers. triggeringOperation = null; // save the children before replacing the operation, since this // operation will be disposed as part of replacing it. We don't want // the children to be disposed since they are to replace this // operation. List<IUndoableOperation> childrenToRestore = new ArrayList<>(children); children = new ArrayList<>(0); recomputeContexts(); operation.dispose(); // now replace the triggering operation history.replaceOperation(this, childrenToRestore.toArray(new IUndoableOperation[childrenToRestore.size()])); } else { children.remove(operation); operation.dispose(); recomputeContexts(); } }
@Override public void remove(IUndoableOperation operation) { if (operation == triggeringOperation) { // the triggering operation is being removed, so we must replace // this composite with its individual triggers. triggeringOperation = null; // save the children before replacing the operation, since this // operation will be disposed as part of replacing it. We don't want // the children to be disposed since they are to replace this // operation. List<IUndoableOperation> childrenToRestore = new ArrayList<>(children); children = new ArrayList<>(0); recomputeContexts(); operation.dispose(); // now replace the triggering operation history.replaceOperation(this, childrenToRestore.toArray(new IUndoableOperation[childrenToRestore.size()])); } else { children.remove(operation); operation.dispose(); recomputeContexts(); } }