|
Eclipse Platform Release 4.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ICharacterPairMatcher
A character pair matcher finds to a character at a certain document offset the matching peer character. It is the matchers responsibility to define the concepts of "matching" and "peer". The matching process starts at a given offset. Starting of this offset, the matcher chooses a character close to this offset. The anchor defines whether the chosen character is left or right of the initial offset. The matcher then searches for the matching peer character of the chosen character and if it finds one, delivers the minimal region of the document that contains both characters.
In order to provide backward compatibility for clients of ICharacterPairMatcher
,
extension interfaces are used to provide a means of evolution. The following extension interface
exists:
ICharacterPairMatcherExtension
since version 3.8
introducing the concept of matching peer character and enclosing peer characters for a given
selection.
Clients may implement this interface and its extension interface or use the default
implementation provided by DefaultCharacterPairMatcher
.
ICharacterPairMatcherExtension
Field Summary | |
---|---|
static int |
LEFT
Indicates the anchor value "left". |
static int |
RIGHT
Indicates the anchor value "right". |
Method Summary | |
---|---|
void |
clear()
Clears this pair matcher. |
void |
dispose()
Disposes this pair matcher. |
int |
getAnchor()
Returns the anchor for the region of the matching peer characters. |
IRegion |
match(IDocument document,
int offset)
Starting at the given offset, the matcher chooses a character close to this offset. |
Field Detail |
---|
static final int RIGHT
static final int LEFT
Method Detail |
---|
void dispose()
void clear()
match
method.
IRegion match(IDocument document, int offset)
Since version 3.8 the recommended way for finding matching peers is to use
ICharacterPairMatcherExtension.match(IDocument, int, int)
.
document
- the document to work onoffset
- the start offset
null
if there is no
peer character.int getAnchor()
RIGHT
or LEFT
|
Eclipse Platform Release 4.2 |
|||||||||
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, 2013. All rights reserved.