@Override public final int compare(final RefactoringStatusEntry entry1, final RefactoringStatusEntry entry2) { return entry1.getMessage().compareTo(entry2.getMessage()); } }, other).length > 0;
@Override public final int compare(final RefactoringStatusEntry entry1, final RefactoringStatusEntry entry2) { return entry1.getMessage().compareTo(entry2.getMessage()); } }, other).length > 0;
@Override public final int compare(final RefactoringStatusEntry entry1, final RefactoringStatusEntry entry2) { return entry1.getMessage().compareTo(entry2.getMessage()); } }, other).length > 0;
@Override public final int compare(final RefactoringStatusEntry entry1, final RefactoringStatusEntry entry2) { return entry1.getMessage().compareTo(entry2.getMessage()); } }, other).length > 0;
@Override public final int compare(final RefactoringStatusEntry entry1, final RefactoringStatusEntry entry2) { return entry1.getMessage().compareTo(entry2.getMessage()); } }, other).length > 0;
public final int compare(final RefactoringStatusEntry entry1, final RefactoringStatusEntry entry2) { return entry1.getMessage().compareTo(entry2.getMessage()); } }, other).length > 0;
public final int compare(final RefactoringStatusEntry entry1, final RefactoringStatusEntry entry2) { return entry1.getMessage().compareTo(entry2.getMessage()); } }, other).length > 0;
/** * Returns the first message which severity is equal or greater than the * given severity. If more than one entry exists that matches the criteria * the first one is returned. Returns <code>null</code> if no entry matches. * * @param severity the severity to search for. Must be one of <code>FATAL * </code>, <code>ERROR</code>, <code>WARNING</code> or <code>INFO</code> * @return the message of the entry that matches the search criteria */ public String getMessageMatchingSeverity(int severity) { RefactoringStatusEntry entry= getEntryMatchingSeverity(severity); if (entry == null) return null; return entry.getMessage(); }
public String getText(Object element){ return Strings.removeNewLine(((RefactoringStatusEntry)element).getMessage()); } public Image getImage(Object element){
/** * Returns the first message which severity is equal or greater than the * given severity. If more than one entry exists that matches the criteria * the first one is returned. Returns <code>null</code> if no entry matches. * * @param severity the severity to search for. Must be one of <code>FATAL * </code>, <code>ERROR</code>, <code>WARNING</code> or <code>INFO</code> * @return the message of the entry that matches the search criteria */ public String getMessageMatchingSeverity(int severity) { RefactoringStatusEntry entry= getEntryMatchingSeverity(severity); if (entry == null) return null; return entry.getMessage(); }
/** * Returns the first message which severity is equal or greater than the * given severity. If more than one entry exists that matches the criteria * the first one is returned. Returns <code>null</code> if no entry matches. * * @param severity the severity to search for. Must be one of <code>FATAL * </code>, <code>ERROR</code>, <code>WARNING</code> or <code>INFO</code> * @return the message of the entry that matches the search criteria */ public String getMessageMatchingSeverity(int severity) { RefactoringStatusEntry entry= getEntryMatchingSeverity(severity); if (entry == null) return null; return entry.getMessage(); }
@Override public String getAdditionalProposalInfo(IProgressMonitor monitor) throws CoreException { if (fRefactoringStatus != null && fRefactoringStatus.hasFatalError()) { return fRefactoringStatus.getEntryWithHighestSeverity().getMessage(); } return super.getAdditionalProposalInfo(monitor); } }
@Override public Object getAdditionalProposalInfo(IProgressMonitor monitor) { if (fRefactoringStatus != null && fRefactoringStatus.hasFatalError()) { return fRefactoringStatus.getEntryWithHighestSeverity().getMessage(); } return super.getAdditionalProposalInfo(monitor); } }
@Override public Object getAdditionalProposalInfo(IProgressMonitor monitor) { if (fRefactoringStatus != null && fRefactoringStatus.hasFatalError()) { return fRefactoringStatus.getEntryWithHighestSeverity().getMessage(); } return super.getAdditionalProposalInfo(monitor); } }
private IStatus validateType() { if (fType == null) return null; String type= fType.getText(); RefactoringStatus status= TypeContextChecker.checkParameterTypeSyntax(type, fContext.getCuHandle().getJavaProject()); if (status == null || status.isOK()) return Status.OK_STATUS; if (status.hasError()) return createErrorStatus(status.getEntryWithHighestSeverity().getMessage()); else return createWarningStatus(status.getEntryWithHighestSeverity().getMessage()); }
private IStatus validateType() { if (fType == null) return null; String type= fType.getText(); RefactoringStatus status= TypeContextChecker.checkParameterTypeSyntax(type, fContext.getCuHandle().getJavaProject()); if (status == null || status.isOK()) return Status.OK_STATUS; if (status.hasError()) return createErrorStatus(status.getEntryWithHighestSeverity().getMessage()); else return createWarningStatus(status.getEntryWithHighestSeverity().getMessage()); }
private IStatus validateType() { if (fType == null) return null; String type= fType.getText(); RefactoringStatus status= TypeContextChecker.checkParameterTypeSyntax(type, fContext.getCuHandle().getJavaProject()); if (status == null || status.isOK()) return createOkStatus(); if (status.hasError()) return createErrorStatus(status.getEntryWithHighestSeverity().getMessage()); else return createWarningStatus(status.getEntryWithHighestSeverity().getMessage()); }
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); } };
protected void updateDecoration(ControlDecoration decoration, RefactoringStatus status) { RefactoringStatusEntry highestSeverity= status.getEntryWithHighestSeverity(); if (highestSeverity != null) { Image newImage= null; FieldDecorationRegistry registry= FieldDecorationRegistry.getDefault(); switch (highestSeverity.getSeverity()) { case RefactoringStatus.INFO: newImage= registry.getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION).getImage(); break; case RefactoringStatus.WARNING: newImage= registry.getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage(); break; case RefactoringStatus.FATAL: case RefactoringStatus.ERROR: newImage= registry.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR).getImage(); } decoration.setDescriptionText(highestSeverity.getMessage()); decoration.setImage(newImage); decoration.show(); } else { decoration.setDescriptionText(null); decoration.hide(); } }
protected void updateDecoration(ControlDecoration decoration, RefactoringStatus status) { RefactoringStatusEntry highestSeverity= status.getEntryWithHighestSeverity(); if (highestSeverity != null) { Image newImage= null; FieldDecorationRegistry registry= FieldDecorationRegistry.getDefault(); switch (highestSeverity.getSeverity()) { case RefactoringStatus.INFO: newImage= registry.getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION).getImage(); break; case RefactoringStatus.WARNING: newImage= registry.getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage(); break; case RefactoringStatus.FATAL: case RefactoringStatus.ERROR: newImage= registry.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR).getImage(); } decoration.setDescriptionText(highestSeverity.getMessage()); decoration.setImage(newImage); decoration.show(); } else { decoration.setDescriptionText(null); decoration.hide(); } }