当前位置: 首页>>代码示例>>Java>>正文


Java IUndoableOperation.dispose方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:11,代码来源:AbstractUndoableOperationAction.java

示例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();
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:36,代码来源:DefaultOperationHistory.java

示例3: internalRemove

import org.eclipse.core.commands.operations.IUndoableOperation; //导入方法依赖的package包/类
private void internalRemove(IUndoableOperation operation) {
	operation.dispose();
	notifyRemoved(operation);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:5,代码来源:DefaultOperationHistory.java

示例4: dispose

import org.eclipse.core.commands.operations.IUndoableOperation; //导入方法依赖的package包/类
@Override
public void dispose() {
	for (IUndoableOperation operation : operationList) {
		operation.dispose();
	}			
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:7,代码来源:CompositeOperation.java


注:本文中的org.eclipse.core.commands.operations.IUndoableOperation.dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。