From 18f91a65cf2afbdd3aee623df059ab55ee9597d0 Mon Sep 17 00:00:00 2001 From: techncl Date: Fri, 8 Nov 2024 17:27:01 +0000 Subject: [PATCH] Move setting of transfer handler for CSV button --- .../gov/nationalarchives/csv/validator/ui/CsvValidatorUi.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/csv-validator-ui/src/main/scala/uk/gov/nationalarchives/csv/validator/ui/CsvValidatorUi.scala b/csv-validator-ui/src/main/scala/uk/gov/nationalarchives/csv/validator/ui/CsvValidatorUi.scala index 42ce4911..9e3f82d2 100644 --- a/csv-validator-ui/src/main/scala/uk/gov/nationalarchives/csv/validator/ui/CsvValidatorUi.scala +++ b/csv-validator-ui/src/main/scala/uk/gov/nationalarchives/csv/validator/ui/CsvValidatorUi.scala @@ -240,6 +240,7 @@ object CsvValidatorUi extends SimpleSwingApplication { false } + txtCsvFile.setTransferHandler(fileHandler) final class FileDropHandler extends TransferHandler { override def canImport(support: TransferHandler.TransferSupport): Boolean = support.getDataFlavors.exists(_.isFlavorJavaFileListType) @@ -277,7 +278,7 @@ object CsvValidatorUi extends SimpleSwingApplication { } } } - txtCsvFile.setTransferHandler(fileHandler) + private val csvFileChooser = new FileChooser(loadSettings match { case Some(s) => s.lastCsvPath.toFile