private IStatus computeContentsStatus() { StatusInfo info= new StatusInfo(); if (fIsModuleCheckbox.isSelected()) { if (fJavaElements != null) { if (fModuleLists[IDX_INCLUDED].fNames.isEmpty()) { info.setError(NewWizardMessages.ModuleDialog_mustIncludeModule_error); } else if (fModuleLists[IDX_INCLUDED].fNames.size() + fModuleLists[IDX_AVAILABLE].fNames.size() == 1) { info.setInfo(NewWizardMessages.ModuleDialog_cannotLimitSingle_error); } } else { info.setInfo(NewWizardMessages.ModuleDialog_unknownModules_info); } } return info; }
private IStatus validateNullnessAnnotation(String value, String errorMessage, boolean isTypeMandatory) { StatusInfo status= new StatusInfo(); if (value.isEmpty() && !isTypeMandatory) return status; if (JavaConventions.validateJavaTypeName(value, JavaCore.VERSION_1_5, JavaCore.VERSION_1_5).matches(IStatus.ERROR) || value.indexOf('.') == -1) { status.setError(errorMessage); } else if (fProject != null) { try { if (JavaCore.create(fProject).findType(value) == null) { String notFoundMessage= NLS.bind(PreferencesMessages.NullAnnotationsConfigurationDialog_notFound_info, value); if (isTypeMandatory) status.setError(notFoundMessage); else status.setInfo(notFoundMessage); } } catch (JavaModelException e) { ExceptionHandler.handle(e, getShell(), PreferencesMessages.NullAnnotationsConfigurationDialog_error_title, PreferencesMessages.NullAnnotationsConfigurationDialog_error_message); } } return status; }
private IStatus validateNullnessAnnotation(String value, String errorMessage, boolean isTypeMandatory) { StatusInfo status= new StatusInfo(); if (value.isEmpty() && !isTypeMandatory) return status; if (JavaConventions.validateJavaTypeName(value, JavaCore.VERSION_1_5, JavaCore.VERSION_1_5).matches(IStatus.ERROR) || value.indexOf('.') == -1) { status.setError(errorMessage); } else if (fProject != null) { try { if (JavaCore.create(fProject).findType(value) == null) { String notFoundMessage= NLS.bind(PreferencesMessages.NullAnnotationsConfigurationDialog_notFound_info, value); if (isTypeMandatory) status.setError(notFoundMessage); else status.setInfo(notFoundMessage); } } catch (JavaModelException e) { ExceptionHandler.handle(e, getShell(), PreferencesMessages.NullAnnotationsConfigurationDialog_error_title, PreferencesMessages.NullAnnotationsConfigurationDialog_error_message); } } return status; }
fClassPathStatus.setInfo(entryDeprecated.getDeprecationMessage());
if (status2.isOK()) { if (fIsProjectAsSourceFolder) { fRootStatus.setInfo(Messages.format(NewWizardMessages.NewSourceFolderWizardPage_warning_ReplaceSFandOL, fNewOutputLocation.makeRelative().toString())); } else { fRootStatus.setInfo(Messages.format(NewWizardMessages.NewSourceFolderWizardPage_warning_ReplaceOL, fNewOutputLocation.makeRelative().toString())); return; } else if (fIsProjectAsSourceFolder) { fRootStatus.setInfo(NewWizardMessages.NewSourceFolderWizardPage_warning_ReplaceSF); return; fRootStatus.setInfo(Messages.format(NewWizardMessages.NewSourceFolderWizardPage_warning_AddedExclusions, String.valueOf(modified.size()))); return;
fClassPathStatus.setInfo(entryDeprecated.getDeprecationMessage());
if (status2.isOK()) { if (isProjectSourceFolderReplaced) { result.setInfo(Messages.format(NewWizardMessages.NewSourceFolderWizardPage_warning_ReplaceSFandOL, BasicElementLabels.getPathLabel(fNewOutputLocation, false))); } else { result.setInfo(Messages.format(NewWizardMessages.NewSourceFolderWizardPage_warning_ReplaceOL, BasicElementLabels.getPathLabel(fNewOutputLocation, false))); result.setInfo(NewWizardMessages.AddSourceFolderWizardPage_conflictWarning + status.getMessage()); } else { result.setError(status.getMessage()); String changed= BasicElementLabels.getPathLabel(elem.getPath(), false); String excl= BasicElementLabels.getPathLabel(fNewElement.getPath(), false); result.setInfo(Messages.format(NewWizardMessages.AddSourceFolderWizardPage_addSinglePattern, new Object[] {excl, changed})); } else { result.setInfo(Messages.format(NewWizardMessages.NewSourceFolderWizardPage_warning_AddedExclusions_plural, String.valueOf(modified.size()))); result.setInfo(NewWizardMessages.AddSourceFolderWizardPage_replaceSourceFolderInfo); return result;
fClassPathStatus.setInfo(entryDeprecated.getDeprecationMessage());
status.setInfo(NewWizardMessages.ModuleDialog_cannotEditDetails_info);
if (status2.isOK()) { if (fIsProjectAsSourceFolder) { fRootStatus.setInfo(Messages.format(NewWizardMessages.NewSourceFolderWizardPage_warning_ReplaceSFandOL, BasicElementLabels.getPathLabel(fNewOutputLocation, false))); } else { fRootStatus.setInfo(Messages.format(NewWizardMessages.NewSourceFolderWizardPage_warning_ReplaceOL, BasicElementLabels.getPathLabel(fNewOutputLocation, false))); return; } else if (fIsProjectAsSourceFolder) { fRootStatus.setInfo(NewWizardMessages.NewSourceFolderWizardPage_warning_ReplaceSF); return; String info= modified.size() == 1 ? Messages.format(NewWizardMessages.NewSourceFolderWizardPage_warning_AddedExclusions_singular, (modified.iterator().next()) .getPath()) : Messages.format(NewWizardMessages.NewSourceFolderWizardPage_warning_AddedExclusions_plural, String.valueOf(modified.size())); fRootStatus.setInfo(info); return;
if (status2.isOK()) { if (project.isOnClasspath(project)) { rootStatus.setInfo(Messages.format(NewWizardMessages.NewSourceFolderWizardPage_warning_ReplaceSFandOL, outputLocation.makeRelative().toString())); } else { rootStatus.setInfo(Messages.format(NewWizardMessages.NewSourceFolderWizardPage_warning_ReplaceOL, outputLocation.makeRelative().toString()));
status.setWarning(message); } else { status.setInfo(message);
status.setWarning(message); } else { status.setInfo(message);
status.setWarning(message); } else { status.setInfo(message);
if (status2.isOK()) { if (project.isOnClasspath(project)) { rootStatus.setInfo(Messages.format(NewWizardMessages.NewSourceFolderWizardPage_warning_ReplaceSFandOL, BasicElementLabels.getPathLabel(outputLocation, false))); } else { rootStatus.setInfo(Messages.format(NewWizardMessages.NewSourceFolderWizardPage_warning_ReplaceOL, BasicElementLabels.getPathLabel(outputLocation, false)));
if (status2.isOK()) { if (project.isOnClasspath(project)) { rootStatus.setInfo(Messages.format(NewWizardMessages.NewSourceFolderWizardPage_warning_ReplaceSFandOL, BasicElementLabels.getPathLabel(outputLocation, false))); } else { rootStatus.setInfo(Messages.format(NewWizardMessages.NewSourceFolderWizardPage_warning_ReplaceOL, BasicElementLabels.getPathLabel(outputLocation, false)));
status.setInfo(NewWizardMessages.NewTypeWizardPage_info_FileExtensionNotRequired);