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
|
Button |
addButton(String name,
String label,
RangeAnchor anchor)
Adds a button with the given range anchor on 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.
|
Range |
getAutoFilterRange()
Returns a range in which auto filter applied.
|
String |
getBookName()
Returns the workbook name
|
Button |
getButton(String name)
Returns the control button of the given name.
|
List<Button> |
getButtons()
Returns all control buttons
|
Checkbox |
getCheckbox(String name)
Returns the control checkbox of the given name.
|
Range |
getDataRegion()
Returns the region which contains data(including all shapes, charts, pictures,
and fills) in this sheet; return null if empty sheet.
|
List<DataValidationValue> |
getDataValidations()
Returns the data validations of this worksheet from the remote data server.
|
Dropdown |
getDropdown(String name)
Returns the control dropdown of the given name.
|
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(String name)
Returns the control groupbox of the given name.
|
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(String name)
Returns the control listbox of the given name.
|
String |
getName()
Returns the sheet name.
|
OptionButton |
getOptionButton(String name)
Returns the control option button of the given name.
|
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(String name)
Returns the control scrollbar of the given name.
|
String |
getSheetId()
Returns the uuid of this worksheet.
|
Spinner |
getSpinner(String name)
Returns the control spinner of the given name.
|
int |
getSplitColumn()
Returns the number of the frozen columns.
|
int |
getSplitRow()
Returns the number of the frozen rows.
|
Spreadsheet |
getSpreadsheet()
Returns the spreadsheet which holds this worksheet.
|
String |
getTooltip()
Returns tooltip text of the sheet tab UI.
|
Worksheet.Visibility |
getVisible()
Returns the visibility of this sheet.
|
Range |
getVisibleArea()
Returns the visible area.
|
Workbook |
getWorkbook()
Returns the workbook which holds this worksheet.
|
boolean |
isAutoFilterEnabled() |
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 |
removeButton(Button btn)
Remove the control button.
|
void |
rename(String newName)
Renames the sheet name.
|
void |
setTooltip(String text)
Sets tooltip text of the sheet tab UI.
|
void |
setVisible(Worksheet.Visibility visibility)
Sets the visibility of this sheet.
|
void |
setVisibleArea(String a1Notation)
Sets visible area for this worksheet.
|
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()
void removeButton(Button btn)
Button addButton(String name, String label, RangeAnchor anchor)
name
- the name of the button.label
- the label of the button.anchor
- the position of the button.Checkbox getCheckbox(String name)
OptionButton getOptionButton(String name)
Groupbox getGroupbox(String name)
Scrollbar getScrollbar(String name)
Dropdown getDropdown(String name)
Range getDataRegion()
int getSplitRow()
int getSplitColumn()
void setVisibleArea(String a1Notation)
Note that you can give null a1Notation to reset the visibleArea; i.e. make visible area to whole sheet.
a1Notation
- Range getVisibleArea()
boolean isAutoFilterEnabled()
Range getAutoFilterRange()
void setTooltip(String text)
text
- String getTooltip()
Copyright © 2018. All rights reserved.