public class CleanSheets extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CleanSheets.EventDispatcher
A utility for dispatching events on the AWT event dispatching thread.
|
Constructor and Description |
---|
CleanSheets()
Creates the CleanSheets application.
|
Modifier and Type | Method and Description |
---|---|
void |
addSpreadsheetAppListener(SpreadsheetAppListener listener)
Registers the given listener on the spreadsheet application.
|
void |
create()
Creates a new workbook.
|
void |
exit()
Exits the application.
|
File |
getFile(Workbook workbook)
Returns the file in which the given workbook is stored.
|
Properties |
getUserProperties()
Returns the current user properties.
|
Workbook |
getWorkbook(File file)
Returns the workbook that is stored in the given file, if it is already
open.
|
Workbook[] |
getWorkbooks()
Returns the workbooks that are open.
|
boolean |
isFileOpen(File file)
Returns whether the given file is open, and a workbook thereby loaded
from it or saved to it.
|
boolean |
isWorkbookStored(Workbook workbook)
Returns whether a file has been specified for the given workbook,
either when it was loaded or when it was last saved.
|
void |
load(File file)
Loads a workbook from the given file.
|
static void |
main(String[] args)
Starts CleanSheets from the command-line.
|
void |
removeSpreadsheetAppListener(SpreadsheetAppListener listener)
Removes the given listener from the spreadsheet application.
|
void |
save(Workbook workbook)
Saves the given workbook to the file from which it was loaded,
or to which it was most recently saved.
|
void |
saveAs(Workbook workbook,
File file)
Saves the given workbook to the given file.
|
void |
unload(Workbook workbook)
Unloads the given workbook.
|
public CleanSheets()
public static void main(String[] args)
args
- the command-line arguments (not used)public Properties getUserProperties()
public void exit()
public void create()
public void load(File file) throws IOException, ClassNotFoundException
file
- the file in which the workbook is storedIOException
- if the file could not be loaded correctlyClassNotFoundException
public void unload(Workbook workbook)
workbook
- the workbook to unloadpublic void save(Workbook workbook) throws IOException
workbook
- the workbook to saveIOException
- if the file could not be saved correctlypublic void saveAs(Workbook workbook, File file) throws IOException
workbook
- the workbook to savefile
- the file to which the workbook should be savedIOException
- if the file could not be saved correctlypublic Workbook[] getWorkbooks()
public File getFile(Workbook workbook)
public boolean isWorkbookStored(Workbook workbook)
public Workbook getWorkbook(File file)
file
- the file to look forpublic boolean isFileOpen(File file)
file
- the file to look forpublic void addSpreadsheetAppListener(SpreadsheetAppListener listener)
listener
- the listener to be addedpublic void removeSpreadsheetAppListener(SpreadsheetAppListener listener)
listener
- the listener to be removed