public interface Spreadsheet
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(String eventName,
RangeEventListener<? extends RangeEvent> listener)
Adds the event listener
|
CompletableFuture<Worksheet> |
applyActiveWorksheet(int index)
Makes the active worksheet from the given index in the current workbook.
|
CompletableFuture<Worksheet> |
applyActiveWorksheet(String name)
Makes the active worksheet from the given name.
|
CompletableFuture<Void> |
applySheetVisible(String visibility)
Sets the visibility of this current worksheet.
|
CompletableFuture<Void> |
cancelImportJob(String bookName)
Cancels the importing job for the given workbook name.
|
void |
close()
Closes this client.
|
CompletableFuture<Boolean> |
containsWorkbook(String bookName)
Returns true, if the remote server contains the given bookName.
|
CompletableFuture<Void> |
delete()
Deletes the remote application and close this client.
|
CompletableFuture<Void> |
deleteActiveWorksheet()
Deletes the active worksheet
|
CompletableFuture<Void> |
deleteWorkbook(String bookName)
Deletes the remote workbook with the given name, if any.
|
CompletableFuture<Void> |
deleteWorksheet()
Deletes the current worksheet
|
CompletableFuture<Void> |
deleteWorksheet(int index)
Deletes the worksheet in the current workbook at the given index
|
CompletableFuture<Void> |
deleteWorksheet(String name)
Deletes the worksheet with the given name
|
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 |
getAPIKey()
Returns the API key
|
String |
getAppId()
Returns the id of the unique keikai's Application that the spreadsheet belongs to.
|
String |
getCurrentWorkbook()
Returns a String name of this current workbook in this
spreadsheet client.
|
Object |
getCurrentWorksheet()
Returns an Integer index or a String name of this current worksheet in this
spreadsheet client.
|
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.
|
String |
getWinId()
Returns the id of the window view in the keikai's Application.
|
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.
|
CompletableFuture<Worksheet> |
insertWorksheet()
Inserts a new sheet before the active sheet in the current workbook,
with a default name.
|
CompletableFuture<Worksheet> |
insertWorksheet(int index)
Inserts a new sheet before the active sheet
in the current workbook at the given index, with a default name.
|
CompletableFuture<Worksheet> |
insertWorksheet(String name)
Inserts a new sheet before the active sheet in the current workbook, with a given name.
|
boolean |
isClosed()
Returns whether the client is connected or not.
|
CompletableFuture<Boolean> |
isReady()
Checks whether the spreadsheet client is available at the remote server.
|
CompletableFuture<Range> |
loadActiveCell()
Returns the active cell focus range from the UI client.
|
CompletableFuture<Worksheet> |
loadActiveWorksheet()
Returns the active worksheet from the UI client.
|
CompletableFuture<List<DataValidationValue>> |
loadDataValidations()
Loads the data validations of the current worksheet from the remote server.
|
CompletableFuture<Workbook> |
loadWorkbook()
Returns the current 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 current 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 |
setCurrentWorkbook(String name)
Sets the current workbook with the given name.
|
void |
setCurrentWorksheet(int index)
Sets the current worksheet with the given index.
|
void |
setCurrentWorksheet(Object indexOrName)
Sets the current worksheet with the given name or index.
|
void |
setCurrentWorksheet(String name)
Sets the current worksheet with the given name.
|
String getAppId()
String getWinId()
String getAPIKey()
String getCurrentWorkbook()
CompletableFuture<Workbook> loadWorkbook()
CompletableFuture<Workbook> loadWorkbook(String name)
void setCurrentWorkbook(String name)
CompletableFuture<List<DataValidationValue>> loadDataValidations()
CompletableFuture<Worksheet> loadWorksheet()
CompletableFuture<Worksheet> loadActiveWorksheet()
CompletableFuture<Worksheet> loadWorksheet(int index)
CompletableFuture<Worksheet> loadWorksheet(String name)
Object getCurrentWorksheet()
void setCurrentWorksheet(int index)
void setCurrentWorksheet(String name)
void setCurrentWorksheet(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()
CompletableFuture<Void> deleteActiveWorksheet()
CompletableFuture<Void> deleteWorksheet()
CompletableFuture<Void> deleteWorksheet(String name)
CompletableFuture<Void> deleteWorksheet(int index)
CompletableFuture<Worksheet> insertWorksheet()
CompletableFuture<Worksheet> insertWorksheet(String name)
CompletableFuture<Worksheet> insertWorksheet(int index)
CompletableFuture<Void> delete()
CompletableFuture<Void> deleteWorkbook(String bookName)
bookName
- CompletableFuture<Boolean> containsWorkbook(String bookName)
bookName
- CompletableFuture<Range> loadActiveCell()
CompletableFuture<Void> applySheetVisible(String visibility)
visibility
- CompletableFuture<Worksheet> applyActiveWorksheet(String name)
name
- CompletableFuture<Worksheet> applyActiveWorksheet(int index)
index
- Settings getSettings()
void close()
boolean isClosed()
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> cancelImportJob(String bookName)
bookName
- 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.