public interface Worksheet
Modifier and Type | Interface and Description |
---|---|
static class |
Worksheet.Visibility
Visibility attributes that can be applied.
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activates the worksheet
|
Worksheet |
copyTo(int index)
Copies this sheet to this workbook at the given index, with a default
name.
|
void |
copyTo(String appId,
String bookName,
int index)
Copies this sheet to another workbook of another app at the given index, with a default
name.
|
Worksheet |
copyTo(Workbook workbook,
int index)
Copies this sheet to the workbook at the given index, with a default
name.
|
Worksheet |
copyToEnd()
Copies this sheet to the end of this workbook, with a default name.
|
void |
copyToEnd(String appId,
String bookName)
Copies this sheet to the end of another workbook of another app, with a default name.
|
Worksheet |
copyToEnd(Workbook workbook)
Copies this sheet to the end of the workbook, with a default name.
|
String |
getBookName()
Returns the workbook name
|
Button |
getButton(int index)
Returns the control button of the given index.
|
Button |
getButton(String nameOrShapeId)
Returns the control button of the given name or shapeId.
|
Checkbox |
getCheckbox(int index)
Returns the control checkbox of the given index.
|
Checkbox |
getCheckbox(String nameOrShapeId)
Returns the control checkbox of the given name or shapeId.
|
List<DataValidationValue> |
getDataValidations()
Returns the data validations of this worksheet from the remote data server.
|
Dropdown |
getDropdown(int index)
Returns the control dropdown of the given index.
|
Dropdown |
getDropdown(String nameOrShapeId)
Returns the control dropdown of the given name or shapeId.
|
int |
getFirstColumn(int row)
Returns the first column of row which contains data
|
int |
getFirstRow()
Returns the first row which contains data of this sheet
|
Groupbox |
getGroupbox(int index)
Returns the control groupbox of the given index.
|
Groupbox |
getGroupbox(String nameOrShapeId)
Returns the control groupbox of the given name or shapeId.
|
int |
getIndex()
Returns the sheet index.
|
int |
getLastColumn(int row)
Returns the last column of row which contains data
|
int |
getLastRow()
Returns the last row which contains data of this sheet
|
Listbox |
getListbox(int index)
Returns the control listbox of the given index.
|
Listbox |
getListbox(String nameOrShapeId)
Returns the control listbox of the given name or shapeId.
|
String |
getName()
Returns the sheet name.
|
OptionButton |
getOptionButton(int index)
Returns the control option button of the given index.
|
OptionButton |
getOptionButton(String nameOrShapeId)
Returns the control option button of the given name or shapeId.
|
Range |
getRange(int row,
int column)
Returns the range with the given row and column.
|
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
|
Range |
getRange(String a1Notation)
Returns the range with the given A1 notation or R1C1 notation.
|
Scrollbar |
getScrollbar(int index)
Returns the control scrollbar of the given index.
|
Scrollbar |
getScrollbar(String nameOrShapeId)
Returns the control scrollbar of the given name or shapeId.
|
String |
getSheetId()
Returns the uuid of this worksheet.
|
Spinner |
getSpinner(int index)
Returns the control spinner of the given index.
|
Spinner |
getSpinner(String nameOrShapeId)
Returns the control spinner of the given name or shapeId.
|
Spreadsheet |
getSpreadsheet()
Returns the spreadsheet which holds this worksheet.
|
Worksheet.Visibility |
getVisible()
Returns the visibility of this sheet.
|
Workbook |
getWorkbook()
Returns the workbook which holds this worksheet.
|
boolean |
isProtected()
Returns true if the sheet is protected.
|
void |
protect(SheetProtection sheetProtection)
Protects this sheet so that it cannot be modified.
|
void |
protect(String password,
boolean drawingObjects,
boolean scenarios,
boolean userInterfaceOnly,
boolean allowFormattingCells,
boolean allowFormattingColumns,
boolean allowFormattingRows,
boolean allowInsertingColumns,
boolean allowInsertingRows,
boolean allowInsertingHyperlinks,
boolean allowDeletingColumns,
boolean allowDeletingRows,
boolean allowSorting,
boolean allowFiltering,
boolean allowUsingPivotTables,
boolean allowSelectLockedCells,
boolean allowSelectUnlockedCells)
Protects this sheet so that it cannot be modified.
|
void |
rename(String newName)
Renames the sheet name.
|
void |
setVisible(Worksheet.Visibility visibility)
Sets the visibility of this sheet.
|
boolean |
unprotect(String password)
Removes protection to this sheet.
|
String getSheetId()
int getIndex()
String getBookName()
Spreadsheet getSpreadsheet()
Workbook getWorkbook()
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 setVisible(Worksheet.Visibility visibility)
visibility
- either Worksheet.Visibility.Visible
, Worksheet.Visibility.Hidden
,
or Worksheet.Visibility.VeryHidden
Worksheet.Visibility getVisible()
String getName()
void rename(String newName)
newName
- void activate()
Worksheet copyToEnd()
void copyToEnd(String appId, String bookName)
appId
- the app idbookName
- the book name belongs to the given app idWorksheet copyTo(int index)
index
- the sheet index in the workbook where the copied placed.void copyTo(String appId, String bookName, int index)
appId
- the app idbookName
- the book name belongs to the given app idindex
- the sheet index in the workbook where the copied placed.Worksheet copyToEnd(Workbook workbook)
workbook
- the workbook which this sheet copies to.Worksheet copyTo(Workbook workbook, int index)
workbook
- the workbook which this sheet copies to.index
- the index in the workbook where the copied sheet placed.List<DataValidationValue> getDataValidations()
int getFirstRow()
int getLastRow()
int getFirstColumn(int row)
row
- int getLastColumn(int row)
row
- void protect(String password, boolean drawingObjects, boolean scenarios, boolean userInterfaceOnly, boolean allowFormattingCells, boolean allowFormattingColumns, boolean allowFormattingRows, boolean allowInsertingColumns, boolean allowInsertingRows, boolean allowInsertingHyperlinks, boolean allowDeletingColumns, boolean allowDeletingRows, boolean allowSorting, boolean allowFiltering, boolean allowUsingPivotTables, boolean allowSelectLockedCells, boolean allowSelectUnlockedCells)
unprotect(String password)
.
change the protection options; make sure providepassword
- a case-sensitive password for the sheet; null or empty string means protect the sheet without password.drawingObjects
- true to protect objects; default to true.scenarios
- true to protect scenarios; default to true.userInterfaceOnly
- true to forbid user to modify this the through UI e.g. click a button on the toolbar, but calling API still can modify the sheet; default to false.allowFormattingCells
- true to allow user to format any cell on the protected sheet; default to false.allowFormattingColumns
- true to allow user to format any columns on the protected sheet; default to false.allowFormattingRows
- true to allow user to format any rows on the protected sheet; default to false.allowInsertingColumns
- true to allow user to insert columns on the protected sheet; default to false.allowInsertingRows
- true to allow user to insert rows on the protected sheet; default false.allowInsertingHyperlinks
- true to allow user to insert hyperlinks on the protected sheet; default to false.allowDeletingColumns
- true to allow user to delete columns on the protected sheet; default to false.allowDeletingRows
- true to allow user to delete rows on the protected sheet; default to false.allowSorting
- true to allow user to sort on the protected sheet; default to false.allowFiltering
- true to allow user to set filters on the protected sheet; default to false.allowUsingPivotTables
- true to allow user to use pivot table reports on the protected sheet; default to false.allowSelectLockedCells
- true to allow select locked cells.allowSelectUnlockedCells
- true to allow select unlocked cells.protect(SheetProtection)
,
unprotect(String password)
void protect(SheetProtection sheetProtection)
unprotect(String password)
.boolean unprotect(String password)
password
- a case-sensitive password used to unprotect the sheet. If
the sheet isn't protected with a password, this argument is ignored. If you
omit this argument for a sheet that is protected with a password, you'll be
prompted for the password.boolean isProtected()
Button getButton(String nameOrShapeId)
Button getButton(int index)
Checkbox getCheckbox(String nameOrShapeId)
Checkbox getCheckbox(int index)
OptionButton getOptionButton(String nameOrShapeId)
OptionButton getOptionButton(int index)
Groupbox getGroupbox(String nameOrShapeId)
Groupbox getGroupbox(int index)
Spinner getSpinner(String nameOrShapeId)
Spinner getSpinner(int index)
Scrollbar getScrollbar(String nameOrShapeId)
Scrollbar getScrollbar(int index)
Dropdown getDropdown(String nameOrShapeId)
Dropdown getDropdown(int index)
Listbox getListbox(String nameOrShapeId)
Listbox getListbox(int index)
Copyright © 2018. All rights reserved.