org.xnap.gui
Class Dialogs

java.lang.Object
  extended by org.xnap.gui.Dialogs

public class Dialogs
extends java.lang.Object

Provides a set of static methods to display common dialogs.


Nested Class Summary
static class Dialogs.NotificationDialog
          This class provides a notification dialog with a do not show again option.
 
Constructor Summary
Dialogs()
           
 
Method Summary
static boolean copy(java.io.File[] files, java.io.File target)
           
static void error(java.awt.Component parent, java.lang.String message)
           
static boolean getShowDialog(PreferencesProvider prefs, java.lang.String dialogName)
           
static boolean getShowDialog(java.lang.String dialogName)
           
static void info(java.awt.Component c, java.lang.String message, java.lang.String title)
           
static boolean move(java.io.File[] files, java.io.File target)
           
static void setShowDialog(PreferencesProvider prefs, java.lang.String dialogName, boolean newValue)
           
static void setShowDialog(java.lang.String dialogName, boolean newValue)
           
static boolean showCloseDialog(java.awt.Component c)
          Returns true, if user presses okay button.
static int showConfirmDialog(java.awt.Component c, java.lang.String dialogName, java.lang.String title, java.lang.String question, int optionType, PreferencesProvider prefs)
          Shows a confirmation dialog and saves if it should be shown again next time.
static java.io.File[] showCopyDialog(java.awt.Component c, java.io.File[] files, java.io.File dir)
           
static java.io.File[] showDeleteFilesDialog(java.awt.Component c, java.io.File[] files)
           
protected static java.io.File[] showFilesActionDialog(java.awt.Component c, java.io.File[] files, java.lang.String question, java.lang.String title, java.lang.String dialogPref)
           
static java.io.File[] showMoveDialog(java.awt.Component c, java.io.File[] files, java.io.File dir)
           
static void showNotification(java.awt.Component c, java.lang.String dialogName, java.lang.String title, java.lang.String message)
           
static void showNotification(java.awt.Component c, java.lang.String dialogName, java.lang.String title, java.lang.String message, PreferencesProvider prefs)
           
static java.lang.String showRenameDialog(java.awt.Component c, java.lang.String filename)
           
static void showRestartNotification(java.awt.Component c)
           
static boolean showSearchLibraryDialog(java.awt.Component c, java.lang.String filename)
          Shows a message dialog if the library contains similiar files to file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dialogs

public Dialogs()
Method Detail

copy

public static boolean copy(java.io.File[] files,
                           java.io.File target)

error

public static void error(java.awt.Component parent,
                         java.lang.String message)

getShowDialog

public static boolean getShowDialog(PreferencesProvider prefs,
                                    java.lang.String dialogName)

getShowDialog

public static boolean getShowDialog(java.lang.String dialogName)

setShowDialog

public static void setShowDialog(PreferencesProvider prefs,
                                 java.lang.String dialogName,
                                 boolean newValue)

setShowDialog

public static void setShowDialog(java.lang.String dialogName,
                                 boolean newValue)

info

public static void info(java.awt.Component c,
                        java.lang.String message,
                        java.lang.String title)

move

public static boolean move(java.io.File[] files,
                           java.io.File target)

showCloseDialog

public static boolean showCloseDialog(java.awt.Component c)
Returns true, if user presses okay button.


showConfirmDialog

public static int showConfirmDialog(java.awt.Component c,
                                    java.lang.String dialogName,
                                    java.lang.String title,
                                    java.lang.String question,
                                    int optionType,
                                    PreferencesProvider prefs)
Shows a confirmation dialog and saves if it should be shown again next time.

Parameters:
c - parent component used for centering the dialog
dialogName - the preferences key that is used to save the do not show again option
title - the title of the message border
question - the message to show
optionType -
prefs - PreferencesProvider used for saving "do not show again
returns - JOptionPane.YES_OPTION if user checked the "Do not ask me again" check box before

showCopyDialog

public static java.io.File[] showCopyDialog(java.awt.Component c,
                                            java.io.File[] files,
                                            java.io.File dir)

showDeleteFilesDialog

public static java.io.File[] showDeleteFilesDialog(java.awt.Component c,
                                                   java.io.File[] files)

showFilesActionDialog

protected static java.io.File[] showFilesActionDialog(java.awt.Component c,
                                                      java.io.File[] files,
                                                      java.lang.String question,
                                                      java.lang.String title,
                                                      java.lang.String dialogPref)

showMoveDialog

public static java.io.File[] showMoveDialog(java.awt.Component c,
                                            java.io.File[] files,
                                            java.io.File dir)

showNotification

public static void showNotification(java.awt.Component c,
                                    java.lang.String dialogName,
                                    java.lang.String title,
                                    java.lang.String message)

showNotification

public static void showNotification(java.awt.Component c,
                                    java.lang.String dialogName,
                                    java.lang.String title,
                                    java.lang.String message,
                                    PreferencesProvider prefs)

showRenameDialog

public static java.lang.String showRenameDialog(java.awt.Component c,
                                                java.lang.String filename)

showRestartNotification

public static void showRestartNotification(java.awt.Component c)

showSearchLibraryDialog

public static boolean showSearchLibraryDialog(java.awt.Component c,
                                              java.lang.String filename)
Shows a message dialog if the library contains similiar files to file.

Returns:
true, if user want to continue with the download anyway or no files were found; false, if the user responded with no


Copyright © 2001-2005 XNap Team. All Rights Reserved.