use of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument in project webtools.sourceediting by eclipse.
the class TestAboutToBeChangedEvent method testGetStructuredDocument.
public void testGetStructuredDocument() {
AboutToBeChangedEvent event = getBasicEvent();
IStructuredDocument d = event.getStructuredDocument();
assertNotNull(d);
}
use of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument in project webtools.sourceediting by eclipse.
the class TestAboutToBeChangedEvent method getBasicEvent.
private AboutToBeChangedEvent getBasicEvent() {
IStructuredDocument document = StructuredDocumentFactory.getNewStructuredDocumentInstance(new NullParser());
AboutToBeChangedEvent event = new AboutToBeChangedEvent(document, this, "test", 0, 0);
return event;
}
use of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument in project webtools.sourceediting by eclipse.
the class TestNewDocumentEvent method getBasicEvent.
private NewDocumentEvent getBasicEvent() {
IStructuredDocument document = StructuredDocumentFactory.getNewStructuredDocumentInstance(new NullParser());
document.setText(this, testString);
NewDocumentEvent event = new NewDocumentEvent(document, this);
return event;
}
use of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument in project webtools.sourceediting by eclipse.
the class TestRegionChangedEvent method getBasicEvent.
private RegionChangedEvent getBasicEvent() {
IStructuredDocument document = StructuredDocumentFactory.getNewStructuredDocumentInstance(new NullParser());
document.setText(this, testString);
RegionChangedEvent event = new RegionChangedEvent(document, this, null, null, "", 0, 0);
return event;
}
use of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument in project webtools.sourceediting by eclipse.
the class JSONDocumentTest method addSpaceBeforeStartObject.
@Test
public void addSpaceBeforeStartObject() throws Exception {
IJSONModel model = (IJSONModel) TestUtil.createModel();
IStructuredDocument structuredDocument = model.getStructuredDocument();
IJSONDocument document = model.getDocument();
assertNull(document.getFirstChild());
// Add a JSON Object
structuredDocument.set("{}");
assertNotNull(document.getFirstChild());
Assert.assertTrue(document.getFirstChild() instanceof IJSONObject);
IJSONObject object1 = (IJSONObject) document.getFirstChild();
// object is closed
Assert.assertNotNull(object1.getEndStructuredDocumentRegion());
// Add space
structuredDocument.replaceText(structuredDocument, 0, 0, " ");
assertNotNull(document.getFirstChild());
IJSONObject object2 = (IJSONObject) document.getFirstChild();
Assert.assertNotNull(object2.getEndStructuredDocumentRegion());
}
Aggregations