public final class WorksheetProtection extends Object
Fields in this class are simply written to Excel file and have no effect on the behavior of this library. For more information on worksheet protection, consult Microsoft Excel documentation.
Modifier and Type | Method and Description |
---|---|
static int |
calculatePasswordHash(String password) |
int |
getPasswordHash()
Gets the password hash for protected sheet.
|
boolean |
hasPassword()
Gets a value indicating whether the protected sheet has a password.
|
boolean |
isAllowDeletingColumns()
Gets if deleting columns is allowed.
|
boolean |
isAllowDeletingRows()
Gets if deleting rows is allowed.
|
boolean |
isAllowEditingObjects()
Gets if editing objects is allowed.
|
boolean |
isAllowEditingScenarios()
Gets if editing scenarios is allowed.
|
boolean |
isAllowFormattingCells()
Gets if formatting cells is allowed.
|
boolean |
isAllowFormattingColumns()
Gets if formatting columns is allowed.
|
boolean |
isAllowFormattingRows()
Gets if formatting rows is allowed.
|
boolean |
isAllowInsertingColumns()
Gets if inserting columns is allowed.
|
boolean |
isAllowInsertingHyperlinks()
Gets if inserting hyperlinks is allowed.
|
boolean |
isAllowInsertingRows()
Gets if inserting rows is allowed.
|
boolean |
isAllowSelectingLockedCells()
Gets if selecting locked cells is allowed.
|
boolean |
isAllowSelectingUnlockedCells()
Gets if selecting unlocked cells is allowed.
|
boolean |
isAllowSorting()
Gets if sorting is allowed.
|
boolean |
isAllowUsingAutoFilter()
Gets if using autofilter is allowed.
|
boolean |
isAllowUsingPivotTableReports()
Gets if using pivot table reports is allowed.
|
void |
setAllowDeletingColumns(boolean allowDeletingColumns)
Sets if deleting columns is allowed.
|
void |
setAllowDeletingRows(boolean allowDeletingRows)
Sets if deleting rows is allowed.
|
void |
setAllowEditingObjects(boolean allowEditingObjects)
Sets if editing objects is allowed.
|
void |
setAllowEditingScenarios(boolean allowEditingScenarios)
Sets if editing scenarios is allowed.
|
void |
setAllowFormattingCells(boolean allowFormattingCells)
Sets if formatting cells is allowed.
|
void |
setAllowFormattingColumns(boolean allowFormattingColumns)
Sets if formatting columns is allowed.
|
void |
setAllowFormattingRows(boolean allowFormattingRows)
Sets if formatting rows is allowed.
|
void |
setAllowInsertingColumns(boolean allowInsertingColumns)
Sets if inserting columns is allowed.
|
void |
setAllowInsertingHyperlinks(boolean allowInsertingHyperlinks)
Sets if inserting hyperlinks is allowed.
|
void |
setAllowInsertingRows(boolean allowInsertingRows)
Sets if inserting rows is allowed.
|
void |
setAllowSelectingLockedCells(boolean allowSelectingLockedCells)
Sets if selecting locked cells is allowed.
|
void |
setAllowSelectingUnlockedCells(boolean allowSelectingUnlockedCells)
Sets if selecting unlocked cells is allowed.
|
void |
setAllowSorting(boolean allowSorting)
Sets if sorting is allowed.
|
void |
setAllowUsingAutoFilter(boolean allowUsingAutoFilter)
Sets if using autofilter is allowed.
|
void |
setAllowUsingPivotTableReports(boolean allowUsingPivotTableReports)
Gets if using pivot table reports is allowed.
|
void |
setPassword(String password)
Sets the password for protected sheet.
|
void |
setPasswordHash(int passwordHash)
Sets the password hash for protected sheet.
|
public static int calculatePasswordHash(String password)
public int getPasswordHash()
public boolean hasPassword()
public boolean isAllowDeletingColumns()
public boolean isAllowDeletingRows()
public boolean isAllowEditingObjects()
public boolean isAllowEditingScenarios()
public boolean isAllowFormattingCells()
public boolean isAllowFormattingColumns()
public boolean isAllowFormattingRows()
public boolean isAllowInsertingColumns()
public boolean isAllowInsertingHyperlinks()
public boolean isAllowInsertingRows()
public boolean isAllowSelectingLockedCells()
true
.public boolean isAllowSelectingUnlockedCells()
true
.public boolean isAllowSorting()
public boolean isAllowUsingAutoFilter()
public boolean isAllowUsingPivotTableReports()
public void setAllowDeletingColumns(boolean allowDeletingColumns)
public void setAllowDeletingRows(boolean allowDeletingRows)
public void setAllowEditingObjects(boolean allowEditingObjects)
public void setAllowEditingScenarios(boolean allowEditingScenarios)
public void setAllowFormattingCells(boolean allowFormattingCells)
public void setAllowFormattingColumns(boolean allowFormattingColumns)
public void setAllowFormattingRows(boolean allowFormattingRows)
public void setAllowInsertingColumns(boolean allowInsertingColumns)
public void setAllowInsertingHyperlinks(boolean allowInsertingHyperlinks)
public void setAllowInsertingRows(boolean allowInsertingRows)
public void setAllowSelectingLockedCells(boolean allowSelectingLockedCells)
true
.public void setAllowSelectingUnlockedCells(boolean allowSelectingUnlockedCells)
true
.public void setAllowSorting(boolean allowSorting)
public void setAllowUsingAutoFilter(boolean allowUsingAutoFilter)
public void setAllowUsingPivotTableReports(boolean allowUsingPivotTableReports)
public void setPassword(String password)
password
- The password.public void setPasswordHash(int passwordHash)
This field needs to be set to value smaller than Short.MAX_VALUE * 2.
For setting password it can be also used setPassword(java.lang.String)
method.
© GemBox Ltd. — All rights reserved.