Bug 128117 [Undo/Redo] Context not removed from TriggeredOperations
When I add a context to a TriggeredOperations using #addContext(IUndoContext), I cannot remove the same context using #removeContext(IUndoContext). This is because TriggeredOperations overrides #removeContext(IUndoContext) and only considers removing the context from its triggering operation or its children, but not from its own list of contexts. In my case, I have an editor that adds its undo context to operations that it wants to be able to present in its undo menu. When the editor closes, it flushes its undo context from the history. However, if the operation is a TriggeredOperations, the editor undo context is not removed, and the operation will never be flushed from the history.
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/TriggeredOperations.java
* is being removed, then the triggering operation must be replaced in the
	 * operation history with the atomic operations that it triggered.  If the context
	 * being removed is not the only context for the triggering operation, the
	 * triggering operation will remain, and the children will each be similarly 
	 * checked.
	 * 
	 * @param context 
	 *            the undo context being removed from the receiver.
	 */
	public void removeContext(IUndoContext context) {
		
		
		
		if (triggeringOperation != null && triggeringOperation.hasContext(context)) {
			if (triggeringOperation.getContexts().length == 1) {
				remove(triggeringOperation);
				return;
			}
			triggeringOperation.removeContext(context);
			recomputeContexts();
		}
		
		ArrayList toBeRemoved = new ArrayList();
		for (int i = 0; i < children.size(); i++) {
			IUndoableOperation child = (IUndoableOperation) children.get(i);
			if (child.hasContext(context)) {
				if (child.getContexts().length == 1) {
					toBeRemoved.add(child);
				} else {
					child.removeContext(context);