本文整理汇总了Java中org.eclipse.core.commands.operations.IUndoableOperation.dispose方法的典型用法代码示例。如果您正苦于以下问题:Java IUndoableOperation.dispose方法的具体用法?Java IUndoableOperation.dispose怎么用?Java IUndoableOperation.dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.commands.operations.IUndoableOperation
的用法示例。
在下文中一共展示了IUndoableOperation.dispose方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateEnablement
import org.eclipse.core.commands.operations.IUndoableOperation; //导入方法依赖的package包/类
public void updateEnablement() {
IUndoableOperation operation = getOperation(null);
if (operation != null) {
boolean canExecute = operation.canExecute();
setEnabled(canExecute);
operation.dispose();
} else {
setEnabled(false);
}
}
示例2: add
import org.eclipse.core.commands.operations.IUndoableOperation; //导入方法依赖的package包/类
@Override
public void add(IUndoableOperation operation) {
Assert.isNotNull(operation);
/*
* If we are in the middle of executing an open batching operation, and
* this is not that operation, then we need only add the context of the
* new operation to the batch. The operation itself is disposed since we
* will never undo or redo it. We consider it to be triggered by the
* batching operation and assume that its undo will be triggered by the
* batching operation undo.
*/
synchronized (openCompositeLock) {
if (openComposite != null && openComposite != operation) {
openComposite.add(operation);
return;
}
}
if (checkUndoLimit(operation)) {
synchronized (undoRedoHistoryLock) {
undoList.add(operation);
}
notifyAdd(operation);
// flush redo stack for related contexts
IUndoContext[] contexts = operation.getContexts();
for (int i = 0; i < contexts.length; i++) {
flushRedo(contexts[i]);
}
} else {
// Dispose the operation since we will not have a reference to it.
operation.dispose();
}
}
示例3: internalRemove
import org.eclipse.core.commands.operations.IUndoableOperation; //导入方法依赖的package包/类
private void internalRemove(IUndoableOperation operation) {
operation.dispose();
notifyRemoved(operation);
}
示例4: dispose
import org.eclipse.core.commands.operations.IUndoableOperation; //导入方法依赖的package包/类
@Override
public void dispose() {
for (IUndoableOperation operation : operationList) {
operation.dispose();
}
}