public void actionPerformed(ActionEvent evt, JTextComponent target) { if (target != null) { try { Caret caret = target.getCaret(); BaseDocument doc = Utilities.getDocument(target); int dotPos = caret.getDot(); ExtSyntaxSupport sup = (ExtSyntaxSupport) doc.getSyntaxSupport(); if (dotPos > 0) { int[] matchBlk = sup.findMatchingBlock(dotPos - 1, false); if (matchBlk != null) { if (select) { caret.moveDot(matchBlk[1]); } else { caret.setDot(matchBlk[1]); } } } } catch (BadLocationException e) { target.getToolkit().beep(); } } } }
public void actionPerformed(ActionEvent evt, JTextComponent target) { if (target != null) { try { Caret caret = target.getCaret(); BaseDocument doc = Utilities.getDocument(target); int dotPos = caret.getDot(); ExtSyntaxSupport sup = (ExtSyntaxSupport)doc.getSyntaxSupport(); if (dotPos > 0) { int[] matchBlk = sup.findMatchingBlock(dotPos - 1, false); if (matchBlk != null) { if (select) { caret.moveDot(matchBlk[1]); } else { caret.setDot(matchBlk[1]); } } } } catch (BadLocationException e) { target.getToolkit().beep(); } } } }
int[] matchBlk = ((ExtSyntaxSupport) doc.getSyntaxSupport()).findMatchingBlock(dotPos - 1, simpleMatchBrace); if (matchBlk != null) { if (highlightBraceStartMark != null) {
if (dotPos > 0) { int[] matchBlk = ((ExtSyntaxSupport)doc.getSyntaxSupport()) .findMatchingBlock(dotPos - 1, simpleMatchBrace); if (matchBlk != null) { if (highlightBraceStartMark != null) {