use of org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument in project liferay-ide by liferay.
the class AlloyJSPDocumentFactory method createDocument.
@Override
public IDocument createDocument() {
IModelHandler handler = null;
IContentType contentType = Platform.getContentTypeManager().getContentType("com.liferay.ide.alloy.core.alloyjspsource");
while ((handler == null) && !IContentTypeManager.CT_TEXT.equals(contentType.getId())) {
handler = ModelHandlerRegistry.getInstance().getHandlerForContentTypeId(contentType.getId());
contentType = contentType.getBaseType();
}
if (handler != null) {
return handler.getDocumentLoader().createNewStructuredDocument();
} else {
return new JobSafeStructuredDocument();
}
}
use of org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument in project webtools.sourceediting by eclipse.
the class BasicStructuredDocumentFactory method createDocument.
/*
* (non-Javadoc)
*
* @see org.eclipse.core.filebuffers.IDocumentFactory#createDocument()
*/
public IDocument createDocument() {
IDocument document = null;
IContentType contentType = Platform.getContentTypeManager().getContentType(getContentTypeIdentifier());
IModelHandler handler = null;
while (handler == null && !IContentTypeManager.CT_TEXT.equals(contentType.getId())) {
handler = ModelHandlerRegistry.getInstance().getHandlerForContentTypeId(contentType.getId());
contentType = contentType.getBaseType();
}
if (handler != null) {
document = handler.getDocumentLoader().createNewStructuredDocument();
} else {
document = new JobSafeStructuredDocument();
}
return document;
}
Aggregations