use of org.eclipse.core.runtime.Status in project che by eclipse.
the class MultiStateUndoChange method isValid.
/**
* {@inheritDoc}
*/
public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
if (pm == null)
pm = new NullProgressMonitor();
//$NON-NLS-1$
pm.beginTask("", 1);
try {
if (fValidationState == null)
//$NON-NLS-1$
throw new CoreException(new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), "MultiStateUndoChange has not been initialialized"));
ITextFileBuffer buffer = FileBuffers.getTextFileBufferManager().getTextFileBuffer(fFile.getFullPath(), LocationKind.IFILE);
fDirty = buffer != null && buffer.isDirty();
return fValidationState.isValid(needsSaving(), true);
} finally {
pm.done();
}
}
use of org.eclipse.core.runtime.Status in project che by eclipse.
the class RefactoringCorePlugin method logRemovedListener.
public static void logRemovedListener(Throwable t) {
IStatus status = new Status(IStatus.ERROR, getPluginId(), IRefactoringCoreStatusCodes.INTERNAL_ERROR, RefactoringCoreMessages.RefactoringCorePlugin_listener_removed, t);
log(status);
}
use of org.eclipse.core.runtime.Status in project che by eclipse.
the class RefactoringCorePlugin method logRemovedParticipant.
public static void logRemovedParticipant(ParticipantDescriptor descriptor, Throwable t) {
IStatus status = new Status(IStatus.ERROR, getPluginId(), IRefactoringCoreStatusCodes.PARTICIPANT_DISABLED, Messages.format(RefactoringCoreMessages.RefactoringCorePlugin_participant_removed, descriptor.getId()), t);
log(status);
}
use of org.eclipse.core.runtime.Status in project che by eclipse.
the class UndoManager2 method performRedo.
public void performRedo(IValidationCheckResultQuery query, IProgressMonitor pm) throws CoreException {
IUndoableOperation redo = fOperationHistory.getRedoOperation(RefactoringCorePlugin.getUndoContext());
UndoableOperation2ChangeAdapter changeOperation = getUnwrappedOperation(redo);
if (changeOperation == null)
throw new CoreException(new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), IStatus.ERROR, RefactoringCoreMessages.UndoManager2_no_change, null));
if (query == null)
query = new NullQuery();
try {
fOperationHistory.redoOperation(redo, pm, new QueryAdapter(query));
} catch (ExecutionException e) {
handleException(e);
}
}
use of org.eclipse.core.runtime.Status in project che by eclipse.
the class UndoManager2 method performUndo.
public void performUndo(IValidationCheckResultQuery query, IProgressMonitor pm) throws CoreException {
IUndoableOperation undo = fOperationHistory.getUndoOperation(RefactoringCorePlugin.getUndoContext());
UndoableOperation2ChangeAdapter changeOperation = getUnwrappedOperation(undo);
if (changeOperation == null)
throw new CoreException(new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), IStatus.ERROR, RefactoringCoreMessages.UndoManager2_no_change, null));
if (query == null)
query = new NullQuery();
try {
fOperationHistory.undoOperation(undo, pm, new QueryAdapter(query));
} catch (ExecutionException e) {
handleException(e);
}
}
Aggregations