org.eclipse.jface.text.source
public class DefaultCharacterPairMatcher extends Object implements ICharacterPairMatcher
LEFT, RIGHT| Constructor and Description |
|---|
DefaultCharacterPairMatcher(char[] chars)
Creates a new character pair matcher that matches characters within the default partitioning.
|
DefaultCharacterPairMatcher(char[] chars,
String partitioning)
Creates a new character pair matcher that matches the specified characters within the
specified partitioning.
|
| Modifier and Type | Method and Description |
|---|---|
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 doc,
int offset)
Starting at the given offset, the matcher chooses a character close to this offset.
|
public DefaultCharacterPairMatcher(char[] chars,
String partitioning)
{ start, end, start, end, ..., start, end }For instance:
char[] chars = new char[] {'(', ')', '{', '}', '[', ']'};
new DefaultCharacterPairMatcher(chars, ...);
chars - a list of characterspartitioning - the partitioning to match withinpublic DefaultCharacterPairMatcher(char[] chars)
{ start, end, start, end, ..., start, end }For instance:
char[] chars= new char[] { '(', ')', '{', '}', '[', ']' };
new DefaultCharacterPairMatcher(chars);
chars - a list of characterspublic IRegion match(IDocument doc, int offset)
ICharacterPairMatchernull if there is no peer character.match in interface ICharacterPairMatcherdoc - the document to work onoffset - the start offsetpublic int getAnchor()
ICharacterPairMatchergetAnchor in interface ICharacterPairMatcherRIGHT or LEFTpublic void dispose()
ICharacterPairMatcherdispose in interface ICharacterPairMatcherpublic void clear()
ICharacterPairMatchermatch
method.clear in interface ICharacterPairMatcherGuidelines for using Eclipse APIs. Copyright (c) Eclipse contributors and others 2000, 2011. All rights reserved.