|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.essex.common.io.FileOp<T> uk.ac.essex.common.io.FileOpImpl<T>
public abstract class FileOpImpl<T extends ApplicationFile>
A default implementation of a FileOp
that provides implementations that use a
JFileChooser
to obtain the file the user wants to open/save. This can be
a custom file chosser if necessary
Date: 15-Jul-2002
Field Summary | |
---|---|
protected java.awt.Component |
currentCaller
|
protected javax.swing.JFileChooser |
fileChooser
The file fileChooser |
static java.lang.String |
LAST_DIR
|
protected java.io.File |
lastDir
|
Fields inherited from class uk.ac.essex.common.io.FileOp |
---|
file |
Constructor Summary | |
---|---|
FileOpImpl()
The file fileChooser is just a plain old JFileChooser . |
|
FileOpImpl(javax.swing.JFileChooser chooser)
Sets the file fileChooser to be whatever you want |
Method Summary | |
---|---|
abstract java.lang.String |
getDefaultEnding()
Gets the default file ending to postfix to the file name, this is only used if the file to save to has not been given by the user. |
javax.swing.JFileChooser |
getFileChooser()
|
protected boolean |
hasEnding(java.io.File f)
|
T |
open(java.awt.Component caller)
Open an operation from disk. |
abstract T |
openFile(java.io.File file)
|
boolean |
saveAs(T applicationFile,
java.awt.Component caller)
Save a given app file under a new name/file. |
void |
setFileChooser(javax.swing.JFileChooser fileChooser)
|
Methods inherited from class uk.ac.essex.common.io.FileOp |
---|
getFile, save |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LAST_DIR
protected javax.swing.JFileChooser fileChooser
protected java.io.File lastDir
protected java.awt.Component currentCaller
Constructor Detail |
---|
public FileOpImpl()
JFileChooser
.
public FileOpImpl(javax.swing.JFileChooser chooser)
chooser
- Method Detail |
---|
public abstract java.lang.String getDefaultEnding()
public abstract T openFile(java.io.File file)
file
- public javax.swing.JFileChooser getFileChooser()
public void setFileChooser(javax.swing.JFileChooser fileChooser)
fileChooser
- - The file fileChooser to use to get the required File
from the userpublic T open(java.awt.Component caller)
open
in class FileOp<T extends ApplicationFile>
caller
- - The parent Component of the file fileChooser dialog
openFile(java.io.File)
public boolean saveAs(T applicationFile, java.awt.Component caller)
FileOp.save(T)
to do the actual saving of the
file.
saveAs
in class FileOp<T extends ApplicationFile>
applicationFile
- - The file to savecaller
- - The parent Component of the file fileChooser dialog
FileOp.save(T)
protected boolean hasEnding(java.io.File f)
f
- - The file whose name to check
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |