Search in sources :

Example 1 with NewDocumentEvent

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;
}
Also used : NewDocumentEvent(org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent) IStructuredDocument(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument)

Example 2 with NewDocumentEvent

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);
    }
}
Also used : NewDocumentEvent(org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent) IStructuredDocument(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument)

Example 3 with NewDocumentEvent

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);
    }
}
Also used : NewDocumentEvent(org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent) IStructuredDocument(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument)

Example 4 with NewDocumentEvent

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);
}
Also used : NewDocumentEvent(org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent)

Example 5 with NewDocumentEvent

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);
}
Also used : NewDocumentEvent(org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent)

Aggregations

NewDocumentEvent (org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent)8 IStructuredDocument (org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument)3 NoChangeEvent (org.eclipse.wst.sse.core.internal.provisional.events.NoChangeEvent)1 RegionChangedEvent (org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent)1 RegionsReplacedEvent (org.eclipse.wst.sse.core.internal.provisional.events.RegionsReplacedEvent)1 StructuredDocumentRegionsReplacedEvent (org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentRegionsReplacedEvent)1 IStructuredDocumentRegion (org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion)1 IStructuredDocumentRegionList (org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList)1 ITextRegion (org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion)1