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

Examples of org.eclipse.wst.validation.internal.provisional.core.IMessage


            int start = sdRegion.getStart();
            int lineNumber = getLineNumber(start);

            // SEVERITY_STRUCTURE == IMessage.HIGH_SEVERITY
            IMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
            message.setOffset(start);
            message.setLength(sdRegion.getTextLength());
            message.setLineNo(lineNumber);

            reporter.addMessage(this, message);
          }
        }
      }
View Full Code Here


       
        final List messages = reporter.getMessages();
    final List copy = new ArrayList(messages);

    for (Object o : messages) {
      final IMessage msg = (IMessage) o;
      if ((msg.getText().contains("apex:"))||(msg.getText().contains("c:"))) {
        copy.remove(o);
      }
    }

    reporter.removeAllMessages(validator);
View Full Code Here

    if (beanNode == null || text == null || messageText == null || document == null) {
      return;
    }

    if (showErrorMessage) {
      IMessage message = new LocalizedMessage(severity, messageText);
      message.setOffset(offset);
      message.setLength(length);
      try {
        message.setLineNo(document.getLineOfOffset(offset) + 1);
      }
      catch (BadLocationException e) {
        message.setLineNo(-1);
      }
      reporter.addMessage(this, message);
    }

    // TODO: investigate better way to make suggestion works for the last
    // position
    // messageEmpty does not show up in the editor, it is only
    // used for showing quick assist in the last cursor position
    IMessage messageEmpty = new LocalizedMessage(IMessage.ALL_MESSAGES, messageText);

    messageEmpty.setOffset(emptyMsgOffset);
    messageEmpty.setLength(emptyMsgLength);
    try {
      messageEmpty.setLineNo(document.getLineOfOffset(offset) + 1);
    }
    catch (BadLocationException e) {
      messageEmpty.setLineNo(-1);
    }

    if (reporter instanceof IncrementalReporter) {
      BeanQuickAssistProcessor processor = quickfixFactory.create(offset, length, text, missingEndQuote,
          beanNode, this, problemId, problemAttributes);

      if (processor != null) {
        messageEmpty.setAttribute(IQuickAssistProcessor.class.getName(), processor);

        AnnotationInfo info = new QuickfixAnnotationInfo(messageEmpty);

        IncrementalReporter incrementalReporter = (IncrementalReporter) reporter;
        AnnotationInfo[] existingInfos = incrementalReporter.getAnnotationInfo();
        for (AnnotationInfo existingInfo : existingInfos) {
          IMessage existingMessage = existingInfo.getMessage();

          if (existingMessage.getOffset() != messageEmpty.getOffset()) {
            continue;
          }
          if (!existingMessage.getText().equals(messageEmpty.getText())) {
            continue;
          }

          Object existingProcessor = existingMessage.getAttribute(IQuickAssistProcessor.class.getName());
          if (existingProcessor != null && existingProcessor.equals(processor)) {
            return;
          }
        }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.validation.internal.provisional.core.IMessage

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.