|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cburch.editor.BracketMatcher
public class BracketMatcher
Handles parenthesis matching, both in highlighting unmatched parentheses and in displaying the matches of the parenthesis under the caret. (It works equally well for parentheses, braces, and brackets. We can use the terms interchangably here.)
| Constructor Summary | |
|---|---|
BracketMatcher(Editor editor,
TokenType openType,
TokenType closeType,
java.lang.String errorMessage)
Constructs a matcher for a particular editor. |
|
| Method Summary | |
|---|---|
boolean |
isCaretMatchHighlighted()
Returns true if the editor should display
the bracket matching the bracket underneath the caret. |
boolean |
isUnmatchedHighlighted()
Returns true if unmatched brackets should be
highlighted as "errors." |
void |
setCaretMatchHighlighted(boolean value)
Controls whether the matcher will display the bracket matching the bracket underneath the caret. |
void |
setUnmatchedHighlighted(boolean value)
Controls whether the matcher will highlight unmatched brackets. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BracketMatcher(Editor editor,
TokenType openType,
TokenType closeType,
java.lang.String errorMessage)
editor - The editor we should listen to.openType - The token category used for opening brackets.closeType - The token category used for closing brackets.| Method Detail |
|---|
public boolean isCaretMatchHighlighted()
true if the editor should display
the bracket matching the bracket underneath the caret.
true if the matches are displayed.public void setCaretMatchHighlighted(boolean value)
value - true if the current match should be
highlighted, false if it should not be.public boolean isUnmatchedHighlighted()
true if unmatched brackets should be
highlighted as "errors."
true if the unmatched brackets are
highlighted, false if they are not.public void setUnmatchedHighlighted(boolean value)
value - true if the matcher should
highlight unmatched brackets, false if
it should not.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||