use of org.eclipse.wst.sse.core.internal.provisional.IModelManager in project webtools.sourceediting by eclipse.
the class UnitTests method setUpXML.
/**
* Set up an XML model
*/
protected void setUpXML() {
IModelManager mm = StructuredModelManager.getModelManager();
try {
fModel = mm.createStructuredDocumentFor("dummy.xml", (InputStream) null, null);
} catch (IOException e) {
// do nothing, since dummy
}
fModel.addDocumentChangedListener(proxy);
tree = new DOMModelImpl();
if (tree != null) {
fModel.addDocumentChangingListener((IStructuredDocumentListener) tree);
tree.setStructuredDocument(fModel);
}
}
use of org.eclipse.wst.sse.core.internal.provisional.IModelManager in project webtools.sourceediting by eclipse.
the class UnitTests method setUpJSP.
/**
* Set up a JSP model
*/
protected void setUpJSP() {
IModelManager mm = StructuredModelManager.getModelManager();
try {
fModel = mm.createStructuredDocumentFor("dummy.jsp", (InputStream) null, null);
} catch (IOException e) {
// do nothing, since dummy
}
fModel = StructuredDocumentFactory.getNewStructuredDocumentInstance(new JSPSourceParser());
fModel.addDocumentChangedListener(proxy);
tree = new DOMModelImpl();
if (tree != null) {
fModel.addDocumentChangingListener((IStructuredDocumentListener) tree);
tree.setStructuredDocument(fModel);
}
}
use of org.eclipse.wst.sse.core.internal.provisional.IModelManager in project webtools.sourceediting by eclipse.
the class ModelModifications method createXMLModel.
/**
* Be sure to release any models obtained from this method.
*
* @return
* @throws IOException
* @throws UnsupportedEncodingException
*/
private static IDOMModel createXMLModel() throws UnsupportedEncodingException, IOException {
IStructuredModel model = null;
IModelManager modelManager = StructuredModelManager.getModelManager();
model = modelManager.getModelForEdit("test.xml", new NullInputStream(), null);
// always use the same line delimiter for these tests, regardless
// of
// plaform or preference settings
model.getStructuredDocument().setLineDelimiter(TestWriter.commonEOL);
return (IDOMModel) model;
}
use of org.eclipse.wst.sse.core.internal.provisional.IModelManager in project webtools.sourceediting by eclipse.
the class TestCSSContentAssist method loadFile.
protected void loadFile() throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException {
IModelManager modelManager = StructuredModelManager.getModelManager();
model = modelManager.getModelForEdit(file);
document = model.getStructuredDocument();
}
use of org.eclipse.wst.sse.core.internal.provisional.IModelManager in project webtools.sourceediting by eclipse.
the class TestXSLHyperlinkDetector method loadXSLFile.
protected void loadXSLFile() throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException {
IModelManager modelManager = StructuredModelManager.getModelManager();
model = modelManager.getNewModelForEdit(file, true);
document = model.getStructuredDocument();
IDocumentPartitioner partitioner = defaultPartitioner.newInstance();
partitioner.connect(document);
document.setDocumentPartitioner(partitioner);
}
Aggregations