edu.rice.cs.drjava.model
Class AbstractGlobalModel.TrivialFSS

java.lang.Object
  extended by edu.rice.cs.drjava.model.AbstractGlobalModel.TrivialFSS
All Implemented Interfaces:
FileSaveSelector
Enclosing class:
AbstractGlobalModel

private static class AbstractGlobalModel.TrivialFSS
extends java.lang.Object
implements FileSaveSelector


Field Summary
private  java.io.File _file
           
 
Constructor Summary
private AbstractGlobalModel.TrivialFSS(java.io.File file)
           
 
Method Summary
 java.io.File getFile()
          Returns the file to save.
private  java.io.File proposeBetterFileName(java.io.File f)
           
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_file

private java.io.File _file
Constructor Detail

AbstractGlobalModel.TrivialFSS

private AbstractGlobalModel.TrivialFSS(java.io.File file)
Method Detail

getFile

public java.io.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

warnFileOpen

public boolean warnFileOpen(java.io.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(java.io.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,
                                        java.io.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

proposeBetterFileName

private java.io.File proposeBetterFileName(java.io.File f)