use of org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent 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.events.NewDocumentEvent in project webtools.sourceediting by eclipse.
the class CSSModelImpl method setStructuredDocument.
public void setStructuredDocument(IStructuredDocument newStructuredDocument) {
IStructuredDocument oldStructuredDocument = super.getStructuredDocument();
if (newStructuredDocument == oldStructuredDocument)
// noting to do
return;
if (oldStructuredDocument != null)
oldStructuredDocument.removeDocumentChangingListener(this);
super.setStructuredDocument(newStructuredDocument);
if (newStructuredDocument != null) {
if (newStructuredDocument.getLength() > 0) {
newModel(new NewDocumentEvent(newStructuredDocument, this));
}
newStructuredDocument.addDocumentChangingListener(this);
}
}
use of org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent in project webtools.sourceediting by eclipse.
the class DTDModelImpl method setStructuredDocument.
/**
* @param newStructuredDocument
* org.eclipse.wst.sse.core.text.IStructuredDocument
*/
public void setStructuredDocument(IStructuredDocument newStructuredDocument) {
IStructuredDocument oldStructuredDocument = super.getStructuredDocument();
if (newStructuredDocument == oldStructuredDocument)
// noting to do
return;
if (oldStructuredDocument != null)
oldStructuredDocument.removeDocumentChangingListener(this);
super.setStructuredDocument(newStructuredDocument);
if (newStructuredDocument != null) {
if (newStructuredDocument.getLength() > 0) {
newModel(new NewDocumentEvent(newStructuredDocument, this));
}
newStructuredDocument.addDocumentChangingListener(this);
}
}
use of org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent in project webtools.sourceediting by eclipse.
the class TestNewDocumentEvent method testGetOffset.
public void testGetOffset() {
NewDocumentEvent event = getBasicEvent();
int o = event.getOffset();
assertEquals(0, o);
}
use of org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent in project webtools.sourceediting by eclipse.
the class TestNewDocumentEvent method testNewDocumentEvent.
public void testNewDocumentEvent() {
NewDocumentEvent event = getBasicEvent();
assertNotNull(event);
}
Aggregations