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


Java IOperationHistory.OPERATION_INVALID_STATUS属性代码示例

本文整理汇总了Java中org.eclipse.core.commands.operations.IOperationHistory.OPERATION_INVALID_STATUS属性的典型用法代码示例。如果您正苦于以下问题:Java IOperationHistory.OPERATION_INVALID_STATUS属性的具体用法?Java IOperationHistory.OPERATION_INVALID_STATUS怎么用?Java IOperationHistory.OPERATION_INVALID_STATUS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.core.commands.operations.IOperationHistory的用法示例。


在下文中一共展示了IOperationHistory.OPERATION_INVALID_STATUS属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: redo

@Override
public IStatus redo(IUndoContext context, IProgressMonitor monitor,
		IAdaptable info) throws ExecutionException {
	Assert.isNotNull(context);
	IUndoableOperation operation = getRedoOperation(context);

	// info if there is no operation
	if (operation == null) {
		return IOperationHistory.NOTHING_TO_REDO_STATUS;
	}

	// error if operation is invalid
	if (!operation.canRedo()) {
		if (DEBUG_OPERATION_HISTORY_UNEXPECTED) {
			Tracing.printTrace("OPERATIONHISTORY", //$NON-NLS-1$
					"Redo operation not valid - " + operation); //$NON-NLS-1$
		}

		return IOperationHistory.OPERATION_INVALID_STATUS;
	}

	return doRedo(monitor, info, operation);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:23,代码来源:DefaultOperationHistory.java

示例2: redoOperation

@Override
public IStatus redoOperation(IUndoableOperation operation,
		IProgressMonitor monitor, IAdaptable info)
		throws ExecutionException {
	Assert.isNotNull(operation);
	IStatus status;
	if (operation.canRedo()) {
		status = doRedo(monitor, info, operation);
	} else {
		if (DEBUG_OPERATION_HISTORY_UNEXPECTED) {
			Tracing.printTrace("OPERATIONHISTORY", //$NON-NLS-1$
					"Redo operation not valid - " + operation); //$NON-NLS-1$
		}
		status = IOperationHistory.OPERATION_INVALID_STATUS;
	}
	return status;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:17,代码来源:DefaultOperationHistory.java

示例3: undo

@Override
public IStatus undo(IUndoContext context, IProgressMonitor monitor,
		IAdaptable info) throws ExecutionException {
	Assert.isNotNull(context);
	IUndoableOperation operation = getUndoOperation(context);

	// info if there is no operation
	if (operation == null) {
		return IOperationHistory.NOTHING_TO_UNDO_STATUS;
	}

	// error if operation is invalid
	if (!operation.canUndo()) {
		if (DEBUG_OPERATION_HISTORY_UNEXPECTED) {
			Tracing.printTrace("OPERATIONHISTORY", //$NON-NLS-1$
					"Undo operation not valid - " + operation); //$NON-NLS-1$
		}
		return IOperationHistory.OPERATION_INVALID_STATUS;
	}

	return doUndo(monitor, info, operation);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:22,代码来源:DefaultOperationHistory.java

示例4: undoOperation

@Override
public IStatus undoOperation(IUndoableOperation operation,
		IProgressMonitor monitor, IAdaptable info)
		throws ExecutionException {
	Assert.isNotNull(operation);
	IStatus status;
	if (operation.canUndo()) {
		status = doUndo(monitor, info, operation);
	} else {
		if (DEBUG_OPERATION_HISTORY_UNEXPECTED) {
			Tracing.printTrace("OPERATIONHISTORY", //$NON-NLS-1$
					"Undo operation not valid - " + operation); //$NON-NLS-1$
		}
		status = IOperationHistory.OPERATION_INVALID_STATUS;
	}
	return status;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:17,代码来源:DefaultOperationHistory.java

示例5: execute

@Override
public IStatus execute(IUndoableOperation operation,
		IProgressMonitor monitor, IAdaptable info)
		throws ExecutionException {
	Assert.isNotNull(operation);

	// error if operation is invalid
	if (!operation.canExecute()) {
		return IOperationHistory.OPERATION_INVALID_STATUS;
	}

	return doExecute(monitor, info, operation);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:13,代码来源:DefaultOperationHistory.java

示例6: undo

@Override
public IStatus undo(final IUndoContext context, final IProgressMonitor operationMonitor, final IAdaptable info) throws ExecutionException {
	if (!isJobContext(context)) {
		return super.undo(context, operationMonitor, info);
	}
	OperationJob job = new OperationJob(context, "undo") {
		@Override
		protected IStatus run(IProgressMonitor jobMonitor) {
			IUndoableOperation operation = getUndoOperation(context);
			// info if there is no operation
			if (operation == null) {
				return IOperationHistory.NOTHING_TO_UNDO_STATUS;
			}
			// error if operation is invalid
			if (!operation.canUndo()) {
				if (DEBUG_OPERATION_HISTORY_UNEXPECTED) {
					Tracing.printTrace("OPERATIONHISTORY", //$NON-NLS-1$
							"Undo operation not valid - " + operation); //$NON-NLS-1$
				}
				return IOperationHistory.OPERATION_INVALID_STATUS;
			}
			setName("undo " + operation.getLabel());
			IProgressMonitor monitor = DoubleProgressMonitor.combine(operationMonitor, jobMonitor);
			return inJobEnforceRule(info, monitor, operation, true);
		}
	};
	job.schedule();
	return new JobOperationStatus(job);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:29,代码来源:JobOperationHistory.java

示例7: redo

@Override
public IStatus redo(final IUndoContext context, final IProgressMonitor operationMonitor, final IAdaptable info) throws ExecutionException {
	if (!isJobContext(context)) {
		return super.redo(context, operationMonitor, info);
	}
	OperationJob job = new OperationJob(context, "redo") {
		@Override
		protected IStatus run(IProgressMonitor jobMonitor) {
			IUndoableOperation operation = getRedoOperation(context);
			// info if there is no operation
			if (operation == null) {
				return IOperationHistory.NOTHING_TO_REDO_STATUS;
			}
			// error if operation is invalid
			if (!operation.canRedo()) {
				if (DEBUG_OPERATION_HISTORY_UNEXPECTED) {
					Tracing.printTrace("OPERATIONHISTORY", //$NON-NLS-1$
							"Redo operation not valid - " + operation); //$NON-NLS-1$
				}
				return IOperationHistory.OPERATION_INVALID_STATUS;
			}
			setName("redo " + operation.getLabel());
			IProgressMonitor monitor = DoubleProgressMonitor.combine(operationMonitor, jobMonitor);
			return inJobEnforceRule(info, monitor, operation, false);
		}
	};
	job.schedule();
	return new JobOperationStatus(job);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:29,代码来源:JobOperationHistory.java


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