Home  Products  Purchase  Downloads  Demos  Forums  Blogs  Ticket  Wiki  API  Corporate

com.aspose.cells
Class Protection

java.lang.Object
  extended by com.aspose.cells.Protection

public class Protection
extends java.lang.Object

Represents the various types of protection options available for a worksheet.


Constructor Summary
Protection()
          Creates an instance of class Protection.
 
Method Summary
 java.lang.String getPassword()
          Gets the password to protect the worksheet.
 boolean isDeletingColumnsAllowed()
          Checks if the deletion of columns is allowed on a protected worksheet.
 boolean isDeletingRowsAllowed()
          Checks if the deletion of rows is allowed on a protected worksheet.
 boolean isEditingContentsAllowed()
          Checks if the user is allowed to edit contents of locked cells on a protected worksheet.
 boolean isEditingObjectsAllowed()
          Checks if the user is allowed to manipulate drawing objects on a protected worksheet.
 boolean isEditingScenariosAllowed()
          Checks if the user is allowed to edit scenarios on a protected worksheet.
 boolean isFilteringAllowed()
          Checks if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.
 boolean isFormattingCellsAllowed()
          Checks if the formatting of cells is allowed on a protected worksheet.
 boolean isFormattingColumnsAllowed()
          Checks if the formatting of columns is allowed on a protected worksheet.
 boolean isFormattingRowsAllowed()
          Checks if the formatting of rows is allowed on a protected worksheet.
 boolean isInsertingColumnsAllowed()
          Checks if the insertion of columns is allowed on a protected worksheet.
 boolean isInsertingHyperlinksAllowed()
          Checks if the insertion of hyperlinks is allowed on a protected worksheet.
 boolean isInsertingRowsAllowed()
          Checks if the insertion of rows is allowed on a protected worksheet.
 boolean isSelectingLockedCellsAllowed()
          Checks if the user is allowed to select locked cells on a protected worksheet.
 boolean IsSelectingUnlockedCellsAllowed()
          Checks if the user is allowed to select unlocked cells on a protected worksheet.
 boolean isSortingAllowed()
          Checks if the sorting option is allowed on a protected worksheet.
 boolean isUsingPivotTablesAllowed()
          Checks if the user is allowed to manipulate pivot tables on a protected worksheet.
 void setDeletingColumnsAllowed(boolean bAllowed)
          Sets if the deletion of columns is allowed on a protected worksheet.
 void setDeletingRowsAllowed(boolean bAllowed)
          Sets if the deletion of rows is allowed on a protected worksheet.
 void setEditingContentsAllowed(boolean bAllowed)
          Sets if the user is allowed to edit contents of locked cells on a protected worksheet.
 void setEditingObjectsAllowed(boolean bAllowed)
          Sets if the user is allowed to manipulate drawing objects on a protected worksheet.
 void setEditingScenariosAllowed(boolean bAllowed)
          Sets if the user is allowed to edit scenarios on a protected worksheet.
 void setFilteringAllowed(boolean bAllowed)
          Sets if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.
 void setFormattingCellsAllowed(boolean bAllowed)
          Sets if the formatting of cells is allowed on a protected worksheet.
 void setFormattingColumnsAllowed(boolean bAllowed)
          Sets if the formatting of columns is allowed on a protected worksheet.
 void setFormattingRowsAllowed(boolean bAllowed)
          Sets if the formatting of rows is allowed on a protected worksheet.
 void setInsertingColumnsAllowed(boolean bAllowed)
          Sets if the insertion of columns is allowed on a protected worksheet.
 void setInsertingHyperlinksAllowed(boolean bAllowed)
          Sets if the insertion of hyperlinks is allowed on a protected worksheet.
 void setInsertingRowsAllowed(boolean bAllowed)
          Sets if the insertion of rows is allowed on a protected worksheet.
 void setPassword(java.lang.String password)
          Sets the password to protect the worksheet.
 void setSelectingLockedCellsAllowed(boolean bAllowed)
          Sets if the user is allowed to select locked cells on a protected worksheet.
 void setSelectingUnlockedCellsAllowed(boolean bAllowed)
          Sets if the user is allowed to select unlocked cells on a protected worksheet.
 void setSortingAllowed(boolean bAllowed)
          Sets if the sorting option is allowed on a protected worksheet.
 void setUsingPivotTablesAllowed(boolean bAllowed)
          Sets if the user is allowed to manipulate pivot tables on a protected worksheet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Protection

