public interface ITokenComparator extends IRangeComparator
IRangeComparator
interface
so that it can be used by the TextMergeViewer
.
TextMergeViewer
activates the token compare when navigating into
a range of differing lines. At first the lines are selected as a block.
When navigating into this block the token compare shows for every line
the differing token by selecting them.
TextMergeViewer
's default token comparator works on characters separated
by whitespace. If a different strategy is needed (for example, to use Java tokens in
a Java-aware merge viewer), clients may create their own token
comparators by implementing this interface (and overriding the
TextMergeViewer.createTokenComparator
factory method).
TextMergeViewer
Modifier and Type | Method and Description |
---|---|
int |
getTokenLength(int index)
Returns the character length of the token with the given index.
|
int |
getTokenStart(int index)
Returns the start character position of the token with the given index.
|
getRangeCount, rangesEqual, skipRangeComparison
int getTokenStart(int index)
index
- index of the token for which to return the start positionIndexOutOfBoundsException
- if index is negativeint getTokenLength(int index)
index
- index of the token for which to return the start positionIndexOutOfBoundsException
- if index is negative
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.