use of org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler in project webtools.sourceediting by eclipse.
the class ModelManagerImpl method createUnManagedStructuredModelFor.
/**
* Conveience method. It depends on the loaders newModel method to return
* an appropriate StrucuturedModel appropriately initialized.
*/
public IStructuredModel createUnManagedStructuredModelFor(String contentTypeId, URIResolver resolver) {
IStructuredModel result = null;
ModelHandlerRegistry cr = getModelHandlerRegistry();
IModelHandler handler = cr.getHandlerForContentTypeId(contentTypeId);
try {
// $NON-NLS-1$
result = _commonCreateModel(UNMANAGED_MODEL, handler, resolver);
} catch (ResourceInUse e) {
// this may need to be re-examined.
if (Logger.DEBUG_MODELMANAGER)
// $NON-NLS-1$ //$NON-NLS-2$
Logger.log(Logger.INFO, "ModelMangerImpl::createUnManagedStructuredModelFor. Model unexpectedly in use.");
}
return result;
}
use of org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler in project webtools.sourceediting by eclipse.
the class TestModelHandlers method testCSSExistsFromFilename.
public void testCSSExistsFromFilename() throws IOException {
String filename = "test.css";
ModelHandlerRegistry registry = getModelHandlerRegistry();
IModelHandler handler = registry.getHandlerFor(filename, null);
assertTrue("model handler registry does not have CSS type ", handler != null && handler.getAssociatedContentTypeId().equals(ContentTypeIdForCSS.ContentTypeID_CSS));
}
use of org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler in project webtools.sourceediting by eclipse.
the class TestModelHandlers method testHTMLExistsFromFilename.
public void testHTMLExistsFromFilename() throws IOException {
String filename = "test.html";
ModelHandlerRegistry registry = getModelHandlerRegistry();
IModelHandler handler = registry.getHandlerFor(filename, null);
assertTrue("model handler registry does not have HTML type ", handler != null && handler.getAssociatedContentTypeId().equals(ContentTypeIdForHTML.ContentTypeID_HTML));
}
use of org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler in project webtools.sourceediting by eclipse.
the class TestModelHandlers method testDTDExistsFromFilename.
public void testDTDExistsFromFilename() throws IOException {
String filename = "test.dtd";
ModelHandlerRegistry registry = getModelHandlerRegistry();
IModelHandler handler = registry.getHandlerFor(filename, null);
assertTrue("model handler registry does not have DTD type ", handler != null && handler.getAssociatedContentTypeId().equals("org.eclipse.wst.dtd.core.dtdsource"));
}
use of org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler in project webtools.sourceediting by eclipse.
the class TestModelHandlers method testHTMLExists.
public void testHTMLExists() {
String id = ContentTypeIdForHTML.ContentTypeID_HTML;
ModelHandlerRegistry registry = getModelHandlerRegistry();
IModelHandler handler = registry.getHandlerForContentTypeId(id);
assertTrue("model handler registry does not have HTML type ", handler != null && handler.getAssociatedContentTypeId().equals(id));
}
Aggregations