use of org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument in project webtools.sourceediting by eclipse.
the class ModelModifications method testRepDocumentHTMLMods.
public void testRepDocumentHTMLMods() throws UnsupportedEncodingException, IOException {
// assumes 0-byte html empty file
IDOMModel model = null;
model = createHTMLModel();
try {
IDOMDocument doc = model.getDocument();
Element ele = doc.createElement(HTML40Namespace.ElementName.P);
doc.appendChild(ele);
IStructuredDocument structuredDocument = model.getStructuredDocument();
structuredDocument.replaceText(this, 0, structuredDocument.getLength(), "<tag>text</tag>");
Element ele2 = doc.createElement(HTML40Namespace.ElementName.P);
doc.appendChild(ele2);
} finally {
if (model != null) {
model.releaseFromEdit();
}
}
}
use of org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument in project webtools.sourceediting by eclipse.
the class ModelModifications method testRepDocumentJSPMods.
public void testRepDocumentJSPMods() throws UnsupportedEncodingException, IOException {
// assumes 0-byte html empty file
IDOMModel model = null;
model = createJSPModel();
try {
IDOMDocument doc = model.getDocument();
Element ele = doc.createElement(HTML40Namespace.ElementName.P);
doc.appendChild(ele);
IStructuredDocument structuredDocument = model.getStructuredDocument();
structuredDocument.replaceText(this, 0, structuredDocument.getLength(), "<tag>text</tag>");
Element ele2 = doc.createElement(HTML40Namespace.ElementName.P);
doc.appendChild(ele2);
} finally {
if (model != null) {
model.releaseFromEdit();
}
}
}
use of org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument in project webtools.sourceediting by eclipse.
the class ModelModifications method testSetDocumentXMLMods.
public void testSetDocumentXMLMods() throws UnsupportedEncodingException, IOException {
// assumes 0-byte html empty file
IDOMModel model = null;
model = createXMLModel();
try {
IDOMDocument doc = model.getDocument();
Element ele = doc.createElement(HTML40Namespace.ElementName.P);
doc.appendChild(ele);
IStructuredDocument structuredDocument = model.getStructuredDocument();
structuredDocument.setText(this, "");
Element ele2 = doc.createElement(HTML40Namespace.ElementName.P);
doc.appendChild(ele2);
} finally {
if (model != null) {
model.releaseFromEdit();
}
}
}
use of org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument in project webtools.sourceediting by eclipse.
the class ModelModifications method testSetDocumentHTMLMods.
public void testSetDocumentHTMLMods() throws UnsupportedEncodingException, IOException {
// assumes 0-byte html empty file
IDOMModel model = null;
model = createHTMLModel();
try {
IDOMDocument doc = model.getDocument();
Element ele = doc.createElement(HTML40Namespace.ElementName.P);
doc.appendChild(ele);
IStructuredDocument structuredDocument = model.getStructuredDocument();
structuredDocument.setText(this, "");
Element ele2 = doc.createElement(HTML40Namespace.ElementName.P);
doc.appendChild(ele2);
} finally {
if (model != null) {
model.releaseFromEdit();
}
}
}
use of org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument in project webtools.sourceediting by eclipse.
the class ModelModifications method testRepDocumentXMLMods.
public void testRepDocumentXMLMods() throws UnsupportedEncodingException, IOException {
// assumes 0-byte html empty file
IDOMModel model = null;
model = createXMLModel();
try {
IDOMDocument doc = model.getDocument();
Element ele = doc.createElement(HTML40Namespace.ElementName.P);
doc.appendChild(ele);
IStructuredDocument structuredDocument = model.getStructuredDocument();
structuredDocument.replaceText(this, 0, structuredDocument.getLength(), "<tag>text</tag>");
Element ele2 = doc.createElement(HTML40Namespace.ElementName.P);
doc.appendChild(ele2);
} finally {
if (model != null) {
model.releaseFromEdit();
}
}
}
Aggregations