|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.gui.SaveBuffer
This class handles the saving of StringBuffers to files. It will pop up a file chooser allowing the user to select a destination file. If the file exists, the user is prompted for the correct course of action, ie. overwriting, appending, selecting a new filename or canceling.
Field Summary | |
private java.lang.String |
m_lastvisitedDirectory
Last directory selected from the file chooser |
private Logger |
m_Log
The Logger to send messages to |
private java.awt.Component |
m_parentComponent
The parent component requesting the save |
Constructor Summary | |
SaveBuffer(Logger log,
java.awt.Component parent)
Constructor |
Method Summary | |
static void |
main(java.lang.String[] args)
Main method for testing this class |
boolean |
save(java.lang.StringBuffer buf)
Save a buffer |
private boolean |
saveOverwriteAppend(java.lang.StringBuffer buf,
java.io.File sFile,
boolean append)
Saves the provided buffer to the specified file |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Logger m_Log
private java.awt.Component m_parentComponent
private java.lang.String m_lastvisitedDirectory
Constructor Detail |
public SaveBuffer(Logger log, java.awt.Component parent)
log
- the logger to send messages toparent
- the parent component will be requesting a saveMethod Detail |
public boolean save(java.lang.StringBuffer buf)
buf
- the buffer to save
private boolean saveOverwriteAppend(java.lang.StringBuffer buf, java.io.File sFile, boolean append)
buf
- the buffer to savesFile
- the file to save toappend
- true if buffer is to be appended to file
public static void main(java.lang.String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |