Search in sources :

Example 1 with ITextStore

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;
}
Also used : ITextStore(org.eclipse.jface.text.ITextStore)

Example 2 with ITextStore

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);
    }
}
Also used : ITextStore(org.eclipse.jface.text.ITextStore) RegionParser(org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser)

Example 3 with ITextStore

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;
}
Also used : ITextStore(org.eclipse.jface.text.ITextStore)

Aggregations

ITextStore (org.eclipse.jface.text.ITextStore)3 RegionParser (org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser)1