public Protection()
Creates an instance of class Protection. By default, IsSelectingUnlockedCellsAllowed() and IsSelectinglockedCellsAllowed() will return true, and others will return false.

Method Detail

isDeletingColumnsAllowed

public boolean isDeletingColumnsAllowed()
Checks if the deletion of columns is allowed on a protected worksheet.

Returns:
Returns true if the deletion of columns is allowed.

setDeletingColumnsAllowed

public void setDeletingColumnsAllowed(boolean bAllowed)
Sets if the deletion of columns is allowed on a protected worksheet. The columns containing the cells to be deleted must be unlocked when the sheet is protected, and "Select unlocked cells" option must be enabled.

Parameters:
bAllowed - true if allowed.

isDeletingRowsAllowed

public boolean isDeletingRowsAllowed()
Checks if the deletion of rows is allowed on a protected worksheet.

Returns:
Returns true if the deletion of rows is allowed.

setDeletingRowsAllowed

public void setDeletingRowsAllowed(boolean bAllowed)
Sets if the deletion of rows is allowed on a protected worksheet. The rows containing the cells to be deleted must be unlocked when the sheet is protected, and "Select unlocked cells" option must be enabled.

Parameters:
bAllowed - true if allowed.

isFilteringAllowed

public boolean isFilteringAllowed()
Checks if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.

Returns:
Returns true if that is allowed.

setFilteringAllowed

public void setFilteringAllowed(boolean bAllowed)
Sets if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.

Parameters:
bAllowed - true if allowed.

isFormattingCellsAllowed

public boolean isFormattingCellsAllowed()
Checks if the formatting of cells is allowed on a protected worksheet.

Returns:
Retruns true if the formatting of cells is allowed.

setFormattingCellsAllowed

public void setFormattingCellsAllowed(boolean bAllowed)
Sets if the formatting of cells is allowed on a protected worksheet.

Parameters:
bAllowed - true if the formatting of cells is allowed.

isFormattingColumnsAllowed

public boolean isFormattingColumnsAllowed()
Checks if the formatting of columns is allowed on a protected worksheet.

Returns:
Returns true if the formatting of columns is allowed.

setFormattingColumnsAllowed

public void setFormattingColumnsAllowed(boolean bAllowed)
Sets if the formatting of columns is allowed on a protected worksheet.

Parameters:
bAllowed - true if the formatting of columns is allowed.

isFormattingRowsAllowed

public boolean isFormattingRowsAllowed()
Checks if the formatting of rows is allowed on a protected worksheet.

Returns:
Returns true if the formatting of rows is allowed.

setFormattingRowsAllowed

public void setFormattingRowsAllowed(boolean bAllowed)
Sets if the formatting of rows is allowed on a protected worksheet.

Parameters:
bAllowed - true if the formatting of rows is allowed.

isInsertingColumnsAllowed

public boolean isInsertingColumnsAllowed()
Checks if the insertion of columns is allowed on a protected worksheet.

Returns:
Retruns true if the insertion of columns is allowed.

setInsertingColumnsAllowed

public void setInsertingColumnsAllowed(boolean bAllowed)
Sets if the insertion of columns is allowed on a protected worksheet.

Parameters:
bAllowed - true if the insertion of columns is allowed.

isInsertingHyperlinksAllowed

public boolean isInsertingHyperlinksAllowed()
Checks if the insertion of hyperlinks is allowed on a protected worksheet.

Returns:
Returns true if the insertion of hyperlinks is allowed.

setInsertingHyperlinksAllowed

public void setInsertingHyperlinksAllowed(boolean bAllowed)
Sets if the insertion of hyperlinks is allowed on a protected worksheet.

