edu.rice.cs.drjava.model
Interface FileSaveSelector

All Known Implementing Classes:
GlobalModelTestCase.CancelingSelector, GlobalModelTestCase.FileSelector, GlobalModelTestCase.WarningFileSelector

public interface FileSaveSelector

An interface to give GlobalModel a file to save a document to.

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

Method Summary
 File getFile()
          Returns the file to save.
 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
 

Method Detail

getFile

File getFile()
             throws OperationCanceledException
Returns the file to save.

Throws:
OperationCanceledException - if the save request is cancelled

warnFileOpen

boolean warnFileOpen(File f)
Informs the user that the chosen file is already open and prompts them asking whether to continue with the save

Parameters:
f - the file being saved
Returns:
true iff the save is to occur

verifyOverwrite

boolean verifyOverwrite()
Confirms whether the existing chosen file should be overwritten.


shouldSaveAfterFileMoved

boolean shouldSaveAfterFileMoved(OpenDefinitionsDocument doc,
                                 File oldFile)
Confirms whether a new file should be selected since the previously chosen file has been deleted or moved.

Parameters:
oldFile - The file that was moved or deleted.