public class Protection
extends java.lang.Object
Example
//Instantiating a Workbook object
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.getWorksheets().get(0);
//Allowing users to select locked cells of the worksheet
worksheet.getProtection().setAllowSelectingLockedCell(true);
//Allowing users to select unlocked cells of the worksheet
worksheet.getProtection().setAllowSelectingUnlockedCell(true);
| Modifier and Type | Method and Description |
|---|---|
void |
copy(Protection source)
Copy protection info.
|
boolean |
getAllowDeletingColumn()
Represents if the deletion of columns is allowed on a protected worksheet.
|
boolean |
getAllowDeletingRow()
Represents if the deletion of rows is allowed on a protected worksheet.
|
boolean |
getAllowEditingContent()
Represents if the user is allowed to edit contents of locked cells on a protected worksheet.
|
boolean |
getAllowEditingObject()
Represents if the user is allowed to manipulate drawing objects on a protected worksheet.
|
boolean |
getAllowEditingScenario()
Represents if the user is allowed to edit scenarios on a protected worksheet.
|
boolean |
getAllowFiltering()
Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.
|
boolean |
getAllowFormattingCell()
Represents if the formatting of cells is allowed on a protected worksheet.
|
boolean |
getAllowFormattingColumn()
Represents if the formatting of columns is allowed on a protected worksheet
|
boolean |
getAllowFormattingRow()
Represents if the formatting of rows is allowed on a protected worksheet
|
boolean |
getAllowInsertingColumn()
Represents if the insertion of columns is allowed on a protected worksheet
|
boolean |
getAllowInsertingHyperlink()
Represents if the insertion of hyperlinks is allowed on a protected worksheet
|
boolean |
getAllowInsertingRow()
Represents if the insertion of rows is allowed on a protected worksheet
|
boolean |
getAllowSelectingLockedCell()
Represents if the user is allowed to select locked cells on a protected worksheet.
|
boolean |
getAllowSelectingUnlockedCell()
Represents if the user is allowed to select unlocked cells on a protected worksheet.
|
boolean |
getAllowSorting()
Represents if the sorting option is allowed on a protected worksheet.
|
boolean |
getAllowUsingPivotTable()
Represents if the user is allowed to manipulate pivot tables on a protected worksheet.
|
java.lang.String |
getPassword()
Represents the password to protect the worksheet.
|
int |
getPasswordHash()
Gets the hash of current password.
|
boolean |
isProtectedWithPassword()
Indicates whether the worksheets is protected with password.
|
void |
setAllowDeletingColumn(boolean value)
Represents if the deletion of columns is allowed on a protected worksheet.
|
void |
setAllowDeletingRow(boolean value)
Represents if the deletion of rows is allowed on a protected worksheet.
|
void |
setAllowEditingContent(boolean value)
Represents if the user is allowed to edit contents of locked cells on a protected worksheet.
|
void |
setAllowEditingObject(boolean value)
Represents if the user is allowed to manipulate drawing objects on a protected worksheet.
|
void |
setAllowEditingScenario(boolean value)
Represents if the user is allowed to edit scenarios on a protected worksheet.
|
void |
setAllowFiltering(boolean value)
Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.
|
void |
setAllowFormattingCell(boolean value)
Represents if the formatting of cells is allowed on a protected worksheet.
|
void |
setAllowFormattingColumn(boolean value)
Represents if the formatting of columns is allowed on a protected worksheet
|
void |
setAllowFormattingRow(boolean value)
Represents if the formatting of rows is allowed on a protected worksheet
|
void |
setAllowInsertingColumn(boolean value)
Represents if the insertion of columns is allowed on a protected worksheet
|
void |
setAllowInsertingHyperlink(boolean value)
Represents if the insertion of hyperlinks is allowed on a protected worksheet
|
void |
setAllowInsertingRow(boolean value)
Represents if the insertion of rows is allowed on a protected worksheet
|
void |
setAllowSelectingLockedCell(boolean value)
Represents if the user is allowed to select locked cells on a protected worksheet.
|
void |
setAllowSelectingUnlockedCell(boolean value)
Represents if the user is allowed to select unlocked cells on a protected worksheet.
|
void |
setAllowSorting(boolean value)
Represents if the sorting option is allowed on a protected worksheet.
|
void |
setAllowUsingPivotTable(boolean value)
Represents if the user is allowed to manipulate pivot tables on a protected worksheet.
|
void |
setPassword(java.lang.String value)
Represents the password to protect the worksheet.
|
boolean |
verifyPassword(java.lang.String password)
Verifies password.
|
public void copy(Protection source)
source - public boolean getAllowDeletingColumn()
Remarks
The columns containing the cells to be deleted must be unlocked when the sheet is protected, and "Select unlocked cells" option must be enabled.public void setAllowDeletingColumn(boolean value)
Remarks
The columns containing the cells to be deleted must be unlocked when the sheet is protected, and "Select unlocked cells" option must be enabled.public boolean getAllowDeletingRow()
Remarks
The rows containing the cells to be deleted must be unlocked when the sheet is protected, and "Select unlocked cells" option must be enabled.public void setAllowDeletingRow(boolean value)
Remarks
The rows containing the cells to be deleted must be unlocked when the sheet is protected, and "Select unlocked cells" option must be enabled.public boolean getAllowFiltering()
public void setAllowFiltering(boolean value)
public boolean getAllowFormattingCell()
public void setAllowFormattingCell(boolean value)
public boolean getAllowFormattingColumn()
public void setAllowFormattingColumn(boolean value)
public boolean getAllowFormattingRow()
public void setAllowFormattingRow(boolean value)
public boolean getAllowInsertingColumn()
public void setAllowInsertingColumn(boolean value)
public boolean getAllowInsertingHyperlink()
public void setAllowInsertingHyperlink(boolean value)
public boolean getAllowInsertingRow()
public void setAllowInsertingRow(boolean value)
public boolean getAllowSorting()
public void setAllowSorting(boolean value)
public boolean getAllowUsingPivotTable()
public void setAllowUsingPivotTable(boolean value)
public boolean getAllowEditingContent()
public void setAllowEditingContent(boolean value)
public boolean getAllowEditingObject()
public void setAllowEditingObject(boolean value)
public boolean getAllowEditingScenario()
public void setAllowEditingScenario(boolean value)
public boolean getAllowSelectingLockedCell()
public void setAllowSelectingLockedCell(boolean value)
public boolean getAllowSelectingUnlockedCell()
public void setAllowSelectingUnlockedCell(boolean value)
public java.lang.String getPassword()
Remarks
If password is set to null or blank string, you can unprotect the worksheet or workbook without using a password. Otherwise, you must specify the password to unprotect the worksheet or workbook.public void setPassword(java.lang.String value)
Remarks
If password is set to null or blank string, you can unprotect the worksheet or workbook without using a password. Otherwise, you must specify the password to unprotect the worksheet or workbook.public boolean isProtectedWithPassword()
public boolean verifyPassword(java.lang.String password)
password - The password.public int getPasswordHash()
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.