use of org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapterFactory in project webtools.sourceediting by eclipse.
the class ModelHandlerForJSP method ensureTranslationAdapterFactory.
public static void ensureTranslationAdapterFactory(IStructuredModel sm) {
if (sm.getFactoryRegistry().getFactoryFor(IJSPTranslation.class) == null) {
/*
* Check for tag/tagx files, otherwise add the JSP translation
* factory for better compatibility with other possible subtypes
* of JSP.
*/
IContentType thisContentType = Platform.getContentTypeManager().getContentType(sm.getContentTypeIdentifier());
IContentType tagContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSPTAG);
if (thisContentType.isKindOf(tagContentType)) {
INodeAdapterFactory factory = new TagTranslationAdapterFactory();
sm.getFactoryRegistry().addFactory(factory);
} else {
INodeAdapterFactory factory = null;
// }
if (factory == null) {
factory = new JSPTranslationAdapterFactory();
}
sm.getFactoryRegistry().addFactory(factory);
}
}
}
Aggregations