/** * Returns the first entry managed by this refactoring status that * matches the given plug-in identifier and code. If more than one * entry exists that matches the criteria the first one in the list * of entries is returned. Returns <code>null</code> if no entry * matches. * * @param pluginId the entry's plug-in identifier * @param code the entry's code * @return the entry that matches the given plug-in identifier and * code; <code>null</code> otherwise */ public RefactoringStatusEntry getEntryMatchingCode(String pluginId, int code) { Assert.isTrue(pluginId != null); for (Iterator iter= fEntries.iterator(); iter.hasNext(); ) { RefactoringStatusEntry entry= (RefactoringStatusEntry)iter.next(); if (pluginId.equals(entry.getPluginId()) && entry.getCode() == code) return entry; } return null; }
/** * Returns the first entry managed by this refactoring status that * matches the given plug-in identifier and code. If more than one * entry exists that matches the criteria the first one in the list * of entries is returned. Returns <code>null</code> if no entry * matches. * * @param pluginId the entry's plug-in identifier * @param code the entry's code * @return the entry that matches the given plug-in identifier and * code; <code>null</code> otherwise */ public RefactoringStatusEntry getEntryMatchingCode(String pluginId, int code) { Assert.isTrue(pluginId != null); for (Iterator<RefactoringStatusEntry> iter= fEntries.iterator(); iter.hasNext(); ) { RefactoringStatusEntry entry= iter.next(); if (pluginId.equals(entry.getPluginId()) && entry.getCode() == code) return entry; } return null; }
/** * Returns the first entry managed by this refactoring status that * matches the given plug-in identifier and code. If more than one * entry exists that matches the criteria the first one in the list * of entries is returned. Returns <code>null</code> if no entry * matches. * * @param pluginId the entry's plug-in identifier * @param code the entry's code * @return the entry that matches the given plug-in identifier and * code; <code>null</code> otherwise */ public RefactoringStatusEntry getEntryMatchingCode(String pluginId, int code) { Assert.isTrue(pluginId != null); for (Iterator<RefactoringStatusEntry> iter= fEntries.iterator(); iter.hasNext(); ) { RefactoringStatusEntry entry= iter.next(); if (pluginId.equals(entry.getPluginId()) && entry.getCode() == code) return entry; } return null; }
int code= getCode(); if (pluginId == null) { pluginId= RefactoringCorePlugin.getPluginId();
int code= getCode(); if (pluginId == null) { pluginId= RefactoringCorePlugin.getPluginId();
int code= getCode(); if (pluginId == null) { pluginId= RefactoringCorePlugin.getPluginId();
public final boolean activate(final Refactoring ref, final Shell parent, final int saveMode) throws CoreException { final RefactoringStatus status= ref.checkInitialConditions(new NullProgressMonitor()); if (status.hasFatalError()) { final RefactoringStatusEntry entry= status.getEntryMatchingSeverity(RefactoringStatus.FATAL); if (entry.getCode() == RefactoringStatusCodes.OVERRIDES_ANOTHER_METHOD || entry.getCode() == RefactoringStatusCodes.METHOD_DECLARED_IN_INTERFACE) { String message= entry.getMessage(); final Object element= entry.getData(); message= message + RefactoringMessages.RefactoringErrorDialogUtil_okToPerformQuestion; if (element != null && MessageDialog.openQuestion(shell, RefactoringMessages.OpenRefactoringWizardAction_refactoring, message)) { final IStructuredSelection selection= new StructuredSelection(element); // TODO: should not hijack this // ModifiyParametersAction. // The action is set up on an editor, but we use it // as if it were set up on a ViewPart. boolean wasEnabled= action.isEnabled(); action.selectionChanged(selection); if (action.isEnabled()) { action.run(selection); } else { MessageDialog.openInformation(shell, ActionMessages.ModifyParameterAction_problem_title, ActionMessages.ModifyParameterAction_problem_message); } action.setEnabled(wasEnabled); } return false; } } return super.activate(ref, parent, saveMode); } };
if (status.hasFatalError()) { final RefactoringStatusEntry entry= status.getEntryMatchingSeverity(RefactoringStatus.FATAL); if (entry.getCode() == RefactoringStatusCodes.OVERRIDES_ANOTHER_METHOD || entry.getCode() == RefactoringStatusCodes.METHOD_DECLARED_IN_INTERFACE) { final Object element= entry.getData(); IMethod superMethod= (IMethod) element;
if (status.hasFatalError()) { final RefactoringStatusEntry entry= status.getEntryMatchingSeverity(RefactoringStatus.FATAL); if (entry.getCode() == RefactoringStatusCodes.OVERRIDES_ANOTHER_METHOD || entry.getCode() == RefactoringStatusCodes.METHOD_DECLARED_IN_INTERFACE) { Object element= entry.getData(); if (element != null) {
if (status.hasFatalError()) { final RefactoringStatusEntry entry= status.getEntryMatchingSeverity(RefactoringStatus.FATAL); if (entry.getCode() == RefactoringStatusCodes.OVERRIDES_ANOTHER_METHOD || entry.getCode() == RefactoringStatusCodes.METHOD_DECLARED_IN_INTERFACE) { Object element= entry.getData(); if (element != null) {
if (status.hasFatalError()) { final RefactoringStatusEntry entry= status.getEntryMatchingSeverity(RefactoringStatus.FATAL); if (entry.getCode() == RefactoringStatusCodes.OVERRIDES_ANOTHER_METHOD || entry.getCode() == RefactoringStatusCodes.METHOD_DECLARED_IN_INTERFACE) { final Object element= entry.getData(); IMethod superMethod= (IMethod) element;
/** * {@inheritDoc} */ public IWizardPage getNextPage() { if (fChange != null && fRefactoring != null && !fStatus.hasFatalError()) { final RefactoringHistoryWizard result= getRefactoringHistoryWizard(); if (result != null) { final RefactoringStatus status= result.performPreviewChange(fChange, fRefactoring); if (!status.isOK()) { final RefactoringStatusEntry entry= status.getEntryWithHighestSeverity(); if (entry != null) { if (entry.getSeverity() == RefactoringStatus.INFO && entry.getCode() == RefactoringHistoryWizard.STATUS_CODE_INTERRUPTED) return this; final IErrorWizardPage page= result.getErrorPage(); if (page instanceof RefactoringHistoryErrorPage) { final RefactoringHistoryErrorPage extended= (RefactoringHistoryErrorPage) page; extended.setStatus(status); extended.setNextPageDisabled(fNextPageDisabled); extended.setTitle(RefactoringUIMessages.RefactoringHistoryPreviewPage_apply_error_title); extended.setDescription(RefactoringUIMessages.RefactoringHistoryPreviewPage_apply_error); return extended; } } } } } return getWizard().getNextPage(this); }
if (!status.isOK()) { final RefactoringStatusEntry entry= status.getEntryWithHighestSeverity(); if (entry.getSeverity() == RefactoringStatus.INFO && entry.getCode() == RefactoringHistoryWizard.STATUS_CODE_INTERRUPTED) return false; fErrorPage.setStatus(status);