use of org.eclipse.wst.sse.core.internal.provisional.events.AboutToBeChangedEvent 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.events.AboutToBeChangedEvent in project webtools.sourceediting by eclipse.
the class TestAboutToBeChangedEvent method testGetDeletedText.
public void testGetDeletedText() {
AboutToBeChangedEvent event = getBasicEvent();
String d = event.getDeletedText();
assertEquals(d, null);
}
use of org.eclipse.wst.sse.core.internal.provisional.events.AboutToBeChangedEvent 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.events.AboutToBeChangedEvent in project webtools.sourceediting by eclipse.
the class BasicStructuredDocument method _fireStructuredDocumentAboutToChange.
private void _fireStructuredDocumentAboutToChange(Object[] listeners) {
// another thread
if (listeners != null) {
Object[] holdListeners = listeners;
// fire
for (int i = 0; i < holdListeners.length; i++) {
if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
startTime = System.currentTimeMillis();
}
// safeguard from listeners that throw exceptions
try {
// originalRequester?
if (fDocumentEvent == null) {
fDocumentEvent = new NullDocumentEvent();
}
AboutToBeChangedEvent aboutToBeChangedEvent = new AboutToBeChangedEvent(this, null, fDocumentEvent.getText(), fDocumentEvent.getOffset(), fDocumentEvent.getLength());
// this is a safe cast, since addListners requires a
// IStructuredDocumentListener
((IModelAboutToBeChangedListener) holdListeners[i]).modelAboutToBeChanged(aboutToBeChangedEvent);
} catch (Exception exception) {
Logger.logException(exception);
}
if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
long stopTime = System.currentTimeMillis();
// $NON-NLS-2$//$NON-NLS-1$
System.out.println("\n\t\t\t\t IStructuredDocument::fireStructuredDocumentEvent. Time was " + (stopTime - startTime) + " msecs to fire NewModelEvent to instance of " + holdListeners[i].getClass());
}
}
}
}
use of org.eclipse.wst.sse.core.internal.provisional.events.AboutToBeChangedEvent in project webtools.sourceediting by eclipse.
the class TestAboutToBeChangedEvent method testAboutToBeChangedEvent.
public void testAboutToBeChangedEvent() {
AboutToBeChangedEvent event = getBasicEvent();
assertNotNull(event);
}
Aggregations