public static final class SheetProtection.Builder extends Object
Modifier and Type | Method and Description |
---|---|
SheetProtection |
build()
Returns an instance of SheetProtection created from the fields set on this builder.
|
static SheetProtection.Builder |
create()
Creates the builder instance.
|
SheetProtection.Builder |
withAutoFilterAllowed(boolean autoFilterAllowed)
Sets true to allow user to set filters on the protected sheet
|
SheetProtection.Builder |
withDeleteColumnsAllowed(boolean deleteColumnsAllowed)
Sets true to allow user to delete columns on the protected sheet.
|
SheetProtection.Builder |
withDeleteRowsAllowed(boolean deleteRowsAllowed)
Sets true to allow user to delete rows on the protected sheet.
|
SheetProtection.Builder |
withFormatCellsAllowed(boolean formatCellsAllowed)
Sets true to allow user to format any cell on the protected sheet.
|
SheetProtection.Builder |
withFormatColumnsAllowed(boolean formatColumnsAllowed)
Sets true to allow user to format any columns on the protected sheet.
|
SheetProtection.Builder |
withFormatRowsAllowed(boolean formatRowsAllowed)
Sets true to allow user to format any rows on the protected sheet.
|
SheetProtection.Builder |
withInsertColumnsAllowed(boolean insertColumnsAllowed)
Sets true to allow user to insert columns on the protected sheet.
|
SheetProtection.Builder |
withInsertHyperlinksAllowed(boolean insertHyperlinksAllowed)
Sets true to allow user to insert hyperlinks on the protected sheet.
|
SheetProtection.Builder |
withInsertRowsAllowed(boolean insertRowsAllowed)
Sets true to allow user to insert rows on the protected sheet.
|
SheetProtection.Builder |
withObjectsEditable(boolean objectsEditable)
Sets the objectsEditable to true to protect objects.
|
SheetProtection.Builder |
withPassword(String password)
Sets the case-sensitive password for the sheet; null or empty string
means protect the sheet without password.
|
SheetProtection.Builder |
withPivotTablesAllowed(boolean pivotTablesAllowed)
Sets true to allow user to use pivot table reports on the protected sheet.
|
SheetProtection.Builder |
withScenariosEditable(boolean scenarios)
Sets true to protect scenarios.
|
SheetProtection.Builder |
withSelectLockedCellsAllowed(boolean selectLockedCellsAllowed)
Sets true to allow select locked cells.
|
SheetProtection.Builder |
withSelectUnlockedCellsAllowed(boolean selectUnlockedCellsAllowed)
Sets true to allow select unlocked cells
|
SheetProtection.Builder |
withSortAllowed(boolean sortAllowed)
Sets true to allow user to sort on the protected sheet.
|
public static SheetProtection.Builder create()
public SheetProtection.Builder withPassword(String password)
Default to null
password
- public SheetProtection.Builder withObjectsEditable(boolean objectsEditable)
Default to true
objectsEditable
- public SheetProtection.Builder withScenariosEditable(boolean scenarios)
Default to true
scenarios
- public SheetProtection.Builder withFormatCellsAllowed(boolean formatCellsAllowed)
Default to false
formatCellsAllowed
- public SheetProtection.Builder withFormatColumnsAllowed(boolean formatColumnsAllowed)
Default to false
formatColumnsAllowed
- public SheetProtection.Builder withFormatRowsAllowed(boolean formatRowsAllowed)
Default to false
formatRowsAllowed
- public SheetProtection.Builder withInsertColumnsAllowed(boolean insertColumnsAllowed)
Default to false
insertColumnsAllowed
- public SheetProtection.Builder withInsertRowsAllowed(boolean insertRowsAllowed)
Default to false
insertRowsAllowed
- public SheetProtection.Builder withInsertHyperlinksAllowed(boolean insertHyperlinksAllowed)
Default to false
insertHyperlinksAllowed
- public SheetProtection.Builder withDeleteColumnsAllowed(boolean deleteColumnsAllowed)
Default to false
deleteColumnsAllowed
- public SheetProtection.Builder withDeleteRowsAllowed(boolean deleteRowsAllowed)
Default to false
deleteRowsAllowed
- public SheetProtection.Builder withSortAllowed(boolean sortAllowed)
Default to false
sortAllowed
- public SheetProtection.Builder withAutoFilterAllowed(boolean autoFilterAllowed)
Default to false
autoFilterAllowed
- public SheetProtection.Builder withPivotTablesAllowed(boolean pivotTablesAllowed)
Default to false
pivotTablesAllowed
- public SheetProtection.Builder withSelectLockedCellsAllowed(boolean selectLockedCellsAllowed)
Default to false
selectLockedCellsAllowed
- public SheetProtection.Builder withSelectUnlockedCellsAllowed(boolean selectUnlockedCellsAllowed)
selectUnlockedCellsAllowed
- public SheetProtection build()
Copyright © 2020. All rights reserved.