|
Eclipse Platform Kepler (4.3) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ICharacterPairMatcherExtension
Extension interface for ICharacterPairMatcher
.
Extends the character pair matcher with the concept of matching peer character and enclosing peer characters for a given selection.
ICharacterPairMatcher
Method Summary | |
---|---|
IRegion |
findEnclosingPeerCharacters(IDocument document,
int offset,
int length)
Starting at the given selection, the matcher searches for a pair of enclosing peer characters and if it finds one, returns the minimal region of the document that contains the pair. |
boolean |
isMatchedChar(char ch)
Checks whether the character is one of the characters matched by the pair matcher. |
boolean |
isMatchedChar(char ch,
IDocument document,
int offset)
Checks whether the character is one of the characters matched by the pair matcher. |
boolean |
isRecomputationOfEnclosingPairRequired(IDocument document,
IRegion currentSelection,
IRegion previousSelection)
Computes whether a client needs to recompute the enclosing pair after a selection change in the document. |
IRegion |
match(IDocument document,
int offset,
int length)
Starting at the given offset (i.e. length 0) or the selected character, the matcher searches for the matching peer character and if it finds one, returns the minimal region of the document that contains both characters. |
Method Detail |
---|
IRegion match(IDocument document, int offset, int length)
document
- the document to work onoffset
- the start offsetlength
- the selection length which can be negative indicating right-to-left selection
null
if there is no
peer characterIRegion findEnclosingPeerCharacters(IDocument document, int offset, int length)
document
- the document to work onoffset
- the start offsetlength
- the selection length which can be negative indicating right-to-left selection
null
if there is no
enclosing pairboolean isMatchedChar(char ch)
ch
- the character
true
if the the character is one of the characters matched by the pair
matcher, and false
otherwiseboolean isMatchedChar(char ch, IDocument document, int offset)
Clients can use this method to handle characters which may have special meaning in some situations. E.g. in Java, '<' is used as an angular bracket and as well as less-than operator.
ch
- the characterdocument
- the documentoffset
- the offset in document
true
if the the character is one of the characters matched by the pair
matcher, and false
otherwiseboolean isRecomputationOfEnclosingPairRequired(IDocument document, IRegion currentSelection, IRegion previousSelection)
This is intended to be a quick test to determine whether a re-computation of the enclosing pair is
required, as the re-computation after each selection change via a
findEnclosingPeerCharacters(IDocument, int, int)
call can be expensive for some
clients.
document
- the document to work oncurrentSelection
- the current selection in the documentpreviousSelection
- the previous selection in the document
true
if the enclosing pair needs to be recomputed, false
otherwise
|
Eclipse Platform Kepler (4.3) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2012. All rights reserved.