org.progeeks.util.swing
Class SwingRequestHandler

java.lang.Object
  extended by org.progeeks.util.AbstractRequestHandler
      extended by org.progeeks.util.swing.SwingRequestHandler
All Implemented Interfaces:
UserRequestHandler

public class SwingRequestHandler
extends AbstractRequestHandler

Swing-based implementation of the user request handler.

Version:
$Revision: 1.17 $
Author:
Paul Speed

Constructor Summary
SwingRequestHandler(java.awt.Frame contextWindow)
           
 
Method Summary
static java.lang.Boolean getConfirmation(java.awt.Frame owner, java.lang.String title, java.lang.String message, boolean includeCancel)
          Static utility method that is the backing for the requestConfirmation() method.
static java.io.File getFile(java.awt.Frame owner, java.lang.String title, javax.swing.filechooser.FileFilter filter, java.io.File initialValue, boolean forOpen, int mode)
          Pops up a file dialog requesting selection of the specified type of file.
static java.io.File getFile(java.awt.Frame owner, java.lang.String title, java.lang.String typeDescription, java.lang.String extension, java.io.File initialValue, boolean forOpen, int mode)
          Pops up a file dialog requesting selection of the specified type of file.
static java.util.List getFiles(java.awt.Frame owner, java.lang.String title, javax.swing.filechooser.FileFilter filter, java.io.File initialValue, boolean forOpen, int mode)
          Pops up a file dialog requesting selection of one or more of the specified type of file.
static java.util.List getFiles(java.awt.Frame owner, java.lang.String title, java.lang.String typeDescription, java.lang.String extension, java.io.File initialValue, boolean forOpen, int mode)
          Pops up a file dialog requesting selection of one or more of the specified type of file.
static java.lang.String getString(java.awt.Frame owner, java.lang.String title, java.lang.String message, java.lang.String initialValue)
          Pops up a simple string entry dialog.
 java.lang.Boolean requestConfirmation(java.lang.String title, java.lang.String message, boolean includeCancel)
          Requests confirmation from the user in the form of a yes/no question.
 java.io.File requestDirectory(java.lang.String title)
          Requests a directory selection from the user.
 java.io.File requestFile(java.lang.String title, java.lang.String typeDescription, java.lang.String extension, boolean forOpen)
          Requests a file selection from the user.
 java.io.File requestFile(java.lang.String title, java.lang.String typeDescription, java.lang.String extension, java.io.File initialValue, boolean forOpen)
          Requests a file selection from the user providing a default initial value.
 ProgressReporter requestProgressReporter(java.lang.String title, java.lang.String message, int min, int max)
          Returns an object that can be used to report the progress of some operation to the user.
 void requestShowError(java.lang.String title, java.lang.String message)
          Presents an error message tot he user.
 void requestShowMessage(java.lang.String message)
          Presents an informational message to the user.
 void requestShowMessage(java.lang.String title, java.lang.String message, int type)
          Presents a titled message to the user with an optional type-related icon.
 java.lang.String requestString(java.lang.String title, java.lang.String message, java.lang.String initialValue)
          Requests a String entry from the user.
 
Methods inherited from class org.progeeks.util.AbstractRequestHandler
postRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwingRequestHandler

public SwingRequestHandler(java.awt.Frame contextWindow)
Method Detail

requestConfirmation

public java.lang.Boolean requestConfirmation(java.lang.String title,
                                             java.lang.String message,
                                             boolean includeCancel)
Requests confirmation from the user in the form of a yes/no question. Optionally, a cancel button can be included.

Returns:
Boolean.TRUE for yes, Boolean.FALSE for no, and null for cancel.

requestFile

public java.io.File requestFile(java.lang.String title,
                                java.lang.String typeDescription,
                                java.lang.String extension,
                                boolean forOpen)
Requests a file selection from the user.


requestFile

public java.io.File requestFile(java.lang.String title,
                                java.lang.String typeDescription,
                                java.lang.String extension,
                                java.io.File initialValue,
                                boolean forOpen)
Requests a file selection from the user providing a default initial value.


requestDirectory

public java.io.File requestDirectory(java.lang.String title)
Requests a directory selection from the user.


requestString

public java.lang.String requestString(java.lang.String title,
                                      java.lang.String message,
                                      java.lang.String initialValue)
Requests a String entry from the user.


requestShowMessage

public void requestShowMessage(java.lang.String message)
Presents an informational message to the user.


requestShowMessage

public void requestShowMessage(java.lang.String title,
                               java.lang.String message,
                               int type)
Presents a titled message to the user with an optional type-related icon. The type parameter is mostly unsupported at the moment and should be -1 if no icon is desired.


requestShowError

public void requestShowError(java.lang.String title,
                             java.lang.String message)
Presents an error message tot he user.


requestProgressReporter

public ProgressReporter requestProgressReporter(java.lang.String title,
                                                java.lang.String message,
                                                int min,
                                                int max)
Returns an object that can be used to report the progress of some operation to the user.

Parameters:
title - The name of the over-all operation. Implementations of UserRequestHandler should consider aggregating the progress for the different reporters with the same title.
message - A modifiable message associated with the current part of the task.
min - The minimum value for the progress range.
max - The maximum value for the progress range.

getConfirmation

public static java.lang.Boolean getConfirmation(java.awt.Frame owner,
                                                java.lang.String title,
                                                java.lang.String message,
                                                boolean includeCancel)
Static utility method that is the backing for the requestConfirmation() method.


getFile

public static java.io.File getFile(java.awt.Frame owner,
                                   java.lang.String title,
                                   java.lang.String typeDescription,
                                   java.lang.String extension,
                                   java.io.File initialValue,
                                   boolean forOpen,
                                   int mode)
Pops up a file dialog requesting selection of the specified type of file.


getFile

public static java.io.File getFile(java.awt.Frame owner,
                                   java.lang.String title,
                                   javax.swing.filechooser.FileFilter filter,
                                   java.io.File initialValue,
                                   boolean forOpen,
                                   int mode)
Pops up a file dialog requesting selection of the specified type of file.


getFiles

public static java.util.List getFiles(java.awt.Frame owner,
                                      java.lang.String title,
                                      java.lang.String typeDescription,
                                      java.lang.String extension,
                                      java.io.File initialValue,
                                      boolean forOpen,
                                      int mode)
Pops up a file dialog requesting selection of one or more of the specified type of file.


getFiles

public static java.util.List getFiles(java.awt.Frame owner,
                                      java.lang.String title,
                                      javax.swing.filechooser.FileFilter filter,
                                      java.io.File initialValue,
                                      boolean forOpen,
                                      int mode)
Pops up a file dialog requesting selection of one or more of the specified type of file.


getString

public static java.lang.String getString(java.awt.Frame owner,
                                         java.lang.String title,
                                         java.lang.String message,
                                         java.lang.String initialValue)
Pops up a simple string entry dialog.



Copyright © 2002-2003 Paul Speed. All Rights Reserved.