use of org.eclipse.jface.text.source.DefaultCharacterPairMatcher in project abstools by abstools.
the class ABSEditor method configureSourceViewerDecorationSupport.
@Override
protected void configureSourceViewerDecorationSupport(SourceViewerDecorationSupport support) {
IPreferenceStore store = getPreferenceStore();
store.setValue(LOCATION_TYPE_NEAR_TEXTSTYLE_KEY, LOCATION_TYPE_NEAR_TEXTSTYLE_VALUE);
store.setValue(LOCATION_TYPE_FAR_TEXTSTYLE_KEY, LOCATION_TYPE_FAR_TEXTSTYLE_VALUE);
store.setValue(LOCATION_TYPE_SOMEWHERE_TEXTSTYLE_KEY, LOCATION_TYPE_SOMEWHERE_TEXTSTYLE_VALUE);
super.configureSourceViewerDecorationSupport(support);
// which brackets to match
char[] matchChars = { '(', ')', '[', ']', '{', '}' };
ICharacterPairMatcher matcher = new DefaultCharacterPairMatcher(matchChars, IDocumentExtension3.DEFAULT_PARTITIONING);
support.setCharacterPairMatcher(matcher);
support.setMatchingCharacterPainterPreferenceKeys(EDITOR_MATCHING_BRACKETS, EDITOR_MATCHING_BRACKETS_COLOR);
// Enable bracket highlighting in the preference store
store.setDefault(EDITOR_MATCHING_BRACKETS, true);
store.setDefault(EDITOR_MATCHING_BRACKETS_COLOR, Constants.DEFAULT_MATCHING_BRACKETS_COLOR);
}
use of org.eclipse.jface.text.source.DefaultCharacterPairMatcher in project jbosstools-hibernate by jbosstools.
the class HQLEditor method configureSourceViewerDecorationSupport.
@Override
protected void configureSourceViewerDecorationSupport(SourceViewerDecorationSupport support) {
super.configureSourceViewerDecorationSupport(support);
// which brackets to match
char[] matchChars = { '(', ')', '[', ']', '{', '}' };
ICharacterPairMatcher matcher = new DefaultCharacterPairMatcher(matchChars, IDocumentExtension3.DEFAULT_PARTITIONING);
support.setCharacterPairMatcher(matcher);
support.setMatchingCharacterPainterPreferenceKeys(HQL_EDITOR_MATCHING_BRACKETS, HQL_EDITOR_MATCHING_BRACKETS_COLOR);
// Enable bracket highlighting in the preference store
IPreferenceStore store = getPreferenceStore();
store.setDefault(HQL_EDITOR_MATCHING_BRACKETS, true);
// $NON-NLS-1$
store.setDefault(HQL_EDITOR_MATCHING_BRACKETS_COLOR, "128,128,128");
}
use of org.eclipse.jface.text.source.DefaultCharacterPairMatcher in project xtext-eclipse by eclipse.
the class BracePairMatcher method setBracePairProvider.
@Inject
public void setBracePairProvider(final IBracePairProvider bracePairProvider) {
final ArrayList<Character> chars = this.getChars(bracePairProvider);
DefaultCharacterPairMatcher _defaultCharacterPairMatcher = new DefaultCharacterPairMatcher(((char[]) Conversions.unwrapArray(chars, char.class)));
this.characterPairMatcher = _defaultCharacterPairMatcher;
}
use of org.eclipse.jface.text.source.DefaultCharacterPairMatcher 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;
}
Aggregations