Examples of addHighlight()


Examples of javax.swing.text.Highlighter.addHighlight()

            textComp.setCaretPosition(pos + pattern.length());
            textComp.setSelectionStart(pos);
            textComp.setSelectionEnd(pos + pattern.length());
          } else {
            for (; (pos = text.indexOf(pattern, pos)) >= 0; pos += pattern.length())
              hilite.addHighlight(pos, pos + pattern.length(), myHighlightPainter);

          }
      } catch (BadLocationException badlocationexception) {
      }
  }
View Full Code Here

Examples of javax.swing.text.Highlighter.addHighlight()

    highlighter.removeAllHighlights();

    try {
      i = toComponentPosition(comp, i);
      j = toComponentPosition(comp, j);
      highlighter.addHighlight(i, j+1, DefaultHighlighter.DefaultPainter);
      if (scroll) {
        if (comp.getCaretPosition() < i || comp.getCaretPosition() > j) {
          comp.moveCaretPosition(i);
          comp.scrollRectToVisible(comp.modelToView(i));
        }
View Full Code Here

Examples of javax.swing.text.Highlighter.addHighlight()

            if (tag != null) {
                highlighter.removeHighlight(tag);
                highlightTags.remove(highlighter);
            }
            try {
                tag = highlighter.addHighlight(start, end,
                                               new LinkHighlightPainter());
                highlightTags.put(highlighter, tag);
                editor.getCaret().setDot(start);
            } catch (final BadLocationException e) {
            }
View Full Code Here

Examples of javax.swing.text.Highlighter.addHighlight()

        // parameters.
        tc.replaceSelection(sb.toString());
        for (int i=0; i<paramCount; i++) {
          Point pt = (Point)paramLocs.get(i);
           // "-1" is a workaround for Java Highlight issues.
          tags.add(h.addHighlight(pt.x-1, pt.y, p));
        }

        // Go back and start at the first parameter.
        tc.setCaretPosition(dot);
        if (pc.getParamCount()>0) {
View Full Code Here

Examples of javax.swing.text.Highlighter.addHighlight()

       
        Highlighter hilite = txtArea.getHighlighter();
        HighlightPainter painter = new DefaultHighlighter.DefaultHighlightPainter(Color.LIGHT_GRAY);
        try {
      hilite.removeAllHighlights();
      hilite.addHighlight(sm.getStart(), sm.getEnd(), painter);
      txtArea.setCaretPosition(sm.getStart());
    } catch (BadLocationException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
View Full Code Here

Examples of javax.swing.text.Highlighter.addHighlight()

                    wholeWord, regex);
      while (found) {
        int start = getSelectionStart();
        int end = getSelectionEnd();
        try {
          markAllHighlights.add(h.addHighlight(start, end,
                    markAllHighlightPainter));
        } catch (BadLocationException ble) {
          ble.printStackTrace();
        }
        numMarked++;
View Full Code Here

Examples of javax.swing.text.Highlighter.addHighlight()

                firstCodeFileInfo = codeFileInfo;
                firstSnippet = snippets[0];
            }
            for (Snippet snippet : snippets) {
                try {
                    highlighter.addHighlight(snippet.startLine,
                            snippet.endLine, snippetPainter );
                    codeFileInfo.veneer.repaint();
                } catch (BadLocationException e) {
                    e.printStackTrace();
                }
View Full Code Here

Examples of javax.swing.text.Highlighter.addHighlight()

      startPos= text.indexOf('\n', startPos) + 1;
    }
    endPos= text.indexOf('\n', startPos) + 1;

    try {
      hLiter.addHighlight(startPos, endPos, painter);
    } catch (BadLocationException e) {
      // ignore it, but clear everything. This has to do with
      // not knowing the actual pseuco file
      input.getHighlighter().removeAllHighlights();
    }
View Full Code Here

Examples of javax.swing.text.Highlighter.addHighlight()



    for (Span span : grammarErrors) {
      try {
        h.addHighlight(span.start, span.end, bhp);
      } catch (BadLocationException ex) {
        //Tools.showError(ex);
      }
    }
    for (Span span : spellErrors) {
View Full Code Here

Examples of javax.swing.text.Highlighter.addHighlight()

        //Tools.showError(ex);
      }
    }
    for (Span span : spellErrors) {
      try {
        h.addHighlight(span.start, span.end, rhp);
      } catch (BadLocationException ex) {
        //Tools.showError(ex);
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.