001package jmri.jmrit.symbolicprog;
002
003import java.io.File;
004import java.io.IOException;
005import javax.swing.JFrame;
006import javax.swing.JLabel;
007
008/**
009 * Action to import the CV values from a PR1WIN/PR1DOS data file.
010 *
011 * @author Bob Jacobsen Copyright (C) 2003
012 * @author Dave Heap Copyright (C) 2015
013 */
014public class Pr1ImportAction extends GenericImportAction {
015
016    public Pr1ImportAction(String actionName, CvTableModel pModel, JFrame pParent, JLabel pStatus) {
017        super(actionName, pModel, pParent, pStatus, "PR1 files", "dec", null);
018    }
019
020    @Override
021    boolean launchImporter(File file, CvTableModel tableModel) {
022            try {
023                // ctor launches operation
024                Pr1Importer importer = new Pr1Importer(file);
025                importer.setCvTable(mModel);
026                return true;
027            } catch (IOException ex) {
028                return false;
029        }
030    }
031}