org.jurvis.swing.form
Class JvViewUtilities

java.lang.Object
  extended by org.jurvis.swing.form.JvViewUtilities

public final class JvViewUtilities
extends Object

Various utilities in support of JvViews.

Author:
Neil W. Weber

Constructor Summary
JvViewUtilities()
           
 
Method Summary
static int promptToSaveModifications(JvView view)
          Prompt the user to determine if they wish to save the unsaved modifications to this view.
static int promptToSaveModifications(JvView view, int optionType)
          Prompt the user to determine if they wish to save the unsaved modifications to this view.
static boolean validateAndCommit(JvView view)
          Validate and save the user modifications.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JvViewUtilities

public JvViewUtilities()
Method Detail

promptToSaveModifications

public static int promptToSaveModifications(JvView view)
Prompt the user to determine if they wish to save the unsaved modifications to this view. The user will have the option of indicating the modifications are to be saved, the modifications are to be cancelled, or the operation that triggered this prompt is to be cancelled.

Parameters:
view - the view to be saved
Returns:
YES_OPTION, NO_OPTION, or CANCEL_OPTION

promptToSaveModifications

public static int promptToSaveModifications(JvView view,
                                            int optionType)
Prompt the user to determine if they wish to save the unsaved modifications to this view. The user will have the option of indicating the modifications are to be saved, the modifications are to be cancelled, or the operation that triggered this prompt is to be cancelled.

Parameters:
view - the view to be saved
optionType - an int designating the options available on the dialog: YES_NO_OPTION, or YES_NO_CANCEL_OPTION
Returns:
YES_OPTION, NO_OPTION, or CANCEL_OPTION

validateAndCommit

public static boolean validateAndCommit(JvView view)
Validate and save the user modifications. If there are any errors, an error dialog named "view-nameError" is displayed.

Parameters:
view - the view to validate and commit
Returns:
true if the user modifications are validated and were successfully saved; false otherwise


Copyright © 1999-2004 Neil W. Weber. All Rights Reserved.