Parameters:
bAllowed - true if the insertion of hyperlinks is allowed.

isInsertingRowsAllowed

public boolean isInsertingRowsAllowed()
Checks if the insertion of rows is allowed on a protected worksheet.

Returns:
Returns true if the insertion of rows is allowed.

setInsertingRowsAllowed

public void setInsertingRowsAllowed(boolean bAllowed)
Sets if the insertion of rows is allowed on a protected worksheet.

Parameters:
bAllowed - true if insertion of rows is allowed.

isSortingAllowed

public boolean isSortingAllowed()
Checks if the sorting option is allowed on a protected worksheet.

Returns:
Returns true if the sorting option is allowed.

setSortingAllowed

public void setSortingAllowed(boolean bAllowed)
Sets if the sorting option is allowed on a protected worksheet.

Parameters:
bAllowed - true if the sorting option is allowed.

isUsingPivotTablesAllowed

public boolean isUsingPivotTablesAllowed()
Checks if the user is allowed to manipulate pivot tables on a protected worksheet.

Returns:
Returns true if the user is allowed to manipulate pivot tables.

setUsingPivotTablesAllowed

public void setUsingPivotTablesAllowed(boolean bAllowed)
Sets if the user is allowed to manipulate pivot tables on a protected worksheet.

Parameters:
bAllowed - true if the user is allowed to manipulate pivot tables.

isEditingContentsAllowed

public boolean isEditingContentsAllowed()
Checks if the user is allowed to edit contents of locked cells on a protected worksheet.

Returns:
Returns true if that is allowed.

setEditingContentsAllowed

public void setEditingContentsAllowed(boolean bAllowed)
Sets if the user is allowed to edit contents of locked cells on a protected worksheet.

Parameters:
bAllowed - true if that is allowed.

isEditingObjectsAllowed

public boolean isEditingObjectsAllowed()
Checks if the user is allowed to manipulate drawing objects on a protected worksheet.

Returns:
Returns true if the user is allowed to manipulate drawing objects.

setEditingObjectsAllowed

public void setEditingObjectsAllowed(boolean bAllowed)
Sets if the user is allowed to manipulate drawing objects on a protected worksheet.

Parameters:
bAllowed - true if the user is allowed to manipulate drawing objects.

isEditingScenariosAllowed

public boolean isEditingScenariosAllowed()
Checks if the user is allowed to edit scenarios on a protected worksheet.

Returns:
Returns true if the user is allowed to edit scenarios.

setEditingScenariosAllowed

public void setEditingScenariosAllowed(boolean bAllowed)
Sets if the user is allowed to edit scenarios on a protected worksheet.

Parameters:
bAllowed - true if the user is allowed to edit scenarios.

isSelectingLockedCellsAllowed

public boolean isSelectingLockedCellsAllowed()
Checks if the user is allowed to select locked cells on a protected worksheet.

Returns:
Returns true Represents if the user is allowed to select locked cells.

setSelectingLockedCellsAllowed

public void setSelectingLockedCellsAllowed(boolean bAllowed)
Sets if the user is allowed to select locked cells on a protected worksheet.

Parameters:
bAllowed - true Represents if the user is allowed to select locked cells.

IsSelectingUnlockedCellsAllowed

public boolean IsSelectingUnlockedCellsAllowed()
Checks if the user is allowed to select unlocked cells on a protected worksheet.

Returns:
Returns true if the user is allowed to select unlocked cells.

setSelectingUnlockedCellsAllowed

public void setSelectingUnlockedCellsAllowed(boolean bAllowed)
Sets if the user is allowed to select unlocked cells on a protected worksheet.

Parameters:
bAllowed - true if the user is allowed to select unlocked cells.

getPassword

public java.lang.String getPassword()
Gets the password to protect the worksheet.

Returns:
Returns the password. If the password is not present, null is returned.

setPassword

public void setPassword(java.lang.String password)
Sets the password to protect the worksheet. 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.

Parameters:
password - the password.