Search in sources :

Example 1 with EditorIntervalBase

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);
    }
}
Also used : EditorIntervalBase(nl.tudelft.watchdog.core.logic.interval.intervaltypes.EditorIntervalBase)

Example 2 with EditorIntervalBase

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());
}
Also used : EditorIntervalBase(nl.tudelft.watchdog.core.logic.interval.intervaltypes.EditorIntervalBase) TypingInterval(nl.tudelft.watchdog.core.logic.interval.intervaltypes.TypingInterval)

Aggregations

EditorIntervalBase (nl.tudelft.watchdog.core.logic.interval.intervaltypes.EditorIntervalBase)2 TypingInterval (nl.tudelft.watchdog.core.logic.interval.intervaltypes.TypingInterval)1