public final class MatcherContext extends Object
BracesMatcher. This context is created by the
editor infrastructure when it needs to create a matcher by using a registered
BracesMatcherFactory. The context provides a matcher with
information essential to perform the search.| Modifier and Type | Method and Description |
|---|---|
Document |
getDocument()
Gets a document that should be searched for matching areas.
|
int |
getLimitOffset()
Gets an offset in a document towards which the search should go.
|
int |
getSearchLookahead()
Gets the number of characters to search through when looking for an original
area.
|
int |
getSearchOffset()
Gets an offset in a document where searching should start.
|
boolean |
isSearchingBackward()
Gets the direction to search in for an original area.
|
static boolean |
isTaskCanceled()
Determines if a braces matching task was canceled.
|
public Document getDocument()
public int getSearchOffset()
public boolean isSearchingBackward()
true to search backward towards the beginning of
a document or false to search forward towards the end of
a document.public int getLimitOffset()
searchOffset ± searchLookahead depending on
the search direction.searchOffset ± searchLookahead.public int getSearchLookahead()
public static boolean isTaskCanceled()
IMPORTANT: This method may only
be called from the thread running a braces matching task, ie. the one
that calls your BracesMatcher's findOrigin and
findMatches methods. Calling this method from a different thread
will assert and fail.
true if the task was canceled, false otherwiseBuilt on May 16 2013. | Portions Copyright 1997-2013 Oracle. All rights reserved.