edu.rice.cs.drjava.model
Class GlobalModelTestCase.FileSelector

java.lang.Object
  extended by edu.rice.cs.drjava.model.GlobalModelTestCase.FileSelector
All Implemented Interfaces:
FileSaveSelector, FileOpenSelector, Serializable
Enclosing class:
GlobalModelTestCase

public static class GlobalModelTestCase.FileSelector
extends Object
implements FileOpenSelector, FileSaveSelector

This class is used by several test cases in Compile Tests that expect incorrect behavior concerning the saving of files. This special FileSelector is included to ensure compliance with these test cases, for which the intricacies of saving files are unimportant. The only FileSelector that honest-to-supreme-deity matters is is DefaultGlobalModel.ConcreteOpenDefDoc, which is much more like WarningFileSelector

See Also:
Serialized Form

Constructor Summary
GlobalModelTestCase.FileSelector(File f)
           
GlobalModelTestCase.FileSelector(File f1, File f2)
           
 
Method Summary
 File getFile()
          Returns the file to save.
 File[] getFiles()
           
 boolean shouldSaveAfterFileMoved(OpenDefinitionsDocument doc, File oldFile)
          Confirms whether a new file should be selected since the previously chosen file has been deleted or moved.
 boolean verifyOverwrite()
          Confirms whether the existing chosen file should be overwritten.
 boolean warnFileOpen(File f)
          Informs the user that the chosen file is already open and prompts them asking whether to continue with the save
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlobalModelTestCase.FileSelector

public GlobalModelTestCase.FileSelector(File f)

GlobalModelTestCase.FileSelector

public GlobalModelTestCase.FileSelector(File f1,
                                        File f2)
Method Detail

getFile

public File getFile()
             throws OperationCanceledException
Description copied from interface: FileSaveSelector
Returns the file to save.

Specified by:
getFile in interface FileSaveSelector
Throws:
OperationCanceledException - if the save request is cancelled

getFiles

public File[] getFiles()
                throws OperationCanceledException
Specified by:
getFiles in interface FileOpenSelector
Throws:
OperationCanceledException

warnFileOpen

public boolean warnFileOpen(File f)
Description copied from interface: FileSaveSelector
Informs the user that the chosen file is already open and prompts them asking whether to continue with the save

Specified by:
warnFileOpen in interface FileSaveSelector
Parameters:
f - the file being saved
Returns:
true iff the save is to occur

verifyOverwrite

public boolean verifyOverwrite()
Description copied from interface: FileSaveSelector
Confirms whether the existing chosen file should be overwritten.

Specified by:
verifyOverwrite in interface FileSaveSelector

shouldSaveAfterFileMoved

public boolean shouldSaveAfterFileMoved(OpenDefinitionsDocument doc,
                                        File oldFile)
Description copied from interface: FileSaveSelector
Confirms whether a new file should be selected since the previously chosen file has been deleted or moved.

Specified by:
shouldSaveAfterFileMoved in interface FileSaveSelector
oldFile - The file that was moved or deleted.