|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.table.gui.SaveWorker
Handles asynchronous table saving.
To save a table, create an instance of this class with a suitable
implementation of the attemptSave(uk.ac.starlink.table.StarTable)
method and call
invoke()
on it from the event dispatch thread.
A progress bar will advise the user on how
the save is going, and if the save fails a popup will advise of the
error. When the save has completed one way or another, the
done(boolean)
method will be called.
Constructor Summary | |
protected |
SaveWorker(Component parent,
StarTable table,
String location)
Constructs a save worker which will use its own popup widow for progress display. |
protected |
SaveWorker(JProgressBar progBar,
StarTable table,
String location)
Constructs a save worker which will use a given progress bar for progress display. |
Method Summary | |
protected abstract void |
attemptSave(StarTable table)
This method should do the work of saving the given table. |
void |
cancel()
Interrupts any save which is in progress. |
protected abstract void |
done(boolean success)
Called from the event dispatch thread when the save has completed. |
void |
invoke()
Begins the save. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected SaveWorker(Component parent, StarTable table, String location)
parent
- parent component used for progress bar popuptable
- table to be savedlocation
- string identifying the save destination - used for
display purposes onlyprotected SaveWorker(JProgressBar progBar, StarTable table, String location)
progBar
- progress bar which will be updated to display progresstable
- table to be savedlocation
- string identifying the save destination - used for
display purposes onlyMethod Detail |
protected abstract void attemptSave(StarTable table) throws IOException
table
- table to save
IOException
- if the table cannot be savedprotected abstract void done(boolean success)
The default implementation does nothing, but subclasses may override it to react in some way to the save's completion.
public void cancel()
public void invoke()
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |