public void addLocalizedWarning(String msg, Object target) { _reporter.addMessage(this, new LocalizedMessage(IMessage.NORMAL_SEVERITY, msg, target)); } public void addLocalizedWarning(String msg, Object target, String groupName) {
public void addLocalizedInfo(String msg, Object target) { _reporter.addMessage(this, new LocalizedMessage(IMessage.LOW_SEVERITY, msg, target)); }
public void addLocalizedError(String msg, Object target) { _reporter.addMessage(this, new LocalizedMessage(IMessage.HIGH_SEVERITY, msg, target)); }
public void addLocalizedError(String msg, Object target, String groupName) { IMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, msg, target); message.setGroupName( groupName ); _reporter.addMessage(this, message); }
public void addLocalizedWarning(String msg, Object target, String groupName) { IMessage message = new LocalizedMessage(IMessage.NORMAL_SEVERITY, msg, target); message.setGroupName(groupName); _reporter.addMessage(this, message); }
protected void handleManifestException(IOException ex, Archive anArchive) throws ValidationException { Logger.getLogger().logError(ex); String tmp = NLS.bind(EARValidationMessageResourceHandler.ERROR_READING_MANIFEST_ERROR_, new String[]{anArchive.getURI()}); IMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, tmp); throw new ValidationException(message, ex); }
public void addLocalizedError(String msg, Object target, String groupName, int lineNumber) { IMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, msg, target); message.setGroupName( groupName ); message.setLineNo(lineNumber); _reporter.addMessage(this, message); }
/** * Provides the instance of the validator delegate pointed to by this * descriptor. * * @return an IValidator instance. * @throws ValidationException */ public IValidator getValidator() throws ValidationException { try { IValidator delegate = (IValidator) delegateConfiguration.createExecutableExtension(ValidatorDelegatesRegistryReader.CLASS_ATTRIBUTE); return delegate; } catch (CoreException e) { String delegatingValidatorName = ValidationRegistryReader.getReader().getValidatorMetaData(getTargetID()).getValidatorDisplayName(); throw new ValidationException(new LocalizedMessage(IMessage.HIGH_SEVERITY, ResourceHandler.getExternalizedMessage(ResourceConstants.VBF_CANNOT_INSTANTIATE_DELEGATE, new String[] { getName(), delegatingValidatorName }))); } } }
IMessage msg = new LocalizedMessage(IMessage.NORMAL_SEVERITY, "Validating Modules"); _reporter.displaySubtask( this, msg );
throw new ValidationException(new LocalizedMessage(IMessage.HIGH_SEVERITY, ResourceHandler.getExternalizedMessage(ResourceConstants.VBF_WRONG_CONTEXT_FOR_DELEGATE, new String[] { validatorName }))); throw new ValidationException(new LocalizedMessage(IMessage.HIGH_SEVERITY, ResourceHandler.getExternalizedMessage(ResourceConstants.VBF_NO_DELEGATE, new String[] { vmd.getValidatorDisplayName() })));
else { String msg = NLS.bind(EARValidationMessageResourceHandler.EAR_DD_CANNOT_OPEN_DD, new String[] { getResourceName()}); IMessage errorMsg = new LocalizedMessage(IMessage.HIGH_SEVERITY, msg); status = WTPCommonPlugin.createErrorStatus(errorMsg.getText()); throw new ValidationException(errorMsg); IMessage errorMsg = new LocalizedMessage(IMessage.HIGH_SEVERITY, msg); throw new ValidationException(errorMsg); Logger.getLogger().logError(e); String msg = NLS.bind(EARValidationMessageResourceHandler.EAR_VALIDATION_INTERNAL_ERROR_UI_, param ); IMessage errorMsg = new LocalizedMessage(IMessage.HIGH_SEVERITY, msg ); throw new ValidationException(errorMsg, e);
private void checkForSpaceBeforeName(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) { if (structuredDocumentRegion.isDeleted()) { return; } String sdRegionText = structuredDocumentRegion.getFullText(); if (sdRegionText.startsWith(" ")) { //$NON-NLS-1$ IStructuredDocumentRegion prev = structuredDocumentRegion.getPrevious(); if (prev != null) { // this is possibly the case of "< tag" if ((prev.getRegions().size() == 1) && isStartTag(prev)) { // add the error for preceding space in tag name String messageText = XMLUIMessages.ReconcileStepForMarkup_2; int start = structuredDocumentRegion.getStartOffset(); // find length of whitespace int length = sdRegionText.trim().equals("") ? sdRegionText.length() : sdRegionText.indexOf(sdRegionText.trim()); //$NON-NLS-1$ LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText); message.setOffset(start); message.setLength(length); message.setLineNo(getLineNumber(start)); MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor(); processor.setProblemId(ProblemIDsXML.SpacesBeforeTagName); message.setAttribute(QUICKASSISTPROCESSOR, processor); AnnotationInfo info = new AnnotationInfo(message); ((IncrementalReporter) reporter).addAnnotationInfo(this, info); } } } }
/** * validate EJB and resource references */ public void validateRefs() { IMessage msg = new LocalizedMessage(IMessage.NORMAL_SEVERITY, "Validating Refs"); _reporter.displaySubtask( this, msg ); List moduleList = earFile.getModuleRefs(); for (int i = 0; i < moduleList.size(); i++) { ModuleRef ref = (ModuleRef) moduleList.get(i); try { if(ref.isWeb()) { validateWebAppRefs(ref); } else if( ref.isEJB() ) { validateEJBModuleRefs(ref); } else if(ref.isClient()) validateAppClientRefs(ref); } catch (ArchiveWrappedException ex) { // Exception nested = ex.getNestedException(); String[] params = new String[1]; params[0] = ref.getUri(); addError(EREF_CATEGORY, ERROR_MODULE_DD_FILE_NOT_FOUND, params); } } }
int length = piText.trim().length() - index; LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText); message.setOffset(start); message.setLength(length);
private void addAttributeError(String messageText, String attributeValueText, int start, int length, int problemId, IStructuredDocumentRegion sdRegion, IReporter reporter) { if (sdRegion.isDeleted()) { return; } int lineNo = getLineNumber(start); LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText); message.setOffset(start); message.setLength(length); message.setLineNo(lineNo); MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor(); processor.setProblemId(problemId); processor.setAdditionalFixInfo(attributeValueText); message.setAttribute(QUICKASSISTPROCESSOR, processor); AnnotationInfo info = new AnnotationInfo(message); ((IncrementalReporter) reporter).addAnnotationInfo(this, info); }
private void checkClosingBracket(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) { if (structuredDocumentRegion.isDeleted()) { return; } ITextRegionList regions = structuredDocumentRegion.getRegions(); ITextRegion r = null; boolean closed = false; for (int i = 0; (i < regions.size()) && !structuredDocumentRegion.isDeleted(); i++) { r = regions.get(i); if ((r.getType() == DOMRegionContext.XML_TAG_CLOSE) || (r.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE)) { closed = true; } } if (!closed) { String messageText = XMLUIMessages.ReconcileStepForMarkup_6; int start = structuredDocumentRegion.getStartOffset(); int length = structuredDocumentRegion.getText().trim().length(); int lineNo = getLineNumber(start); LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText); message.setOffset(start); message.setLength(length); message.setLineNo(lineNo); MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor(); processor.setProblemId(ProblemIDsXML.MissingClosingBracket); message.setAttribute(QUICKASSISTPROCESSOR, processor); AnnotationInfo info = new AnnotationInfo(message); ((IncrementalReporter) reporter).addAnnotationInfo(this, info); } }
int length = prev.getLength(); LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText); message.setOffset(start); message.setLength(length);
IMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText); message.setOffset(start); message.setLength(length);
private void checkEmptyTag(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) { if (structuredDocumentRegion.isDeleted()) { return; } // navigate to name ITextRegionList regions = structuredDocumentRegion.getRegions(); if (regions.size() == 2) { // missing name region if ((regions.get(0).getType() == DOMRegionContext.XML_TAG_OPEN) && (regions.get(1).getType() == DOMRegionContext.XML_TAG_CLOSE)) { String messageText = XMLUIMessages.ReconcileStepForMarkup_3; int start = structuredDocumentRegion.getStartOffset(); int length = structuredDocumentRegion.getLength(); int lineNo = getLineNumber(start); LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText); message.setOffset(start); message.setLength(length); message.setLineNo(lineNo); MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor(); processor.setProblemId(ProblemIDsXML.EmptyTag); message.setAttribute(QUICKASSISTPROCESSOR, processor); AnnotationInfo info = new AnnotationInfo(message); ((IncrementalReporter) reporter).addAnnotationInfo(this, info); } } }
LocalizedMessage message = new LocalizedMessage(IMessage.NORMAL_SEVERITY, messageText); message.setOffset(start); message.setLength(end - start);