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

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

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

See Also:
Serialized Form

Constructor Summary
GlobalModelTestCase.CancelingSelector()
           
 
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 shouldUpdateDocumentState()
          Return true if saving should update the document's state (i.e.
 boolean verifyOverwrite(File f)
          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.CancelingSelector

public GlobalModelTestCase.CancelingSelector()
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(File f)
Description copied from interface: FileSaveSelector
Confirms whether the existing chosen file should be overwritten.

Specified by:
verifyOverwrite in interface FileSaveSelector
Parameters:
f - the file being saved
Returns:
true iff the user wants to overwrite

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.

shouldUpdateDocumentState

public boolean shouldUpdateDocumentState()
Description copied from interface: FileSaveSelector
Return true if saving should update the document's state (i.e. new file name and reset modification status). Save/save as = true. Save copy = false.

Specified by:
shouldUpdateDocumentState in interface FileSaveSelector
Returns:
true to update document state