cz.vity.freerapid.plugins.webclient.interfaces
Interface DialogSupport

All Known Implementing Classes:
StandardDialogSupportImpl

public interface DialogSupport

Class that provides basic functions to show dialogs for plugins.

Author:
Ladislav Vitasek

Method Summary
 String askForCaptcha(BufferedImage image)
          Shows default simple input dialog for getting input from user.
 PremiumAccount showAccountDialog(PremiumAccount premiumAccount, String dialogTitle)
          Method shows simple input dialog with username and password fields and OK/Cancel buttons
 boolean showOKCancelDialog(Component container, String dialogTitle)
          Shows simple OK/Cancel dialog with given content of given container
 void showOKDialog(Component container, String dialogTitle)
          Shows simple dialog with OK button with given content of given container
 

Method Detail

showAccountDialog

PremiumAccount showAccountDialog(PremiumAccount premiumAccount,
                                 String dialogTitle)
                                 throws Exception
Method shows simple input dialog with username and password fields and OK/Cancel buttons

Parameters:
premiumAccount - object with data about username and password
dialogTitle - 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

boolean showOKCancelDialog(Component container,
                           String dialogTitle)
                           throws Exception
Shows simple OK/Cancel dialog with given content of given container

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

showOKDialog

void showOKDialog(Component container,
                  String dialogTitle)
                  throws Exception
Shows simple dialog with OK button with given content of given container

Parameters:
container - a container with SWING components to show
dialogTitle - title for dialog
Throws:
Exception - if something went wrong or thread was interrupted

askForCaptcha

String askForCaptcha(BufferedImage image)
                     throws Exception
Shows default simple input dialog for getting input from user.

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