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

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

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

See Also:
Serialized Form

Constructor Summary
GlobalModelTestCase.WarningFileSelector(File f)
           
 
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.WarningFileSelector

public GlobalModelTestCase.WarningFileSelector(File f)
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.