Search in sources :

Example 26 with ICharacterPairMatcher

use of org.eclipse.jface.text.source.ICharacterPairMatcher in project webtools.sourceediting by eclipse.

the class StructuredTextEditor method createCharacterPairMatcher.

protected ICharacterPairMatcher createCharacterPairMatcher() {
    ICharacterPairMatcher matcher = null;
    ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
    String[] ids = getConfigurationPoints();
    for (int i = 0; matcher == null && i < ids.length; i++) {
        matcher = (ICharacterPairMatcher) builder.getConfiguration(DocumentRegionEdgeMatcher.ID, ids[i]);
    }
    if (matcher == null) {
        matcher = new DefaultCharacterPairMatcher(new char[] { '(', ')', '{', '}', '[', ']', '<', '>', '"', '"', '\'', '\'' });
    }
    return matcher;
}
Also used : DefaultCharacterPairMatcher(org.eclipse.jface.text.source.DefaultCharacterPairMatcher) ICharacterPairMatcher(org.eclipse.jface.text.source.ICharacterPairMatcher) Point(org.eclipse.swt.graphics.Point) ExtendedConfigurationBuilder(org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder)

Aggregations

ICharacterPairMatcher (org.eclipse.jface.text.source.ICharacterPairMatcher)26 Test (org.junit.Test)12 DefaultCharacterPairMatcher (org.eclipse.jface.text.source.DefaultCharacterPairMatcher)3 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)2 Point (org.eclipse.swt.graphics.Point)2 IDocument (org.eclipse.jface.text.IDocument)1 IRegion (org.eclipse.jface.text.IRegion)1 ITextViewerExtension5 (org.eclipse.jface.text.ITextViewerExtension5)1 ISourceViewer (org.eclipse.jface.text.source.ISourceViewer)1 ExtendedConfigurationBuilder (org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder)1