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 |
isDeletingColumnsAllowed()
Deprecated.
Use Protection.AllowDeletingColumn property instead.
|
boolean |
isDeletingRowsAllowed()
Deprecated.
Use Protection.AllowDeletingRow property instead.
|
boolean |
isEditingContentsAllowed()
Deprecated.
Use Protection.AllowEditingContent property instead.
|
boolean |
isEditingObjectsAllowed()
Deprecated.
Use Protection.AllowEditingObject property instead.
|
boolean |
isEditingScenariosAllowed()
Deprecated.
Use Protection.AllowEditingScenario property instead.
|
boolean |
isFilteringAllowed()
Deprecated.
Use Protection.AllowFiltering property instead.
|
boolean |
isFormattingCellsAllowed()
Deprecated.
Use Protection.AllowFormattingCell property instead.
|
boolean |
isFormattingColumnsAllowed()
Deprecated.
Use Protection.AllowFormattingColumn property instead.
|
boolean |
isFormattingRowsAllowed()
Deprecated.
Use Protection.AllowFormattingRow property instead.
|
boolean |
isInsertingColumnsAllowed()
Deprecated.
Use Protection.AllowInsertingColumn property instead.
|
boolean |
isInsertingHyperlinksAllowed()
Deprecated.
Use Protection.AllowInsertingHyperlink property instead.
|
boolean |
isInsertingRowsAllowed()
Deprecated.
Use Protection.AllowInsertingRow property instead.
|
boolean |
isProtectedWithPassword()
Indicates whether the worksheets is protected with password.
|
boolean |
isSelectingLockedCellsAllowed()
Deprecated.
Use Protection.AllowSelectingLockedCell property instead.
|
boolean |
isSelectingUnlockedCellsAllowed()
Deprecated.
Use Protection.AllowSelectingUnlockedCell property instead.
|
boolean |
isSortingAllowed()
Deprecated.
Use Protection.AllowSorting property instead.
|
boolean |
isUsingPivotTablesAllowed()
Deprecated.
Use Protection.AllowUsingPivotTable property instead.
|
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 |
setDeletingColumnsAllowed(boolean value)
Deprecated.
Use Protection.AllowDeletingColumn property instead.
|
void |
setDeletingRowsAllowed(boolean value)
Deprecated.
Use Protection.AllowDeletingRow property instead.
|
void |
setEditingContentsAllowed(boolean value)
Deprecated.
Use Protection.AllowEditingContent property instead.
|
void |
setEditingObjectsAllowed(boolean value)
Deprecated.
Use Protection.AllowEditingObject property instead.
|
void |
setEditingScenariosAllowed(boolean value)
Deprecated.
Use Protection.AllowEditingScenario property instead.
|
void |
setFilteringAllowed(boolean value)
Deprecated.
Use Protection.AllowFiltering property instead.
|
void |
setFormattingCellsAllowed(boolean value)
Deprecated.
Use Protection.AllowFormattingCell property instead.
|
void |
setFormattingColumnsAllowed(boolean value)
Deprecated.
Use Protection.AllowFormattingColumn property instead.
|
void |
setFormattingRowsAllowed(boolean value)
Deprecated.
Use Protection.AllowFormattingRow property instead.
|
void |
setInsertingColumnsAllowed(boolean value)
Deprecated.
Use Protection.AllowInsertingColumn property instead.
|
void |
setInsertingHyperlinksAllowed(boolean value)
Deprecated.
Use Protection.AllowInsertingHyperlink property instead.
|
void |
setInsertingRowsAllowed(boolean value)
Deprecated.
Use Protection.AllowInsertingRow property instead.
|
void |
setPassword(java.lang.String value)
Represents the password to protect the worksheet.
|
void |
setSelectingLockedCellsAllowed(boolean value)
Deprecated.
Use Protection.AllowSelectingLockedCell property instead.
|
void |
setSelectingUnlockedCellsAllowed(boolean value)
Deprecated.
Use Protection.AllowSelectingUnlockedCell property instead.
|
void |
setSortingAllowed(boolean value)
Deprecated.
Use Protection.AllowSorting property instead.
|
void |
setUsingPivotTablesAllowed(boolean value)
Deprecated.
Use Protection.AllowUsingPivotTable property instead.
|
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 isDeletingColumnsAllowed()
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowDeletingColumn property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public void setDeletingColumnsAllowed(boolean value)
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowDeletingColumn property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.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 isDeletingRowsAllowed()
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowDeletingRow property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public void setDeletingRowsAllowed(boolean value)
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowDeletingRow property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public boolean getAllowFiltering()
public void setAllowFiltering(boolean value)
public boolean isFilteringAllowed()
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowFiltering property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public void setFilteringAllowed(boolean value)
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowFiltering property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public boolean getAllowFormattingCell()
public void setAllowFormattingCell(boolean value)
public boolean isFormattingCellsAllowed()
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowFormattingCell property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public void setFormattingCellsAllowed(boolean value)
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowFormattingCell property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public boolean getAllowFormattingColumn()
public void setAllowFormattingColumn(boolean value)
public boolean isFormattingColumnsAllowed()
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowFormattingColumn property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public void setFormattingColumnsAllowed(boolean value)
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowFormattingColumn property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public boolean getAllowFormattingRow()
public void setAllowFormattingRow(boolean value)
public boolean isFormattingRowsAllowed()
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowFormattingRow property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public void setFormattingRowsAllowed(boolean value)
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowFormattingRow property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public boolean getAllowInsertingColumn()
public void setAllowInsertingColumn(boolean value)
public boolean isInsertingColumnsAllowed()
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowInsertingColumn property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public void setInsertingColumnsAllowed(boolean value)
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowInsertingColumn property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public boolean getAllowInsertingHyperlink()
public void setAllowInsertingHyperlink(boolean value)
public boolean isInsertingHyperlinksAllowed()
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowInsertingHyperlink property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public void setInsertingHyperlinksAllowed(boolean value)
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowInsertingHyperlink property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public boolean getAllowInsertingRow()
public void setAllowInsertingRow(boolean value)
public boolean isInsertingRowsAllowed()
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowInsertingRow property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public void setInsertingRowsAllowed(boolean value)
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowInsertingRow property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public boolean getAllowSorting()
public void setAllowSorting(boolean value)
public boolean isSortingAllowed()
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowSorting property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public void setSortingAllowed(boolean value)
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowSorting property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public boolean getAllowUsingPivotTable()
public void setAllowUsingPivotTable(boolean value)
public boolean isUsingPivotTablesAllowed()
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowUsingPivotTable property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public void setUsingPivotTablesAllowed(boolean value)
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowUsingPivotTable property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public boolean getAllowEditingContent()
public void setAllowEditingContent(boolean value)
public boolean isEditingContentsAllowed()
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowEditingContent property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public void setEditingContentsAllowed(boolean value)
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowEditingContent property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public boolean getAllowEditingObject()
public void setAllowEditingObject(boolean value)
public boolean isEditingObjectsAllowed()
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowEditingObject property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public void setEditingObjectsAllowed(boolean value)
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowEditingObject property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public boolean getAllowEditingScenario()
public void setAllowEditingScenario(boolean value)
public boolean isEditingScenariosAllowed()
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowEditingScenario property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public void setEditingScenariosAllowed(boolean value)
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowEditingScenario property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.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 int getPasswordHash()
public boolean isProtectedWithPassword()
public boolean verifyPassword(java.lang.String password)
password - The password.public boolean getAllowSelectingLockedCell()
public void setAllowSelectingLockedCell(boolean value)
public boolean isSelectingLockedCellsAllowed()
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowSelectingLockedCell property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public void setSelectingLockedCellsAllowed(boolean value)
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowSelectingLockedCell property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public boolean getAllowSelectingUnlockedCell()
public void setAllowSelectingUnlockedCell(boolean value)
public boolean isSelectingUnlockedCellsAllowed()
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowSelectingUnlockedCell property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.public void setSelectingUnlockedCellsAllowed(boolean value)
Remarks
NOTE: This member is now obsolete. Instead, please use Protection.AllowSelectingUnlockedCell property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.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 2001-2023. All Rights Reserved.