Package org.eclipse.wst.validation.internal.core

Examples of org.eclipse.wst.validation.internal.core.Message


      IFile currentFile = null;
      for (int i = 0; i < uris.length && !reporter.isCancelled(); i++) {
        currentFile = wsRoot.getFile(new Path(uris[i]));
        if (currentFile != null && currentFile.exists()) {
          if (shouldValidate(currentFile) && fragmentCheck(currentFile)) {
            Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, currentFile.getFullPath().toString().substring(1));
            reporter.displaySubtask(this, message);
            validateFile(currentFile, reporter);
          }
          if (DEBUG)
            System.out.println("validating: [" + uris[i] + "]"); //$NON-NLS-1$ //$NON-NLS-2$
        }
      }
    }
    else {
      // if uris[] length 0 -> validate() gets called for each project
      if (helper instanceof IWorkbenchContext) {
        IProject project = ((IWorkbenchContext) helper).getProject();

        Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, NLS.bind(JSPCoreMessages.JSPBatchValidator_0, project.getFullPath()));
        reporter.displaySubtask(this, message);

        JSPFileVisitor visitor = new JSPFileVisitor(reporter);
        try {
          // collect all jsp files for the project
View Full Code Here


    catch (ParseException e) {
      int sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_EL_SYNTAX);
      if (sev != ValidationMessage.IGNORE) {
        Token curTok = e.currentToken;
        int problemStartOffset = contentDocStart + curTok.beginColumn;
        Message message = new LocalizedMessage(sev, JSPCoreMessages.JSPEL_Syntax);
        message.setOffset(problemStartOffset);
        message.setLength(curTok.endColumn - curTok.beginColumn + 1);
        message.setTargetObject(file);
        reporter.addMessage(fMessageOriginator, message);
      }
    }
    catch (TokenMgrError te) {
      int sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_EL_LEXER);
      if (sev != ValidationMessage.IGNORE) {
        Message message = new LocalizedMessage(IMessage.NORMAL_SEVERITY, JSPCoreMessages.JSPEL_Token);
        message.setOffset(contentDocStart);
        message.setLength(contentLength);
        message.setTargetObject(file);
        reporter.addMessage(fMessageOriginator, message);
      }
    }
  }
View Full Code Here

    catch (ParseException e) {
      int sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_EL_SYNTAX);
      if (sev != ValidationMessage.IGNORE) {
        Token curTok = e.currentToken;
        int problemStartOffset = contentStart + curTok.beginColumn;
        Message message = new LocalizedMessage(sev, JSPCoreMessages.JSPEL_Syntax);
        message.setOffset(problemStartOffset);
        message.setLength(curTok.endColumn - curTok.beginColumn + 1);
        message.setTargetObject(file);
        reporter.addMessage(fMessageOriginator, message);
      }
    }
    catch (TokenMgrError te) {
      int sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_EL_LEXER);
      if (sev != ValidationMessage.IGNORE) {
        Message message = new LocalizedMessage(IMessage.NORMAL_SEVERITY, JSPCoreMessages.JSPEL_Token);
        message.setOffset(contentStart);
        message.setLength(contentLength);
        message.setTargetObject(file);
        reporter.addMessage(fMessageOriginator, message);
      }
    }
  }
