public class HtmlQuoteHandler extends java.lang.Object implements QuoteHandler
Constructor and Description |
---|
HtmlQuoteHandler() |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNonClosedLiteral(Editor editor,
HighlighterIterator iterator,
int offset)
Called after the quote has been inserted in the editor to check that it belongs
to an empty string literal that has only the opening quote and therefore, can be completed
by inserting the respective closing one.
|
boolean |
isClosingQuote(HighlighterIterator iterator,
int offset)
Checks whether there is the closing quote or the last one of the set of closing quotes
of a string literal at the given offset.
|
boolean |
isInsideLiteral(HighlighterIterator iterator) |
boolean |
isOpeningQuote(HighlighterIterator iterator,
int offset)
Checks whether there is the opening quote or the last one of the set of opening quotes
of a string literal at the given offset.
|
public boolean isClosingQuote(HighlighterIterator iterator, int offset)
QuoteHandler
Upon insertion, this method is called before the quote is actually inserted in the editor in order to check whether it's going to be typed over an existing one closing a string literal and, thus, should be omitted (only the caret position will be adjusted in this case).
isClosingQuote
in interface QuoteHandler
iterator
- highlighting iterator at the state corresponding to the offset
offset
- the offset at which the quote is going to be inserted/deletedpublic boolean isOpeningQuote(HighlighterIterator iterator, int offset)
QuoteHandler
isOpeningQuote
in interface QuoteHandler
iterator
- highlighting iterator at the state corresponding to the offset
offset
- the offset at which the quote was insertedpublic boolean hasNonClosedLiteral(Editor editor, HighlighterIterator iterator, int offset)
QuoteHandler
If both this method and QuoteHandler.isOpeningQuote(HighlighterIterator, int)
return true, the respective closing quote will be inserted automatically.
hasNonClosedLiteral
in interface QuoteHandler
editor
- an editor instance where the quote was insertediterator
- highlighting iterator at the state corresponding to the offset
offset
- the offset at which the quote was insertedQuoteHandler.isOpeningQuote(HighlighterIterator, int)
public boolean isInsideLiteral(HighlighterIterator iterator)
isInsideLiteral
in interface QuoteHandler