edu.rice.cs.drjava.ui
Class JavadocDialog

java.lang.Object
  extended by edu.rice.cs.drjava.ui.JavadocDialog
All Implemented Interfaces:
DirectorySelector

public class JavadocDialog
extends Object
implements DirectorySelector

Manages a dialog box that can select a destination directory for generating Javadoc. The getDirectory method should be called to show the dialog, using the suggested location for the Javadoc as the "start" file. If the user modifies the selection once, the user's choice will be remembered and no further suggestions will be used.

Version:
$Id: JavadocDialog.java 4422 2008-03-27 15:08:58Z rcartwright $

Constructor Summary
JavadocDialog(JFrame frame)
          Creates a new JavadocDialog to show from the given frame.
 
Method Summary
 boolean askUser(String message, String title)
          Asks the user a yes/no question.
 File getDirectory(File start)
          Shows the dialog prompting the user for a destination directory in which to generate Javadoc.
 boolean isRecursive()
          Returns true if the user wants the directory to include all subdirectories.
 void setSuggestedDir(File dir)
          Sets the suggested destination directory for Javadoc generation.
 void setUseSuggestion(boolean use)
          Sets whether the dialog should use the suggested directory provided to the getDirectory method as the default location.
 void warnUser(String message, String title)
          Warns the user about an error condition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavadocDialog

public JavadocDialog(JFrame frame)
Creates a new JavadocDialog to show from the given frame.

Parameters:
frame - Parent frame of this dialog
Method Detail

isRecursive

public boolean isRecursive()
Description copied from interface: DirectorySelector
Returns true if the user wants the directory to include all subdirectories.

Specified by:
isRecursive in interface DirectorySelector

getDirectory

public File getDirectory(File start)
                  throws OperationCanceledException
Shows the dialog prompting the user for a destination directory in which to generate Javadoc. This operation must be executed from the event-handling thread!

Specified by:
getDirectory in interface DirectorySelector
Parameters:
start - The directory to display in the text box. If null, the most recent suggested directory (passed in via setSuggestedDir) is displayed, unless the user has modified a previous suggestion.
Returns:
A directory to use for the Javadoc (which might not exist)
Throws:
OperationCanceledException - if the selection request is canceled

askUser

public boolean askUser(String message,
                       String title)
Asks the user a yes/no question.

Specified by:
askUser in interface DirectorySelector
Returns:
true if the user responded affirmatively, false if negatively

warnUser

public void warnUser(String message,
                     String title)
Warns the user about an error condition.

Specified by:
warnUser in interface DirectorySelector

setSuggestedDir

public void setSuggestedDir(File dir)
Sets the suggested destination directory for Javadoc generation. This directory will be displayed in the file field if the user has not modified the suggestion in the past.

Parameters:
dir - Suggested destination directory

setUseSuggestion

public void setUseSuggestion(boolean use)
Sets whether the dialog should use the suggested directory provided to the getDirectory method as the default location.

Parameters:
use - Whether to use the suggested directory