private IStatus asStatus(RefactoringStatus status) { if (status.isOK()) { return Status.OK_STATUS; } else { return status.getEntryWithHighestSeverity().toStatus(); } }
/** * Populates the refactoring descriptor argument map based on the specified * arguments. Subclasses should extend and add their arguments to {@link #fArguments}. */ protected void populateArgumentMap() { RefactoringStatus status= validateDescriptor(); if (status.hasFatalError()) throw new RuntimeException("Validation returns a fatal error status", new CoreException(status.getEntryWithHighestSeverity().toStatus())); //$NON-NLS-1$ }
private IStatus asStatus(RefactoringStatus status) { if (status.isOK()) { return Status.OK_STATUS; } else { return status.getEntryWithHighestSeverity().toStatus(); } }
private IStatus createStatus(ExecuteResult result) { if (!result.validationStatus.isOK()) { return result.validationStatus.getEntryWithHighestSeverity().toStatus(); } else { return new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), IStatus.ERROR, RefactoringCoreMessages.UndoableOperation2ChangeAdapter_error_message, null); } }
private IStatus createStatus(ExecuteResult result) { if (!result.validationStatus.isOK()) { return result.validationStatus.getEntryWithHighestSeverity().toStatus(); } else { return new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), IStatus.ERROR, RefactoringCoreMessages.UndoableOperation2ChangeAdapter_error_message, null); } }
private IStatus asStatus(RefactoringStatus status) { if (status.isOK()) { return new Status(IStatus.OK, RefactoringCorePlugin.getPluginId(), IStatus.OK, "", null); //$NON-NLS-1$ } else { return status.getEntryWithHighestSeverity().toStatus(); } }
private IStatus createStatus(ExecuteResult result) { if (!result.validationStatus.isOK()) { return result.validationStatus.getEntryWithHighestSeverity().toStatus(); } else { return new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), IStatus.ERROR, RefactoringCoreMessages.UndoableOperation2ChangeAdapter_error_message, null); } }
public final void run() throws Exception { if (fAboutToPerformFired) { final RefactoringStatusEntry entry= historyPerformed(new NullProgressMonitor()).getEntryWithHighestSeverity(); if (entry != null) RefactoringUIPlugin.log(entry.toStatus()); } } });
/** * Executes some light weight precondition checking. If the returned status * is an error then the refactoring can't be executed at all. However, * returning an OK status doesn't guarantee that the refactoring can be * executed. It may still fail while performing the exhaustive precondition * checking done inside the methods <code>openDialog</code> or * <code>perform</code>. * * The method is mainly used to determine enable/disablement of actions. * * @return the result of the light weight precondition checking. * * @throws CoreException if an unexpected exception occurs while performing the checking. * * @see #openDialog(Shell) * @see #perform(Shell, IRunnableContext) */ public IStatus preCheck() throws CoreException { //ensureChecked(); if (fPreCheckStatus.hasFatalError()) { return fPreCheckStatus.getEntryMatchingSeverity(RefactoringStatus.FATAL).toStatus(); } else { return Status.OK_STATUS; } }
/** * Executes some light weight precondition checking. If the returned status * is an error then the refactoring can't be executed at all. However, * returning an OK status doesn't guarantee that the refactoring can be * executed. It may still fail while performing the exhaustive precondition * checking done inside the methods <code>openDialog</code> or * <code>perform</code>. * * The method is mainly used to determine enable/disablement of actions. * * @return the result of the light weight precondition checking. * * @throws CoreException if an unexpected exception occurs while performing the checking. * * @see #openDialog(Shell) * @see #perform(Shell, IRunnableContext) */ public IStatus preCheck() throws CoreException { ensureChecked(); if (fPreCheckStatus.hasFatalError()) return fPreCheckStatus.getEntryMatchingSeverity(RefactoringStatus.FATAL).toStatus(); else return Status.OK_STATUS; }
/** * Executes some light weight precondition checking. If the returned status * is an error then the refactoring can't be executed at all. However, * returning an OK status doesn't guarantee that the refactoring can be * executed. It may still fail while performing the exhaustive precondition * checking done inside the methods <code>openDialog</code> or * <code>perform</code>. * * The method is mainly used to determine enable/disablement of actions. * * @return the result of the light weight precondition checking. * * @throws CoreException if an unexpected exception occurs while performing the checking. * * @see #openDialog(Shell) * @see #perform(Shell, IRunnableContext) */ public IStatus preCheck() throws CoreException { ensureChecked(); if (fPreCheckStatus.hasFatalError()) return fPreCheckStatus.getEntryMatchingSeverity(RefactoringStatus.FATAL).toStatus(); else return Status.OK_STATUS; }
/** * Executes some light weight precondition checking. If the returned status * is an error then the refactoring can't be executed at all. However, * returning an OK status doesn't guarantee that the refactoring can be * executed. It may still fail while performing the exhaustive precondition * checking done inside the methods <code>openDialog</code> or * <code>perform</code>. * * The method is mainly used to determine enable/disablement of actions. * * @return the result of the light weight precondition checking. * * @throws CoreException if an unexpected exception occurs while performing the checking. * * @see #openDialog(Shell) * @see #perform(Shell, IRunnableContext) */ public IStatus preCheck() throws CoreException { ensureChecked(); if (fPreCheckStatus.hasFatalError()) return fPreCheckStatus.getEntryMatchingSeverity(RefactoringStatus.FATAL).toStatus(); else return new Status(IStatus.OK, JavaPlugin.getPluginId(), 0, "", null); //$NON-NLS-1$ }