本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}