com.aspose.cells
Class Validation

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

public abstract class Validation 
extends java.lang.Object

Represents data validation.settings.

Example:

Workbook workbook = new Workbook();
ValidationCollection validations = workbook.getWorksheets().get(0).getValidations();
Validation validation = validations.get(validations.add());
validation.setType(com.aspose.cells.ValidationType.WHOLE_NUMBER);
validation.setOperator(OperatorType.BETWEEN);
validation.setFormula1("3");
validation.setFormula2("1234");

CellArea area;
area.StartRow = 0;
area.EndRow = 1;
area.StartColumn = 0;
area.EndColumn = 1;

m$ArrayList.add(validation.getAreaList(), area);

Property Getters/Setters Summary
abstract intgetAlertStyle()
abstract voidsetAlertStyle(int value)
           Represents the validation alert style. The value of the property is ValidationAlertType integer constant.
abstract java.util.ArrayListgetAreaList()
           Represents a collection of CellArea which contains the data validation settings.
abstract java.lang.StringgetErrorMessage()
abstract voidsetErrorMessage(java.lang.String value)
           Represents the data validation error message.
abstract java.lang.StringgetErrorTitle()
abstract voidsetErrorTitle(java.lang.String value)
           Represents the title of the data-validation error dialog box.
abstract java.lang.StringgetFormula1()
abstract voidsetFormula1(java.lang.String value)
           Represents the value or expression associated with the data validation.
abstract java.lang.StringgetFormula2()
abstract voidsetFormula2(java.lang.String value)
           Represents the value or expression associated with the second part of the data validation.
abstract booleangetIgnoreBlank()
abstract voidsetIgnoreBlank(boolean value)
           Indicates whether blank values are permitted by the range data validation.
abstract booleangetInCellDropDown()
abstract voidsetInCellDropDown(boolean value)
           Indicates whether data validation displays a drop-down list that contains acceptable values.
abstract java.lang.StringgetInputMessage()
abstract voidsetInputMessage(java.lang.String value)
           Represents the data validation input message.
abstract java.lang.StringgetInputTitle()
abstract voidsetInputTitle(java.lang.String value)
           Represents the title of the data-validation input dialog box.
abstract intgetOperator()
abstract voidsetOperator(int value)
           Represents the operator for the data validation. The value of the property is OperatorType integer constant.
abstract booleangetShowError()
abstract voidsetShowError(boolean value)
           Indicates whether the data validation error message will be displayed whenever the user enters invalid data.
abstract booleangetShowInput()
abstract voidsetShowInput(boolean value)
           Indicates whether the data validation input message will be displayed whenever the user selects a cell in the data validation range.
abstract intgetType()
abstract voidsetType(int value)
           Represents the data validation type. The value of the property is ValidationType integer constant.
abstract java.lang.ObjectgetValue1()
abstract voidsetValue1(java.lang.Object value)
           Represents the first value associated with the data validation.
abstract java.lang.ObjectgetValue2()
abstract voidsetValue2(java.lang.Object value)
           Represents the first value associated with the data validation.
 
Method Summary
abstract voidaddArea(CellArea cellArea)
           Applies the validation to the area.
abstract voidremoveACell(int row, int column)
           Remove the validation settings in the cell.
abstract voidremoveArea(CellArea cellArea)
           Remove the validation settings in the range.
 

Property Getters/Setters Detail

getOperator/setOperator

public abstract int getOperator() / public abstract void setOperator(int value)
Represents the operator for the data validation. The value of the property is OperatorType integer constant.

getAlertStyle/setAlertStyle

public abstract int getAlertStyle() / public abstract void setAlertStyle(int value)
Represents the validation alert style. The value of the property is ValidationAlertType integer constant.

getType/setType

public abstract int getType() / public abstract void setType(int value)
Represents the data validation type. The value of the property is ValidationType integer constant.

getInputMessage/setInputMessage

public abstract java.lang.String getInputMessage() / public abstract void setInputMessage(java.lang.String value)
Represents the data validation input message.

getInputTitle/setInputTitle

public abstract java.lang.String getInputTitle() / public abstract void setInputTitle(java.lang.String value)
Represents the title of the data-validation input dialog box.

getErrorMessage/setErrorMessage

public abstract java.lang.String getErrorMessage() / public abstract void setErrorMessage(java.lang.String value)
Represents the data validation error message.

getErrorTitle/setErrorTitle

public abstract java.lang.String getErrorTitle() / public abstract void setErrorTitle(java.lang.String value)
Represents the title of the data-validation error dialog box.

getShowInput/setShowInput

public abstract boolean getShowInput() / public abstract void setShowInput(boolean value)
Indicates whether the data validation input message will be displayed whenever the user selects a cell in the data validation range.

getShowError/setShowError

public abstract boolean getShowError() / public abstract void setShowError(boolean value)
Indicates whether the data validation error message will be displayed whenever the user enters invalid data.

getIgnoreBlank/setIgnoreBlank

public abstract boolean getIgnoreBlank() / public abstract void setIgnoreBlank(boolean value)
Indicates whether blank values are permitted by the range data validation.

getFormula1/setFormula1

public abstract java.lang.String getFormula1() / public abstract void setFormula1(java.lang.String value)
Represents the value or expression associated with the data validation.

getValue1/setValue1

public abstract java.lang.Object getValue1() / public abstract void setValue1(java.lang.Object value)
Represents the first value associated with the data validation.

getValue2/setValue2

public abstract java.lang.Object getValue2() / public abstract void setValue2(java.lang.Object value)
Represents the first value associated with the data validation.

getFormula2/setFormula2

public abstract java.lang.String getFormula2() / public abstract void setFormula2(java.lang.String value)
Represents the value or expression associated with the second part of the data validation.

getInCellDropDown/setInCellDropDown

public abstract boolean getInCellDropDown() / public abstract void setInCellDropDown(boolean value)
Indicates whether data validation displays a drop-down list that contains acceptable values.

getAreaList

public abstract java.util.ArrayList getAreaList()
Represents a collection of CellArea which contains the data validation settings. The old validations on the area will not be removed if directly adding are to this list.

Method Detail

addArea

public abstract void addArea(CellArea cellArea)
Applies the validation to the area. In this method , we will remove all old validations on this area.
Parameters:
cellArea - The area.

removeArea

public abstract void removeArea(CellArea cellArea)
Remove the validation settings in the range.
Parameters:
cellArea - The range which contains the data validation settings.

removeACell

public abstract void removeACell(int row, int column)
Remove the validation settings in the cell.
Parameters:
row - The row index.
column - The column index.

See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cellss Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.