Skip to content
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

Suggest-name option in file-chooser #185

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Suggest-name option in file-chooser #185

wants to merge 4 commits into from

Conversation

iref
Copy link

@iref iref commented Dec 1, 2014

I added option for default file name to file chooser widget.
Option is string and it uses swing trick from http://stackoverflow.com/questions/356671/jfilechooser-showsavedialog-how-to-set-suggested-file-name

Hopefully I didn't miss anything as I am new to clojure and Seesaw.
I still have to figure out, why current directory is not changed, but I decided to create pull request, so we can discuss what should I improve and other possible mistakes.

(bean-option [:multi? :multi-selection-enabled] JFileChooser boolean)
(bean-option [:selection-mode :file-selection-mode] JFileChooser file-selection-modes)
(default-option :filters set-file-filters)
(bean-option [:all-files? :accept-all-file-filter-used] JFileChooser boolean)))
(bean-option [:all-files? :accept-all-file-filter-used] JFileChooser boolean)
(default-option :suggest-name
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would :selected-file be a better name since this can also be used to set the initial selection to an existing file?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Especially if it should also accept java.io.File.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants