public interface Spreadsheet
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(String eventName,
RangeEventListener<? extends RangeEvent> listener)
Adds the event listener
|
void |
close()
Closes this client.
|
CompletableFuture<Boolean> |
delete()
Deletes the remote workbook and close this client.
|
CompletableFuture<Void> |
export(String bookName,
OutputStream outputStream)
Exports the book from the given bookname to an output stream.
|
CompletableFuture<Void> |
export(String bookName,
OutputStream outputStream,
String format)
Exports the book from the given bookname to an output stream with the given format.
|
String |
getActiveWorkbook()
Returns a String name of this active workbook in this
spreadsheet client.
|
Object |
getActiveWorksheet()
Returns an Integer index or a String name of this active worksheet in this
spreadsheet client.
|
String |
getId()
Returns the id of the unique keikai's Application
|
Range |
getRange(int row,
int column)
Returns the range proxy with the given row and column.
|
Range |
getRange(int row,
int column,
int numRows,
int numColumns)
Returns the range proxy with the given row and column with the given number
of the rows and columns
|
Range |
getRange(String a1Notation)
Returns the range proxy with the given A1 notation or R1C1 notation.
|
Settings |
getSettings()
Returns the settings of this spreadsheet
|
String |
getURI(String domId)
Return the remote access URI for this client.
|
CompletableFuture<Workbook> |
imports(String bookName,
File file)
Imports the given workbook to the current spreadsheet.
|
CompletableFuture<Workbook> |
imports(String bookName,
InputStream is)
Imports the given workbook to the current spreadsheet.
|
CompletableFuture<Workbook> |
imports(String bookName,
URL url)
Imports the given workbook to the current spreadsheet.
|
void |
insertWorksheet()
Inserts a new sheet in the active workbook, with a default name.
|
void |
insertWorksheet(int index)
Inserts a new sheet in the active workbook at the given index, with a default name.
|
void |
insertWorksheet(String name)
Inserts a new sheet in the active workbook, with a given name.
|
CompletableFuture<Boolean> |
isReady()
Checks whether the spreadsheet client is available at the remote server.
|
CompletableFuture<Range> |
loadActiveCell()
Returns the current cell focus range from the UI client.
|
CompletableFuture<Workbook> |
loadWorkbook()
Returns the active workbook from the remote server.
|
CompletableFuture<Workbook> |
loadWorkbook(String name)
Returns the workbook by the given name from the remote server.
|
CompletableFuture<Worksheet> |
loadWorksheet()
Returns the active worksheet from the remote server.
|
CompletableFuture<Worksheet> |
loadWorksheet(int index)
Returns the worksheet by the given index from the remote server.
|
CompletableFuture<Worksheet> |
loadWorksheet(String name)
Returns the worksheet by the given name from the remote server.
|
CompletableFuture<Void> |
ready()
Returns a future to apply a callback when this spreadsheet becomes available
to handle a job at the remote server.
|
void |
ready(Runnable callback)
Executes the callback as soon as this spreadsheet client becomes available
to handle a job at the remote server.
|
boolean |
removeEventListener(String eventName,
RangeEventListener<? extends RangeEvent> listener)
Removes the event listener
|
void |
setActiveWorkbook(String name)
Sets the active workbook with the given name.
|
void |
setActiveWorksheet(int index)
Sets the active worksheet with the given index.
|
void |
setActiveWorksheet(Object indexOrName)
Sets the active worksheet with the given name or index.
|
void |
setActiveWorksheet(String name)
Sets the active worksheet with the given name.
|
void |
setSheetVisible(String visibility)
Sets the visibility of this active worksheet.
|
String getId()
String getActiveWorkbook()
CompletableFuture<Workbook> loadWorkbook()
CompletableFuture<Workbook> loadWorkbook(String name)
void setActiveWorkbook(String name)
CompletableFuture<Worksheet> loadWorksheet()
CompletableFuture<Worksheet> loadWorksheet(int index)
CompletableFuture<Worksheet> loadWorksheet(String name)
Object getActiveWorksheet()
void setActiveWorksheet(int index)
void setActiveWorksheet(String name)
void setActiveWorksheet(Object indexOrName)
Range getRange(String a1Notation)
a1Notation
- Range getRange(int row, int column)
row
- the starting row index of the rangecolumn
- the starting column index of the range.Range getRange(int row, int column, int numRows, int numColumns)
row
- the starting row index of the rangecolumn
- the starting column index of the rangenumRows
- the number of the rowsnumColumns
- the number of the columnsvoid ready(Runnable callback)
callback
- ready()
CompletableFuture<Void> ready()
If the exception thrown in a callback, the returned future can provide a way
to catch the exception by using CompletableFuture.exceptionally(Function)
or CompletableFuture.whenComplete(BiConsumer)
ready(Runnable)
CompletableFuture<Boolean> isReady()
void insertWorksheet()
void insertWorksheet(String name)
void insertWorksheet(int index)
CompletableFuture<Boolean> delete()
CompletableFuture<Range> loadActiveCell()
void setSheetVisible(String visibility)
visibility
- Settings getSettings()
void close()
CompletableFuture<Workbook> imports(String bookName, InputStream is) throws IOException
The importing is handled in an async way, so the next code may run before
the importing finish. To get ready for the importing, we can use CompletableFuture.whenComplete(BiConsumer)
to run some actions when the importing job has done.
bookName
- is
- IOException
CompletableFuture<Workbook> imports(String bookName, File file) throws IOException
The importing is handled in an async way, so the next code may run before
the importing finish. To get ready for the importing, we can use CompletableFuture.whenComplete(BiConsumer)
to run some actions when the importing job has done.
bookName
- file
- IOException
CompletableFuture<Workbook> imports(String bookName, URL url) throws IOException
The importing is handled in an async way, so the next code may run before
the importing finish. To get ready for the importing, we can use CompletableFuture.whenComplete(BiConsumer)
to run some actions when the importing job has done.
bookName
- url
- IOException
CompletableFuture<Void> export(String bookName, OutputStream outputStream)
By default, the format is "xlsx"
export(String, OutputStream, String)
CompletableFuture<Void> export(String bookName, OutputStream outputStream, String format)
bookName
- outputStream
- format
- either "pdf" or "xlsx"void addEventListener(String eventName, RangeEventListener<? extends RangeEvent> listener)
eventName
- listener
- boolean removeEventListener(String eventName, RangeEventListener<? extends RangeEvent> listener)
eventName
- listener
- Copyright © 2017. All rights reserved.