/**
 * 
 */
package com.valencia.jutils.app.ui;

import javax.swing.JOptionPane;
import javax.swing.UIManager;

import com.valencia.jutils.app.InputProvider;

/**
 * An input provider that requests input from a Swing dialog box.
 * 
 * @author Gabriel Valencia, gee4vee@me.com
 */
public class SwingDialogInputProvider extends InputProvider {

    public SwingDialogInputProvider() {
        // TODO support parent component on input dialog
    }
    
    /* (non-Javadoc)
     * @see com.valencia.jutils.app.InputProvider#getInput(java.lang.String, java.lang.String)
     */
    @Override
    public String getInput(String contextInfo, String message) throws Exception {
        String input = JOptionPane.showInputDialog(null, message, contextInfo, JOptionPane.QUESTION_MESSAGE);
        return input;
    }
    
    public static void main(String[] args) throws Exception {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        SwingDialogInputProvider ip = new SwingDialogInputProvider();
        
        System.out.println(ip.getInput("Test", "Please enter input:"));
    }

}

@@ -470,135 +470,8 @@
   %0D%0A
-    /* (non-Javadoc)%0D%0A     * @see com.valencia.jutils.app.InputProvider#getInput(java.lang.String, java.lang.String)%0D%0A     */%0D%0A
     
@@ -481,16 +481,16 @@
 erride%0D%0A
+
     publ
@@ -671,24 +671,24 @@
 _MESSAGE);%0D%0A
-
         retu
@@ -707,24 +707,778 @@
    %7D%0D%0A    %0D%0A
+    @Override%0D%0A    public String getInput(String contextInfo) throws Exception %7B%0D%0A        return this.getInput(contextInfo, %22%22);%0D%0A    %7D%0D%0A    %0D%0A    @Override%0D%0A    public boolean getBooleanInput(String contextInfo) throws Exception %7B%0D%0A        return this.getBooleanInput(contextInfo, %22%22);%0D%0A    %7D%0D%0A    %0D%0A    @Override%0D%0A    public boolean getBooleanInput(String contextInfo, String message) throws Exception %7B%0D%0A        int input = JOptionPane.showConfirmDialog(null, message, contextInfo, JOptionPane.YES_NO_CANCEL_OPTION);%0D%0A        boolean result;%0D%0A        if (input == JOptionPane.NO_OPTION %7C%7C input == JOptionPane.CANCEL_OPTION) %7B%0D%0A            result = false;%0D%0A        %7D else %7B%0D%0A            result = true;%0D%0A        %7D%0D%0A        return result;%0D%0A    %7D%0D%0A    %0D%0A
     public s

Support boolean input dialog.