Package org.fife.ui.rsyntaxtextarea.parser

Examples of org.fife.ui.rsyntaxtextarea.parser.ParserNotice


                        textArea.getHighlighter();

      for (Iterator i=noticesToHighlights.entrySet().iterator();
          i.hasNext(); ) {
        Map.Entry entry = (Map.Entry)i.next();
        ParserNotice notice = (ParserNotice)entry.getKey();
        if (notice.getParser()==parser && entry.getValue()!=null) {
          h.removeParserHighlight(entry.getValue());
          i.remove();
        }
      }
View Full Code Here


                        textArea.getHighlighter();

      for (Iterator i=noticesToHighlights.entrySet().iterator();
          i.hasNext(); ) {
        Map.Entry entry = (Map.Entry)i.next();
        ParserNotice notice = (ParserNotice)entry.getKey();
        if (shouldRemoveNotice(notice, res)) {
          if (entry.getValue()!=null) {
            h.removeParserHighlight(entry.getValue());
          }
          i.remove();
View Full Code Here

    removeAll(); // listener is removed in Marker.removeNotify()
    Map markerMap = new HashMap();

    List notices = textArea.getParserNotices();
    for (Iterator i=notices.iterator(); i.hasNext(); ) {
      ParserNotice notice = (ParserNotice)i.next();
      if (notice.getLevel()<=levelThreshold ||
          (notice instanceof TaskNotice)) {
        // 1.5: Use Integer.valueOf(notice.getLine())
        Integer key = new Integer(notice.getLine());
        Marker m = (Marker)markerMap.get(key);
        if (m==null) {
          m = new Marker(notice);
          m.addMouseListener(listener);
          markerMap.put(key, m);
          add(m);
        }
        else {
          m.addNotice(notice);
        }
      }
    }

    if (getShowMarkedOccurrences() && textArea.getMarkOccurrences()) {
      List occurrences = textArea.getMarkedOccurrences();
      for (Iterator i=occurrences.iterator(); i.hasNext(); ) {
        DocumentRange range = (DocumentRange)i.next();
        int line = 0;
        try {
          line = textArea.getLineOfOffset(range.getStartOffset());
        } catch (BadLocationException ble) { // Never happens
          continue;
        }
        ParserNotice notice = new MarkedOccurrenceNotice(range);
        // 1.5: Use Integer.valueOf(notice.getLine())
        Integer key = new Integer(line);
        Marker m = (Marker)markerMap.get(key);
        if (m==null) {
          m = new Marker(notice);
View Full Code Here

    public Color getColor() {
      // Return the color for the highest-level parser.
      Color c = null;
      int lowestLevel = Integer.MAX_VALUE; // ERROR is 0
      for (Iterator i=notices.iterator(); i.hasNext(); ) {
        ParserNotice notice = (ParserNotice)i.next();
        if (notice.getLevel()<lowestLevel) {
          lowestLevel = notice.getLevel();
          c = notice.getColor();
        }
      }
      return c;
    }
View Full Code Here

      else { // > 1
        StringBuffer sb = new StringBuffer("<html>");
        sb.append(msg.getString("MultipleMarkers"));
        sb.append("<br>");
        for (int i=0; i<notices.size(); i++) {
          ParserNotice pn = (ParserNotice)notices.get(i);
          sb.append("&nbsp;&nbsp;&nbsp;- ");
          sb.append(pn.getMessage());
          sb.append("<br>");
        }
        text = sb.toString();
      }
View Full Code Here

      return text;

    }

    protected void mouseClicked(MouseEvent e) {
      ParserNotice pn = (ParserNotice)notices.get(0);
      int offs = pn.getOffset();
      int len = pn.getLength();
      if (offs>-1 && len>-1) { // These values are optional
        textArea.setSelectionStart(offs);
        textArea.setSelectionEnd(offs+len);
      }
      else {
        int line = pn.getLine();
        try {
          offs = textArea.getLineStartOffset(line);
          textArea.setCaretPosition(offs);
        } catch (BadLocationException ble) { // Never happens
          UIManager.getLookAndFeel().provideErrorFeedback(textArea);
View Full Code Here

        //}
      }
      */
      if (noticeHighlightPairs!=null) {
        for (NoticeHighlightPair pair : noticeHighlightPairs) {
          ParserNotice notice = pair.notice;
          if (noticeContainsPosition(notice, pos) &&
              noticeContainsPointInView(notice, p)) {
            tip = notice.getToolTipText();
            parserForTip = notice.getParser();
            if (parserForTip instanceof HyperlinkListener) {
              listener = (HyperlinkListener)parserForTip;
            }
            break;
          }
View Full Code Here

      try {
        line = textArea.getLineOfOffset(range.getStartOffset());
      } catch (BadLocationException ble) { // Never happens
        continue;
      }
      ParserNotice notice = new MarkedOccurrenceNotice(range, color);
      Integer key = Integer.valueOf(line);
      Marker m = markerMap.get(key);
      if (m==null) {
        m = new Marker(notice);
        m.addMouseListener(listener);
View Full Code Here

      else { // > 1
        StringBuilder sb = new StringBuilder("<html>");
        sb.append(msg.getString("MultipleMarkers"));
        sb.append("<br>");
        for (int i=0; i<notices.size(); i++) {
          ParserNotice pn = notices.get(i);
          sb.append("&nbsp;&nbsp;&nbsp;- ");
          sb.append(pn.getMessage());
          sb.append("<br>");
        }
        text = sb.toString();
      }
View Full Code Here

      return text;

    }

    protected void mouseClicked(MouseEvent e) {
      ParserNotice pn = notices.get(0);
      int offs = pn.getOffset();
      int len = pn.getLength();
      if (offs>-1 && len>-1) { // These values are optional
        textArea.setSelectionStart(offs);
        textArea.setSelectionEnd(offs+len);
      }
      else {
        int line = pn.getLine();
        try {
          offs = textArea.getLineStartOffset(line);
          textArea.setCaretPosition(offs);
        } catch (BadLocationException ble) { // Never happens
          UIManager.getLookAndFeel().provideErrorFeedback(textArea);
View Full Code Here

TOP

Related Classes of org.fife.ui.rsyntaxtextarea.parser.ParserNotice

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.