cz.vity.freerapid.plugimpl
Class StandardDialogSupportImpl

java.lang.Object
  extended by cz.vity.freerapid.plugimpl.StandardDialogSupportImpl
All Implemented Interfaces:
DialogSupport

public class StandardDialogSupportImpl
extends Object
implements DialogSupport

Standard implementation of DialogSupport

Author:
Ladislav Vitasek

Constructor Summary
StandardDialogSupportImpl(org.jdesktop.application.ApplicationContext context)
          Constructor - creates a new StandardDialogSupportImpl instance.
 
Method Summary
 String askForCaptcha(BufferedImage image)
          Shows default simple input dialog for getting input from user.
 PremiumAccount showAccountDialog(PremiumAccount account, String title)
          Method shows simple input dialog with username and password fields and OK/Cancel buttons
 boolean showOKCancelDialog(Component container, String title)
          Shows simple OK/Cancel dialog with given content of given container
 void showOKDialog(Component container, String title)
          Shows simple dialog with OK button with given content of given container
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardDialogSupportImpl

public StandardDialogSupportImpl(org.jdesktop.application.ApplicationContext context)
Constructor - creates a new StandardDialogSupportImpl instance.

Parameters:
context - application context
Method Detail

showAccountDialog

public PremiumAccount showAccountDialog(PremiumAccount account,
                                        String title)
                                 throws Exception
Description copied from interface: DialogSupport
Method shows simple input dialog with username and password fields and OK/Cancel buttons

Specified by:
showAccountDialog in interface DialogSupport
Parameters:
account - object with data about username and password
title - title for dialog - usually plugin's name
Returns:
if user pressed OK, returns updated instance of the premiumAccount parameter , otherwise it returns null value
Throws:
Exception - if something went wrong

showOKCancelDialog

public boolean showOKCancelDialog(Component container,
                                  String title)
                           throws Exception
Description copied from interface: DialogSupport
Shows simple OK/Cancel dialog with given content of given container

Specified by:
showOKCancelDialog in interface DialogSupport
Parameters:
container - a container with SWING components to show
title - title for dialog
Returns:
returns true, if user pressed OK button, false otherwise
Throws:
Exception - if something went wrong or thread was interrupted

showOKDialog

public void showOKDialog(Component container,
                         String title)
                  throws Exception
Description copied from interface: DialogSupport
Shows simple dialog with OK button with given content of given container

Specified by:
showOKDialog in interface DialogSupport
Parameters:
container - a container with SWING components to show
title - title for dialog
Throws:
Exception - if something went wrong or thread was interrupted

askForCaptcha

public String askForCaptcha(BufferedImage image)
                     throws Exception
Description copied from interface: DialogSupport
Shows default simple input dialog for getting input from user.

Specified by:
askForCaptcha in interface DialogSupport
Parameters:
image - CAPTCHA image to show user
Returns:
returns string given from user - returns null if user cancelled dialog; method can return empty string
Throws:
Exception - if something went wrong or thread was interrupted