From bf7d38c8249e19bd2697f810a6a646c09f2787a7 Mon Sep 17 00:00:00 2001 From: Steffen Flor Date: Sun, 12 Mar 2017 22:36:43 +0100 Subject: [PATCH] Updated POM and added LICENSE and README files --- LICENSE | 25 ++++++++++++++++ README.md | 40 ++++++++++++++++++++++++++ pom.xml | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 148 insertions(+), 2 deletions(-) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..db76d7f --- /dev/null +++ b/LICENSE @@ -0,0 +1,25 @@ +BSD 2-Clause License + +Copyright (c) 2017, Steffen Flor +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..71a5d21 --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# NativeJFileChooser + +This is a drop-in replacement for Swing's file chooser. Instead of displaying +the Swing file chooser, it makes use of the JavaFX file chooser if available. +It still uses Swing's file chooser as a fallback. + +## Usage + +NativeJFileChooser is available via Maven: + + + li.flor + native-j-file-chooser + 1.6.3 + + +Simply replace + + JFileChooser fileChooser = new JFileChooser(); + +with + + JFileChooser fileChooser = new NativeJFileChooser(); + +## Example + + EventQueue.invokeLater(() -> { + JFrame frame = new JFrame("Test"); + JButton button = new JButton("Click me!"); + JFileChooser fileChooser = new NativeJFileChooser(); + fileChooser.setFileFilter(new FileNameExtensionFilter("JPG", "*.jpg")); + button.addActionListener((ActionEvent e) -> { + fileChooser.showDialog(frame, "Open"); + }); + frame.add(button); + frame.setLocationRelativeTo(null); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.pack(); + frame.setVisible(true); + }); \ No newline at end of file diff --git a/pom.xml b/pom.xml index f900b86..7798969 100644 --- a/pom.xml +++ b/pom.xml @@ -1,8 +1,10 @@ - + 4.0.0 li.flor - NativeJFileChooser + native-j-file-chooser 1.6.3 jar @@ -10,4 +12,83 @@ 1.7 1.7 + ${project.groupId}:${project.artifactId} + Native file chooser for Swing. + https://github.com/veluria/NativeJFileChooser + + + + org.apache.maven.plugins + maven-source-plugin + 3.0.1 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + ${gpg.keyname} + + + + + + + + + The 2-Clause BSD License + https://opensource.org/licenses/BSD-2-Clause + + + + + ${cred.name} + ${cred.email} + ${cred.org} + ${cred.orgurl} + + + + scm:git:git://github.com/veluria/NativeJFileChooser.git + scm:git:ssh://github.com/veluria/NativeJFileChooser.git + https://github.com/veluria/NativeJFileChooser + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + \ No newline at end of file