public SpellcheckStrategy(ISourceViewer viewer, String contentTypeId) {
super(viewer);
fContentTypeId = contentTypeId;
fSpellingContext = new SpellingContext();
IContentType contentType = Platform.getContentTypeManager().getContentType(fContentTypeId);
fSpellingContext.setContentType(contentType);
fReconcileAnnotationKey = new ReconcileAnnotationKey(fSpellingStep, KEY_CONTENT_TYPE, ReconcileAnnotationKey.PARTIAL);
/**
* Inherit spelling region rules
*/
List contexts = new ArrayList();
IContentType testType = contentType;
while (testType != null) {
String[] textRegionContexts = ExtendedConfigurationBuilder.getInstance().getDefinitions(EXTENDED_BUILDER_TYPE_CONTEXTS, testType.getId());
for (int j = 0; j < textRegionContexts.length; j++) {
contexts.addAll(Arrays.asList(StringUtils.unpack(textRegionContexts[j])));
}
testType = testType.getBaseType();
}
fSupportedTextRegionContexts = (String[]) contexts.toArray(new String[contexts.size()]);
fSpellCheckPreferenceListener = new SpellCheckPreferenceListener();
}