use of org.eclipse.jdt.core.ElementChangedEvent in project che by eclipse.
the class DeltaProcessor method notifyListeners.
private void notifyListeners(IJavaElementDelta deltaToNotify, int eventType, IElementChangedListener[] listeners, int[] listenerMask, int listenerCount) {
final ElementChangedEvent extraEvent = new ElementChangedEvent(deltaToNotify, eventType);
for (int i = 0; i < listenerCount; i++) {
if ((listenerMask[i] & eventType) != 0) {
final IElementChangedListener listener = listeners[i];
long start = -1;
if (VERBOSE) {
//$NON-NLS-1$//$NON-NLS-2$
System.out.print("Listener #" + (i + 1) + "=" + listener.toString());
start = System.currentTimeMillis();
}
// wrap callbacks with Safe runnable for subsequent listeners to be called when some are causing grief
SafeRunner.run(new ISafeRunnable() {
public void handleException(Throwable exception) {
//$NON-NLS-1$
Util.log(exception, "Exception occurred in listener of Java element change notification");
}
public void run() throws Exception {
PerformanceStats stats = null;
if (PERF) {
// stats = PerformanceStats.getStats(JavaModelManager.DELTA_LISTENER_PERF, listener);
// stats.startRun();
}
listener.elementChanged(extraEvent);
if (PERF) {
stats.endRun();
}
}
});
if (VERBOSE) {
//$NON-NLS-1$ //$NON-NLS-2$
System.out.println(" -> " + (System.currentTimeMillis() - start) + "ms");
}
}
}
}
Aggregations