View Full Code Here

        // might be called with just project path?
        currentFile = wsRoot.getFile(new Path(uris[i]));
        if (currentFile != null && currentFile.exists()) {
          if (shouldValidate(currentFile) && fragmentCheck(currentFile)) {

            Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, uris[i]);
            reporter.displaySubtask(this, message);

            validateFile(currentFile, reporter);
          }
          if (DEBUG)
            System.out.println("validating: [" + uris[i] + "]"); //$NON-NLS-1$ //$NON-NLS-2$
        }
      }
    }
    else {

      // if uris[] length 0 -> validate() gets called for each project
      if (helper instanceof IWorkbenchContext) {

        IProject project = ((IWorkbenchContext) helper).getProject();
        JSPFileVisitor visitor = new JSPFileVisitor(reporter);
        try {
          // collect all jsp files for the project
          project.accept(visitor, IResource.DEPTH_INFINITE);
        }
        catch (CoreException e) {
          if (DEBUG)
            e.printStackTrace();
        }
        IFile[] files = visitor.getFiles();
        for (int i = 0; i < files.length && !reporter.isCancelled(); i++) {
          if (shouldValidate(files[i]) && fragmentCheck(files[i])) {
            int percent = (i * 100) / files.length + 1;
            Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, percent + "% " + files[i].getFullPath().toString());
            reporter.displaySubtask(this, message);

            validateFile(files[i], reporter);
          }
          if (DEBUG)
View Full Code Here

   * @param context
   *     The context of the current validation.
   */
  private void validate(IFile file, InputStream inputstream, ValidationResult result, IReporter reporter, NestedValidatorContext context)
  { 
  Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, file.getFullPath().toString());
    reporter.displaySubtask(this, message);
   
  String locationString = null;   
  if (file.getLocation() != null) {
    locationString = file.getLocation().toString();
View Full Code Here

    catch (ParseException e) {
      int sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_EL_SYNTAX);
      if (sev != ValidationMessage.IGNORE) {
        Token curTok = e.currentToken;
        int problemStartOffset = contentDocStart + curTok.beginColumn;
        Message message = new LocalizedMessage(sev, JSPCoreMessages.JSPEL_Syntax);
        message.setOffset(problemStartOffset);
        message.setLength(curTok.endColumn - curTok.beginColumn + 1);
        message.setTargetObject(file);
        reporter.addMessage(fMessageOriginator, message);
      }
    }
    catch (TokenMgrError te) {
      int sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_EL_LEXER);
      if (sev != ValidationMessage.IGNORE) {
        Message message = new LocalizedMessage(IMessage.NORMAL_SEVERITY, JSPCoreMessages.JSPEL_Token);
        message.setOffset(contentDocStart);
        message.setLength(contentLength);
        message.setTargetObject(file);
        reporter.addMessage(fMessageOriginator, message);
      }
    }
  }
View Full Code Here

    catch (ParseException e) {
      int sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_EL_SYNTAX);
      if (sev != ValidationMessage.IGNORE) {
        Token curTok = e.currentToken;
        int problemStartOffset = contentStart + curTok.beginColumn;
        Message message = new LocalizedMessage(sev, JSPCoreMessages.JSPEL_Syntax);
        message.setOffset(problemStartOffset);
        message.setLength(curTok.endColumn - curTok.beginColumn + 1);
        message.setTargetObject(file);
        reporter.addMessage(fMessageOriginator, message);
      }
    }
    catch (TokenMgrError te) {
      int sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_EL_LEXER);
      if (sev != ValidationMessage.IGNORE) {
        Message message = new LocalizedMessage(IMessage.NORMAL_SEVERITY, JSPCoreMessages.JSPEL_Token);
        message.setOffset(contentStart);
        message.setLength(contentLength);
        message.setTargetObject(file);
        reporter.addMessage(fMessageOriginator, message);
      }
    }
  }
View Full Code Here

          HTMLValidationReporter rep = null;
          rep = getReporter(reporter, file, (IDOMModel) model);
          rep.clear();
          adapter.setReporter(rep);

          Message mess = new LocalizedMessage(IMessage.LOW_SEVERITY, file.getFullPath().toString().substring(1));
          reporter.displaySubtask(this, mess);
        }
        adapter.validate(ir);
      }
    }
View Full Code Here

        FacesConfigArtifactEdit facesConfigEdit = null;
        //Bug 290962 - NPE if faces-config.xml is in wrong folder
        final IPath path = JSFAppConfigUtils.getWebContentFolderRelativePath(file);
        if (path == null)
        {
          reporter.addMessage(this, new Message(JSFCorePlugin.getDefault().getBundle().getSymbolicName(), IMessage.NORMAL_SEVERITY, Messages.CONFIG_FILE_NOT_UNDER_WEBCONTENT_FOLDER));
        }
        else
        {
          try
          {
View Full Code Here

   * @param context
   *     The context of the current validation.
   */
  private void validate(IFile file, InputStream inputstream, ValidationResult result, IReporter reporter, NestedValidatorContext context)
  { 
  Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, file.getFullPath().toString());
    reporter.displaySubtask(this, message);
   
  String locationString = null;   
  if (file.getLocation() != null) {
    locationString = file.getLocation().toString();
View Full Code Here

TOP

Related Classes of org.eclipse.wst.validation.internal.core.Message

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.