@Override public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException, OperationCanceledException { return delegate.isValid(pm); }
/** * {@inheritDoc} * <p> * The composite change sends <code>isValid</code> to all its children * until the first one returns a status with a severity of <code>FATAL * </code>. If one of the children throws an exception the remaining children * will not receive the <code>isValid</code> call. * </p> * <p> * Client are allowed to extend this method. * </p> */ public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException { RefactoringStatus result= new RefactoringStatus(); pm.beginTask("", fChanges.size()); //$NON-NLS-1$ for (Iterator iter= fChanges.iterator(); iter.hasNext() && !result.hasFatalError();) { Change change= (Change)iter.next(); if (change.isEnabled()) result.merge(change.isValid(new SubProgressMonitor(pm, 1))); else pm.worked(1); if (pm.isCanceled()) throw new OperationCanceledException(); } pm.done(); return result; }
private void performSourceRestore(IProgressMonitor monitor) throws CoreException { monitor.beginTask(RefactoringCoreMessages.MoveResourceChange_progress_restore_source, 3); try { fRestoreSourceChange.initializeValidationData(new SubProgressMonitor(monitor, 1)); RefactoringStatus restoreStatus= fRestoreSourceChange.isValid(new SubProgressMonitor(monitor, 1)); if (!restoreStatus.hasFatalError()) { fRestoreSourceChange.perform(new SubProgressMonitor(monitor, 1)); } } finally { monitor.done(); } }
/** * {@inheritDoc} * <p> * The composite change sends <code>isValid</code> to all its children * until the first one returns a status with a severity of <code>FATAL * </code>. If one of the children throws an exception the remaining children * will not receive the <code>isValid</code> call. * </p> * <p> * Client are allowed to extend this method. * </p> */ @Override public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException { RefactoringStatus result= new RefactoringStatus(); pm.beginTask("", fChanges.size()); //$NON-NLS-1$ for (Iterator<Change> iter= fChanges.iterator(); iter.hasNext() && !result.hasFatalError();) { Change change= iter.next(); if (change.isEnabled()) result.merge(change.isValid(new SubProgressMonitor(pm, 1))); else pm.worked(1); if (pm.isCanceled()) throw new OperationCanceledException(); } pm.done(); return result; }
/** * {@inheritDoc} * <p> * The composite change sends <code>isValid</code> to all its children * until the first one returns a status with a severity of <code>FATAL * </code>. If one of the children throws an exception the remaining children * will not receive the <code>isValid</code> call. * </p> * <p> * Client are allowed to extend this method. * </p> */ @Override public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException { RefactoringStatus result= new RefactoringStatus(); pm.beginTask("", fChanges.size()); //$NON-NLS-1$ for (Iterator<Change> iter= fChanges.iterator(); iter.hasNext() && !result.hasFatalError();) { Change change= iter.next(); if (change.isEnabled()) result.merge(change.isValid(new SubProgressMonitor(pm, 1))); else pm.worked(1); if (pm.isCanceled()) throw new OperationCanceledException(); } pm.done(); return result; }
private void performSourceRestore(IProgressMonitor monitor) throws CoreException { monitor.beginTask(RefactoringCoreMessages.MoveResourceChange_progress_restore_source, 3); try { fRestoreSourceChange.initializeValidationData(new SubProgressMonitor(monitor, 1)); RefactoringStatus restoreStatus= fRestoreSourceChange.isValid(new SubProgressMonitor(monitor, 1)); if (!restoreStatus.hasFatalError()) { fRestoreSourceChange.perform(new SubProgressMonitor(monitor, 1)); } } finally { monitor.done(); } }
@Override public IStatus computeUndoableStatus(IProgressMonitor monitor) throws ExecutionException { if (fUndoChange == null) return new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), IStatus.ERROR, RefactoringCoreMessages.UndoableOperation2ChangeAdapter_no_undo_available, null); try { if (monitor == null) monitor= new NullProgressMonitor(); RefactoringStatus status= fUndoChange.isValid(monitor); if (status.hasFatalError()) { // The operation can no longer be undo. fUndoChange= null; clearActiveChange(); return asStatus(status); } else { // return OK in all other cases. This by passes the dialog shown // in the operation approver and allows refactoring to show its // own dialog again inside the runnable. return Status.OK_STATUS; } } catch (CoreException e) { throw new ExecutionException(e.getStatus().getMessage(), e); } }
public IStatus computeUndoableStatus(IProgressMonitor monitor) throws ExecutionException { if (fUndoChange == null) return new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), IStatus.ERROR, RefactoringCoreMessages.UndoableOperation2ChangeAdapter_no_undo_available, null); try { if (monitor == null) monitor= new NullProgressMonitor(); RefactoringStatus status= fUndoChange.isValid(monitor); if (status.hasFatalError()) { // The operation can no longer be undo. fUndoChange= null; clearActiveChange(); return asStatus(status); } else { // return OK in all other cases. This by passes the dialog shown // in the operation approver and allows refactoring to show its // own dialog again inside the runnable. return new Status(IStatus.OK, RefactoringCorePlugin.getPluginId(), IStatus.OK, "", null); //$NON-NLS-1$ } } catch (CoreException e) { throw new ExecutionException(e.getStatus().getMessage(), e); } }
public IStatus computeRedoableStatus(IProgressMonitor monitor) throws ExecutionException { if (fRedoChange == null) return new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), IStatus.ERROR, RefactoringCoreMessages.UndoableOperation2ChangeAdapter_no_redo_available, null); try { if (monitor == null) monitor= new NullProgressMonitor(); RefactoringStatus status= fRedoChange.isValid(monitor); if (status.hasFatalError()) { // The operation can no longer be redone. fRedoChange= null; clearActiveChange(); return asStatus(status); } else { // return OK in all other cases. This by passes the dialog shown // in the operation approver and allows refactoring to show its // own dialog again inside the runnable. return new Status(IStatus.OK, RefactoringCorePlugin.getPluginId(), IStatus.OK, "", null); //$NON-NLS-1$ } } catch (CoreException e) { throw new ExecutionException(e.getStatus().getMessage(), e); } }
@Override public IStatus computeRedoableStatus(IProgressMonitor monitor) throws ExecutionException { if (fRedoChange == null) return new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), IStatus.ERROR, RefactoringCoreMessages.UndoableOperation2ChangeAdapter_no_redo_available, null); try { if (monitor == null) monitor= new NullProgressMonitor(); RefactoringStatus status= fRedoChange.isValid(monitor); if (status.hasFatalError()) { // The operation can no longer be redone. fRedoChange= null; clearActiveChange(); return asStatus(status); } else { // return OK in all other cases. This by passes the dialog shown // in the operation approver and allows refactoring to show its // own dialog again inside the runnable. return Status.OK_STATUS; } } catch (CoreException e) { throw new ExecutionException(e.getStatus().getMessage(), e); } }
@Override public IStatus computeRedoableStatus(IProgressMonitor monitor) throws ExecutionException { if (fRedoChange == null) return new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), IStatus.ERROR, RefactoringCoreMessages.UndoableOperation2ChangeAdapter_no_redo_available, null); try { if (monitor == null) monitor= new NullProgressMonitor(); RefactoringStatus status= fRedoChange.isValid(monitor); if (status.hasFatalError()) { // The operation can no longer be redone. fRedoChange= null; clearActiveChange(); return asStatus(status); } else { // return OK in all other cases. This by passes the dialog shown // in the operation approver and allows refactoring to show its // own dialog again inside the runnable. return Status.OK_STATUS; } } catch (CoreException e) { throw new ExecutionException(e.getStatus().getMessage(), e); } }
@Override public IStatus computeUndoableStatus(IProgressMonitor monitor) throws ExecutionException { if (fUndoChange == null) return new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), IStatus.ERROR, RefactoringCoreMessages.UndoableOperation2ChangeAdapter_no_undo_available, null); try { if (monitor == null) monitor= new NullProgressMonitor(); RefactoringStatus status= fUndoChange.isValid(monitor); if (status.hasFatalError()) { // The operation can no longer be undo. fUndoChange= null; clearActiveChange(); return asStatus(status); } else { // return OK in all other cases. This by passes the dialog shown // in the operation approver and allows refactoring to show its // own dialog again inside the runnable. return Status.OK_STATUS; } } catch (CoreException e) { throw new ExecutionException(e.getStatus().getMessage(), e); } }
public void run(IProgressMonitor monitor) throws CoreException { monitor.beginTask("", 11); //$NON-NLS-1$ try { undo.initializeValidationData(new NotCancelableProgressMonitor(new SubProgressMonitor(monitor, 1))); if (undo.isValid(new SubProgressMonitor(monitor,1)).hasFatalError()) { monitor.done(); return; } undo.perform(new SubProgressMonitor(monitor, 9)); } finally { undo.dispose(); } } };
public void run(IProgressMonitor monitor) throws CoreException { monitor.beginTask("", 11); //$NON-NLS-1$ try { undo.initializeValidationData(new NotCancelableProgressMonitor(new SubProgressMonitor(monitor, 1))); if (undo.isValid(new SubProgressMonitor(monitor,1)).hasFatalError()) { monitor.done(); return; } undo.perform(new SubProgressMonitor(monitor, 9)); } finally { undo.dispose(); } } };
@Override public void run(IProgressMonitor monitor) throws CoreException { monitor.beginTask("", 11); //$NON-NLS-1$ try { undo.initializeValidationData(new NotCancelableProgressMonitor(new SubProgressMonitor(monitor, 1))); if (undo.isValid(new SubProgressMonitor(monitor,1)).hasFatalError()) { monitor.done(); return; } undo.perform(new SubProgressMonitor(monitor, 9)); } finally { undo.dispose(); } } };
@Override public void run(IProgressMonitor monitor) throws CoreException { monitor.beginTask("", 11); //$NON-NLS-1$ try { undo.initializeValidationData(new NotCancelableProgressMonitor(new SubProgressMonitor(monitor, 1))); if (undo.isValid(new SubProgressMonitor(monitor,1)).hasFatalError()) { monitor.done(); return; } undo.perform(new SubProgressMonitor(monitor, 9)); } finally { undo.dispose(); } } };
RefactoringStatus valid= change.isValid(new NullProgressMonitor()); if (valid.hasFatalError()) { IStatus status = new Status(IStatus.ERROR, IConstants.PLUGIN_ID, IStatus.ERROR,
RefactoringStatus valid= change.isValid(new NullProgressMonitor()); if (valid.hasFatalError()) { IStatus status = new Status(IStatus.ERROR, JavaManipulation.getPreferenceNodeId(), IStatus.ERROR,
try { monitor.beginTask("", 11); //$NON-NLS-1$ result.validationStatus= fActiveChange.isValid(new SubProgressMonitor(monitor, 2)); if (result.validationStatus.hasFatalError()) { query.stopped(result.validationStatus);
try { monitor.beginTask("", 11); //$NON-NLS-1$ result.validationStatus= fActiveChange.isValid(new SubProgressMonitor(monitor, 2)); if (result.validationStatus.hasFatalError()) { query.stopped(result.validationStatus);