edu.rice.cs.drjava.model
Interface FileSaveSelector

All Known Implementing Classes:
AbstractGlobalModel.TrivialFSS, GlobalModelTestCase.CancelingSelector, GlobalModelTestCase.FileSelector, GlobalModelTestCase.SaveCopyFileSelector, GlobalModelTestCase.WarningFileSelector

public interface FileSaveSelector

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

Version:
$Id: FileSaveSelector.java 5236 2010-04-27 01:43:36Z mgricken $

Method Summary
 java.io.File getFile()
          Returns the file to save.
 boolean shouldSaveAfterFileMoved(OpenDefinitionsDocument doc, java.io.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(java.io.File f)
          Confirms whether the existing chosen file should be overwritten.
 boolean warnFileOpen(java.io.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

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

Throws:
OperationCanceledException - if the save request is cancelled

warnFileOpen

boolean warnFileOpen(java.io.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(java.io.File f)
Confirms whether the existing chosen file should be overwritten.

Parameters:
f - the file being saved
Returns:
true iff the user wants to overwrite

shouldSaveAfterFileMoved

boolean shouldSaveAfterFileMoved(OpenDefinitionsDocument doc,
                                 java.io.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.

shouldUpdateDocumentState

boolean shouldUpdateDocumentState()
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.

Returns:
true to update document state