public interface Spreadsheet
getRange(String, String, String)
or getWorksheet(String, String)
.
All the APIs in this class are designed with synchronized way and thread safe, unless
you change the default worker pool size Settings.Key.WORKER_POOL_SIZE
.Modifier and Type | Method and Description |
---|---|
void |
abortImporting(String bookName)
Aborts a importing job at remote server.
|
void |
addEventListener(String eventName,
RangeEventListener<? extends RangeEvent> listener)
Adds the event listener
|
void |
addExceptionHandler(Consumer<Throwable> callback)
adds an exception handler to this spreadsheet.
|
void |
clearEventListeners()
Removes all the event listeners.
|
void |
close()
Closes this client.
|
boolean |
containsWorkbook(String bookName)
Returns true, if the remote server contains the given bookName.
|
void |
delete()
Deletes the remote application and close this client.
|
void |
deleteWorkbook(String bookName)
Deletes the remote workbook with the given name, if any.
|
void |
deleteWorksheet()
Deletes the active worksheet from the active workbook.
|
void |
deleteWorksheet(int sheetIndex)
Deletes the worksheet at the given sheet index from the active workbook.
|
void |
deleteWorksheet(String sheetNameOrSheetId)
Deletes the worksheet with the given name or id from the active workbook.
|
void |
export(String bookName,
OutputStream outputStream)
Exports the book from the given bookname to an output stream.
|
void |
export(String bookName,
OutputStream outputStream,
String format)
Exports the book from the given bookname to an output stream with the given format.
|
void |
focus()
Retrieves the UI focus.
|
void |
freezePanes(int rowFreeze,
int columnFreeze)
freezes the panes for this active worksheet.
|
Range |
getActiveCell()
Returns the active cell focus range from the UI client.
|
String |
getAPIKey()
Returns the API key
|
String |
getAppId()
Returns the id of the unique keikai's Application that the spreadsheet belongs to.
|
String |
getBookName()
Returns the book name of the active workbook from the remote server.
|
List<DataValidationValue> |
getDataValidations()
Returns the data validations of the active worksheet from the remote server.
|
Range |
getRange(int row,
int column)
Returns the range with the given row and column for the active worksheet
of the active workbook.
|
Range |
getRange(int row,
int column,
int numRows,
int numColumns)
Returns the range with the given row and column with the given number
of the rows and columns from the active worksheet of the active workbook.
|
Range |
getRange(String a1Notation)
Returns the range with the given A1 notation or R1C1 notation from the
active worksheet of the active workbook.
|
Range |
getRange(String bookName,
int sheetIndex,
int row,
int column)
Returns the range with the given row and column from the given book name and sheet index.
|
Range |
getRange(String bookName,
int sheetIndex,
int row,
int column,
int numRows,
int numColumns)
Returns the range with the given row and column with the given number
of the rows and columns from the given sheet index of the given book name.
|
Range |
getRange(String bookName,
int sheetIndex,
String a1Notation)
Returns the range with the given A1 notation or R1C1 notation from
the given book name with the given sheet index.
|
Range |
getRange(String bookName,
String sheetNameOrSheetId,
int row,
int column)
Returns the range with the given row and column from the given book name and sheet name or id.
|
Range |
getRange(String bookName,
String sheetNameOrSheetId,
int row,
int column,
int numRows,
int numColumns)
Returns the range with the given row and column with the given number
of the rows and columns from the given sheet name or id of the given book name.
|
Range |
getRange(String bookName,
String sheetNameOrSheetId,
String a1Notation)
Returns the range with the given A1 notation or R1C1 notation from
the given book name with the given sheet name or id.
|
Range |
getRangeByName(String name)
Returns the range with the given name from
the active worksheet.
|
Range |
getRangeByName(String sheetNameOrSheetId,
String name)
Returns the range with the given name from
the active book with the given sheet name or id.
|
Range |
getRangeByName(String bookName,
String sheetNameOrSheetId,
String name)
Returns the range with the given name from
the given book name with the given sheet name or id.
|
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.
|
Workbook |
getWorkbook()
Returns the active workbook from the remote server.
|
Workbook |
getWorkbook(String name)
Returns the workbook by the given name from the remote server.
|
Worksheet |
getWorksheet()
Returns the active worksheet of the active workbook from the remote server.
|
Worksheet |
getWorksheet(int sheetIndex)
Returns the worksheet of the active workbook by the given sheet index from the remote server.
|
Worksheet |
getWorksheet(String sheetNameOrSheetId)
Returns the worksheet of the active workbook by the given sheet name or id from the remote server.
|
Worksheet |
getWorksheet(String bookName,
int sheetIndex)
Returns the worksheet of the given book name with the given sheet index
from the remote server.
|
Worksheet |
getWorksheet(String bookName,
String sheetNameOrSheetId)
Returns the worksheet of the given book name with the given sheet name or id from the remote server.
|
Workbook |
importAndReplace(String bookName,
File file)
Imports and replaces with the given workbook to the spreadsheet.
|
Workbook |
importAndReplace(String bookName,
InputStream is)
Imports and replaces with the given workbook to the spreadsheet.
|
Workbook |
importAndReplace(String bookName,
URL url)
Imports and replaces with the given workbook to the spreadsheet
* This method will delete the previous workbook at remote server.
|
Workbook |
imports(String bookName,
File file)
Imports the given workbook to the spreadsheet.
|
Workbook |
imports(String bookName,
InputStream is)
Imports the given workbook to the spreadsheet.
|
Workbook |
imports(String bookName,
URL url)
Imports the given workbook to the spreadsheet.
|
Worksheet |
insertWorksheet()
Inserts a new sheet before the active sheet in the active workbook,
with a default name.
|
Worksheet |
insertWorksheet(int index)
Inserts a new sheet at the given index in the active workbook,
with a default name.
|
Worksheet |
insertWorksheet(String name)
Inserts a new sheet before the active sheet in the active workbook,
with a given name.
|
boolean |
isClosed()
Returns whether the client is connected or not.
|
boolean |
isDisplaySheetGridlines()
Checks whether enables or disables the display sheet grid lines of the active worksheet.
|
boolean |
isImporting(String bookName)
Returns whether the book name is importing or not.
|
boolean |
removeEventListener(String eventName,
RangeEventListener<? extends RangeEvent> listener)
Removes the event listener
|
boolean |
removeExceptionHandler(Consumer<Throwable> callback)
Removes the given exception handler from this spreadsheet.
|
void |
setActiveWorkbook(String name)
Makes the active workbook from the given name.
|
void |
setActiveWorksheet(int index)
Sets the active worksheet of the active workbook with the given index.
|
void |
setActiveWorksheet(String sheetNameOrSheetId)
Sets the active worksheet of the active workbook with the given sheet name or id.
|
void |
setActiveWorksheet(String bookName,
int index)
Sets the active worksheet of the given book name with the given sheet index.
|
void |
setActiveWorksheet(String bookName,
String sheetNameOrSheetId)
Sets the active worksheet of the given book name with the given sheet name or id.
|
void |
setDisplaySheetGridlines(boolean enable)
Sets to enable or disable the display sheet grid lines of the active worksheet.
|
void |
setLeftheadWidth(int width)
Sets the left head panel width, must large then 0.
|
void |
setSheetVisible(String visibility)
Sets the visibility of this active worksheet.
|
void |
setTopheadHeight(int height)
Sets the top head panel height, must large then 0.
|
void |
setUiActivityCallback(UiActivity callback)
Sets a callback for UI client's activity.
|
void |
setUserActionEnabled(AuxAction action,
boolean enabled)
Sets to enable or disable the given user action.
|
void |
unfreezePanes()
un-freezes the panes of the active worksheet.
|
String getAppId()
String getWinId()
String getAPIKey()
Workbook getWorkbook()
Workbook getWorkbook(String name)
String getBookName()
boolean isImporting(String bookName)
bookName
- workbook namevoid abortImporting(String bookName)
bookName
- void setActiveWorkbook(String name)
name
- List<DataValidationValue> getDataValidations()
Worksheet.getDataValidations()
Worksheet getWorksheet()
Worksheet getWorksheet(int sheetIndex)
Worksheet getWorksheet(String sheetNameOrSheetId)
Worksheet getWorksheet(String bookName, String sheetNameOrSheetId)
Worksheet getWorksheet(String bookName, int sheetIndex)
void setActiveWorksheet(int index)
void setActiveWorksheet(String sheetNameOrSheetId)
void setActiveWorksheet(String bookName, String sheetNameOrSheetId)
void setActiveWorksheet(String bookName, int index)
Range getRange(String a1Notation)
a1Notation
- Range getRange(String bookName, String sheetNameOrSheetId, String a1Notation)
Range getRange(String bookName, int sheetIndex, String a1Notation)
Range getRange(int row, int column)
row
- the starting row index of the rangecolumn
- the starting column index of the range.Range getRange(String bookName, String sheetNameOrSheetId, int row, int column)
row
- the starting row index of the rangecolumn
- the starting column index of the range.Range getRange(String bookName, int sheetIndex, int row, int column)
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 columnsRange getRange(String bookName, String sheetNameOrSheetId, int row, int column, int numRows, int numColumns)
Range getRange(String bookName, int sheetIndex, int row, int column, int numRows, int numColumns)
Range getRangeByName(String bookName, String sheetNameOrSheetId, String name)
Range getRangeByName(String sheetNameOrSheetId, String name)
Range getRangeByName(String name)
void deleteWorksheet()
void deleteWorksheet(String sheetNameOrSheetId)
void deleteWorksheet(int sheetIndex)
Worksheet insertWorksheet()
Worksheet insertWorksheet(String name)
Worksheet insertWorksheet(int index)
void delete()
void deleteWorkbook(String bookName)
bookName
- boolean containsWorkbook(String bookName)
bookName
- Range getActiveCell()
void setSheetVisible(String visibility)
visibility
- Settings getSettings()
void close()
boolean isClosed()
Workbook imports(String bookName, InputStream is) throws DuplicateNameException, AbortedException
bookName
- is
- DuplicateNameException
- if the same name existsAbortedException
- if the importing job has been cancelled by someone else.Workbook imports(String bookName, File file) throws DuplicateNameException, FileNotFoundException, AbortedException
bookName
- file
- DuplicateNameException
- if the same name existsAbortedException
- if the importing job has been cancelled by someone else.FileNotFoundException
Workbook imports(String bookName, URL url) throws DuplicateNameException, IOException, AbortedException
bookName
- url
- DuplicateNameException
- if the same name existsAbortedException
- if the importing job has been cancelled by someone else.IOException
Workbook importAndReplace(String bookName, InputStream is) throws AbortedException
bookName
- is
- AbortedException
- if the importing job has been cancelled by someone else.Workbook importAndReplace(String bookName, File file) throws FileNotFoundException, AbortedException
bookName
- file
- AbortedException
- if the importing job has been cancelled by someone else.FileNotFoundException
Workbook importAndReplace(String bookName, URL url) throws IOException, AbortedException
bookName
- url
- AbortedException
- if the importing job has been cancelled by someone else.IOException
void export(String bookName, OutputStream outputStream)
By default, the format is "xlsx"
export(String, OutputStream, String)
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
- void clearEventListeners()
void setUiActivityCallback(UiActivity callback)
callback
- void setDisplaySheetGridlines(boolean enable)
enable
- true to enable.boolean isDisplaySheetGridlines()
void focus()
void setLeftheadWidth(int width)
void setTopheadHeight(int height)
void freezePanes(int rowFreeze, int columnFreeze)
rowFreeze
- the number of row to freeze, 0 means no freeze.columnFreeze
- the number of column to freeze, 0 means no freeze.void unfreezePanes()
void setUserActionEnabled(AuxAction action, boolean enabled)
action
- enabled
- true to enablevoid addExceptionHandler(Consumer<Throwable> callback)
callback
- Copyright © 2018. All rights reserved.