Search in sources :

Example 6 with FilterFileMode

use of io.github.vocabhunter.gui.model.FilterFileMode in project VocabHunter by VocabHunter.

the class FilterFileModelTranslatorImpl method fromModel.

@Override
public BaseListedFile fromModel(final FilterFileModel model) {
    FilterFileMode mode = model.getMode();
    Path file = model.getFile();
    switch(mode) {
        case SESSION_KNOWN:
            return new SessionListedFile(file, false);
        case SESSION_SEEN:
            return new SessionListedFile(file, true);
        case EXCEL:
            return new ExcelListedFile(file, model.getColumns());
        case DOCUMENT:
            return new DocumentListedFile(file);
        default:
            throw new VocabHunterException("Unsupported mode " + mode);
    }
}
Also used : Path(java.nio.file.Path) DocumentListedFile(io.github.vocabhunter.analysis.settings.DocumentListedFile) VocabHunterException(io.github.vocabhunter.analysis.core.VocabHunterException) ExcelListedFile(io.github.vocabhunter.analysis.settings.ExcelListedFile) FilterFileMode(io.github.vocabhunter.gui.model.FilterFileMode) SessionListedFile(io.github.vocabhunter.analysis.settings.SessionListedFile)

Aggregations

FilterFileMode (io.github.vocabhunter.gui.model.FilterFileMode)6 Path (java.nio.file.Path)3 TextGrid (io.github.vocabhunter.analysis.grid.TextGrid)2 SessionListedFile (io.github.vocabhunter.analysis.settings.SessionListedFile)2 VocabHunterException (io.github.vocabhunter.analysis.core.VocabHunterException)1 DocumentListedFile (io.github.vocabhunter.analysis.settings.DocumentListedFile)1 ExcelListedFile (io.github.vocabhunter.analysis.settings.ExcelListedFile)1 FileDialogue (io.github.vocabhunter.gui.dialogues.FileDialogue)1 FileFormatType (io.github.vocabhunter.gui.dialogues.FileFormatType)1 FilterFileModel (io.github.vocabhunter.gui.model.FilterFileModel)1 FilterGridModel (io.github.vocabhunter.gui.model.FilterGridModel)1