use of org.eclipse.jface.text.ITextStore in project webtools.sourceediting by eclipse.
the class BasicStructuredDocument method regionMatches.
/*
* (non-Javadoc)
*
* @see org.eclipse.wst.sse.core.internal.text.IRegionComparible#regionMatches(int,
* int, java.lang.String)
*/
public boolean regionMatches(int offset, int length, String stringToCompare) {
boolean result = false;
ITextStore store = getStore();
if (store instanceof IRegionComparible) {
result = ((IRegionComparible) store).regionMatches(offset, length, stringToCompare);
} else {
result = get(offset, length).equals(stringToCompare);
}
return result;
}
use of org.eclipse.jface.text.ITextStore in project webtools.sourceediting by eclipse.
the class BasicStructuredDocument method resetParser.
void resetParser(int startOffset, int endOffset) {
RegionParser parser = getParser();
ITextStore textStore = getStore();
if (textStore instanceof CharSequence) {
CharSequenceReader subSetTextStoreReader = new CharSequenceReader((CharSequence) textStore, startOffset, endOffset - startOffset);
parser.reset(subSetTextStoreReader, startOffset);
} else {
String newNodeText = get(startOffset, endOffset - startOffset);
parser.reset(newNodeText, startOffset);
}
}
use of org.eclipse.jface.text.ITextStore in project webtools.sourceediting by eclipse.
the class BasicStructuredDocument method regionMatchesIgnoreCase.
public boolean regionMatchesIgnoreCase(int offset, int length, String stringToCompare) {
boolean result = false;
ITextStore store = getStore();
if (store instanceof IRegionComparible) {
result = ((IRegionComparible) store).regionMatchesIgnoreCase(offset, length, stringToCompare);
} else {
result = get(offset, length).equalsIgnoreCase(stringToCompare);
}
return result;
}
Aggregations