|
| 1 | +/* |
| 2 | + * Copyright (c) 2016 Martin Prout |
| 3 | + * |
| 4 | + * This library is free software; you can redistribute it and/or |
| 5 | + * modify it under the terms of the GNU Lesser General Public |
| 6 | + * License as published by the Free Software Foundation; either |
| 7 | + * version 2.1 of the License, or (at your option) any later version. |
| 8 | + * |
| 9 | + * http://creativecommons.org/licenses/LGPL/2.1/ |
| 10 | + * |
| 11 | + * This library is distributed in the hope that it will be useful, |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | + * Lesser General Public License for more details. |
| 15 | + * |
| 16 | + * You should have received a copy of the GNU Lesser General Public |
| 17 | + * License along with this library; if not, write to the Free Software |
| 18 | + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | + */ |
| 20 | +package monkstone.filechooser; |
| 21 | + |
| 22 | +import java.io.File; |
| 23 | + |
| 24 | +/** |
| 25 | + * This interface makes it easier/possible to use the reflection methods |
| 26 | + * selectInput |
| 27 | + * def setup |
| 28 | + * java_signature 'void selectInput(String, String)' |
| 29 | + * selectInput('Select a file to process:', 'fileSelected') |
| 30 | + * end |
| 31 | + * |
| 32 | + * def fileSelected(selection) |
| 33 | + * if selection.nil? |
| 34 | + * puts 'Window was closed or the user hit cancel.' |
| 35 | + * else |
| 36 | + * puts format('User selected %s', selection.get_absolute_path) |
| 37 | + * end |
| 38 | + * end |
| 39 | + * @author Martin Prout |
| 40 | + */ |
| 41 | +public interface Chooser { |
| 42 | + |
| 43 | + public void fileSelected(File selection); |
| 44 | +} |
0 commit comments