-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dr2 1966 add ability to drag and drop files into text boxes #510
Dr2 1966 add ability to drag and drop files into text boxes #510
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation looks good, there are a couple of things
-
Steve had mentioned of the possibility of dropping the files generally into the top area (Feature Request: Drag and drop files into the CSV and CSVS text boxes #472) and the code picking up and putting the correct file in the respective text boxes. I think for this to work, you will need to have the top panel as a "drop target" instead of the textbox. I have not looked into it, so I leave it to you if this is easily changeable
-
The error reporting area is for the validation errors, the input errors should be reported on the UI as messageboxes, this should be an easy change. You could simply do something like
JOptionPane.showMessageDialog(null, s"Please drag only 1 file into the '${label.text}' text box.", "Error", JOptionPane.ERROR_MESSAGE)
instead ofoutputToReport
The first parameter null
will actually leave the error dialog without parent, hence it will appear in the middle of the screen. A couple more lines would be to pass the SJXFrame
into the ContentPanel
new ContentPanel(settings, this)
so that private class ContentPanel(settingsPanel: SettingsPanel, parentFrame: SJXFrame) extends Panel
then you can simply make use of the parentFrame.peer
as a parent of the dialog.
JOptionPane.showMessageDialog(parentFrame.peer, s"Please drag only 1 file into the '${label.text}' text box.", "Error", JOptionPane.ERROR_MESSAGE)
} | ||
} | ||
} | ||
txtCsvFile.setTransferHandler(new FileDropHandler(".csv", lblCsvFile)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please move this line above the FileDropDownHandler
class definition, just so that it stays close to the textBox creation from readability perspective
…github.com:digital-preservation/csv-validator into DR2-1966_addAbilityToDragAndDropFilesIntoTextBoxes
No description provided.