use of nl.tudelft.watchdog.core.logic.interval.intervaltypes.EditorIntervalBase in project watchdog by TestRoots.
the class IDEIntervalManagerBase method addInterval.
/**
* Adds the supplied interval to the list of intervals. New intervals must
* use this method to be registered properly. Handles the addition of
* already closed intervals properly. Delegates to the correct adding
* mechanism.
*/
public void addInterval(IntervalBase interval) {
interval.setSessionSeed(sessionSeed);
if (interval instanceof EditorIntervalBase) {
EditorIntervalBase editorInterval = (EditorIntervalBase) interval;
addEditorInterval(editorInterval);
} else {
addRegularIntervalBase(interval);
}
WatchDogLogger.getInstance().logInfo("Created interval " + interval + " " + interval.getType());
if (interval.isClosed()) {
closeInterval(interval);
}
}
use of nl.tudelft.watchdog.core.logic.interval.intervaltypes.EditorIntervalBase in project watchdog by TestRoots.
the class IDEIntervalManagerBase method closeInterval.
private void closeInterval(IntervalBase interval) {
if (interval == null) {
return;
}
if (interval instanceof TypingInterval) {
TypingInterval typingInterval = (TypingInterval) interval;
setEndingDocumentOf(typingInterval);
}
interval.close();
if (interval instanceof EditorIntervalBase) {
editorInterval = null;
} else {
intervals.remove(interval);
}
intervalsToTransferPersister.save(interval);
intervalsStatisticsPersister.save(interval);
WatchDogLogger.getInstance().logInfo("closed interval " + interval + " " + interval.getType());
}
Aggregations