|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.ooffice.SpreadsheetFrame
public class SpreadsheetFrame
simplifies handling of OpenOffice spreadsheets This class implements ThirdParty for its use of OpenOffice libraries; see www.openoffice.org
| Nested Class Summary | |
|---|---|
static class |
SpreadsheetFrame.CellFormat
used to format a cell value |
| Constructor Summary | |
|---|---|
SpreadsheetFrame()
creates a blank new spreadsheet |
|
SpreadsheetFrame(File template)
creates a new document based on the given template file |
|
SpreadsheetFrame(File file,
Properties props)
loads a document (the given file) into a blank frame along with the given properties |
|
| Method Summary | |
|---|---|
void |
close()
closes and disposes the document |
void |
copySheet(String origin,
String target,
short index)
|
static String |
defaultExtension()
|
static SpreadsheetFrame |
getActiveDocument()
seeks the currently active document on the desktop (if any) and returns it |
static String |
getCellAddressString(int row,
int column)
|
String |
getCellFormula(String sheet,
int row,
int column)
|
com.sun.star.sheet.XSpreadsheetDocument |
getDocument()
|
com.sun.star.sheet.XSpreadsheet |
getSheet(int index)
|
com.sun.star.sheet.XSpreadsheet |
getSheet(String name)
|
String[] |
getSheetNames()
|
void |
insertNewSheet(String name,
short index)
|
void |
moveSheetToIndex(String name,
short index)
|
void |
placeTableModel(TableModel model,
String sheet,
int row,
int column)
places the given model into the spreadsheet with the upper left corner at the given location using a variety of useful default cell formats |
void |
print()
|
void |
print(String printerName)
|
void |
setCellDate(String sheet,
int row,
int column,
Date date)
|
void |
setCellDateTime(String sheet,
int row,
int column,
Date date)
|
void |
setCellFormula(String sheet,
int row,
int column,
String formula)
|
void |
setCellTime(String sheet,
int row,
int column,
Date date)
|
void |
setCellTime(String sheet,
int row,
int column,
TimeInDay time)
|
void |
setCellValue(String sheet,
int row,
int column,
double value)
|
void |
setCellValue(String sheet,
int row,
int column,
Object value)
makes a best effort to set the cell's value using an appropriate format |
void |
setCellValue(String sheet,
int row,
int column,
String value,
SpreadsheetFrame.CellFormat format)
sheet, value, format must not be null |
void |
storeTo(File file,
boolean representNewLocation)
saves the embedded document to the given file (overwriting it, if it exists) |
void |
storeTo(File file,
String filterName,
boolean representNewLocation)
saves the given document to the given file (overwriting it, if it exists) in the given format |
void |
storeTo(String url,
boolean representNewLocation)
saves the given document to the given url (overwriting the url if it exists) |
void |
storeTo(String url,
String filterName,
boolean representNewLocation)
allows to specify a filterName that defines the output format (null is allowed). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SpreadsheetFrame()
throws OfficeException
OfficeException
public SpreadsheetFrame(File template)
throws OfficeException,
IOException
OfficeException
IOException
public SpreadsheetFrame(File file,
Properties props)
throws OfficeException,
IOException
OfficeException
IOException| Method Detail |
|---|
public static SpreadsheetFrame getActiveDocument()
throws OfficeException
OfficeExceptionpublic com.sun.star.sheet.XSpreadsheetDocument getDocument()
public String[] getSheetNames()
public com.sun.star.sheet.XSpreadsheet getSheet(int index)
throws OfficeException
OfficeException
public com.sun.star.sheet.XSpreadsheet getSheet(String name)
throws OfficeException,
IllegalArgumentException
OfficeException
IllegalArgumentException
public void setCellValue(String sheet,
int row,
int column,
double value)
throws OfficeException
OfficeException
public void setCellFormula(String sheet,
int row,
int column,
String formula)
throws OfficeException
OfficeException
public void setCellDate(String sheet,
int row,
int column,
Date date)
throws OfficeException,
IllegalArgumentException
OfficeException
IllegalArgumentException
public void setCellTime(String sheet,
int row,
int column,
TimeInDay time)
throws OfficeException,
IllegalArgumentException
OfficeException
IllegalArgumentException
public void setCellTime(String sheet,
int row,
int column,
Date date)
throws OfficeException,
IllegalArgumentException
OfficeException
IllegalArgumentException
public void setCellDateTime(String sheet,
int row,
int column,
Date date)
throws OfficeException,
IllegalArgumentException
OfficeException
IllegalArgumentException
public void setCellValue(String sheet,
int row,
int column,
Object value)
throws OfficeException
OfficeException
public void setCellValue(String sheet,
int row,
int column,
String value,
SpreadsheetFrame.CellFormat format)
throws OfficeException,
IllegalArgumentException
OfficeException
IllegalArgumentException
public String getCellFormula(String sheet,
int row,
int column)
throws OfficeException,
IllegalArgumentException
OfficeException
IllegalArgumentException
public void placeTableModel(TableModel model,
String sheet,
int row,
int column)
throws OfficeException
OfficeException
public static String getCellAddressString(int row,
int column)
public void copySheet(String origin,
String target,
short index)
public void moveSheetToIndex(String name,
short index)
public void insertNewSheet(String name,
short index)
public static String defaultExtension()
public void storeTo(File file,
boolean representNewLocation)
throws IOException
IOException
public void storeTo(File file,
String filterName,
boolean representNewLocation)
throws IOException
IOException
public void storeTo(String url,
boolean representNewLocation)
throws IOException
IOException
public void storeTo(String url,
String filterName,
boolean representNewLocation)
throws IOException
representNewLocation = true.
IOException
public void close()
throws IOException
close in interface CloseableIOException
public void print()
throws OfficeException
OfficeException
public void print(String printerName)
throws IllegalArgumentException
IllegalArgumentException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||