Home  Products  Purchase  Downloads  Demos  Forums  Blogs  Ticket  Wiki  API  Corporate

com.aspose.cells
Class Validation

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

public class Validation
extends java.lang.Object

Represents data validation.settings.


Method Summary
 void addCellArea(CellArea cellArea)
          Adds an affected cell range to cell range address list .
 int getAlertType()
          Gets the validation alert style.
 java.util.ArrayList<CellArea> getAreaList()
          Gets a collection of CellArea
 java.lang.String getErrorMessage()
          Gets the data validation error message.
 java.lang.String getErrorTitle()
          Gets the title of the data-validation error dialog box.
 java.lang.String getFormula1()
          Gets the value or expression associated with the data validation.
 java.lang.String getFormula2()
          Sets the value or expression associated with the second part of the data validation.
 java.lang.String getInputMessage()
          Getss the data validation input message.
 java.lang.String getInputTitle()
          Gets the title of the data validation input dialog box.
 int getOperator()
          Gets the operator for the data validation.
 int getType()
          Gets the validation data type.
 boolean isIgnoreBlank()
          Indicates whether blank values are permitted by the range data validation.
 boolean isInCellDropDown()
          Indicates whether data validation displays a drop-down list that contains acceptable values.
 boolean isShowError()
          Indicates whether the data validation error message will be displayed whenever the user enters invalid data.
 boolean isShowInput()
          Indicates whether the data validation input message will be displayed whenever the user selects a cell in the data validation range.
 void setAlertType(int alertType)
          Sets the validation alert style.
 void setAreaList(java.util.ArrayList<CellArea> areaList)
          Sets a collection of CellArea.
 void setErrorMessage(java.lang.String errorMessage)
          Sets the data validation error message.
 void setErrorTitle(java.lang.String errorTitle)
          Sets the title of the data-validation error dialog box.
 void setFormula1(java.lang.String formula1)
          Sets the value or expression associated with the data validation.
 void setFormula2(java.lang.String formula2)
          Sets the value or expression associated with the data validation.
 void setIgnoreBlank(boolean ignoreBlank)
          Sets whether blank values are permitted by the range data validation.
 void setInCellDropDown(boolean inCellDropDown)
          Sets whether data validation displays a drop-down list that contains acceptable values.
 void setInputMessage(java.lang.String inputMessage)
          Sets the data validation input message.
 void setInputTitle(java.lang.String inputTitle)
          Sets the title of the data validation input dialog box.
 void setOperator(int operator)
          Sets the operator for the data validation.
 void setShowError(boolean showError)
          Sets whether the data validation error message will be displayed whenever the user enters invalid data.
 void setShowInput(boolean showInput)
          Sets whether the data validation input message will be displayed whenever the user selects a cell in the data validation range.
 void setType(int type)
          Sets the validation data type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAlertType

public int getAlertType()
Gets the validation alert style.

Returns:
the validation alert style.
See Also:
setType(int).

setAlertType

public void setAlertType(int alertType)
Sets the validation alert style.

Parameters:
alertType - the validation alert style.It could be one of the following values:
ValidationAlertType.INFORMATION
ValidationAlertType.STOP
ValidationAlertType.WARNING
Throws:
ExcelException - if the validation has been removed from the validations.

getAreaList

public java.util.ArrayList<CellArea> getAreaList()
Gets a collection of CellArea

Returns:
a collection of CellArea which contains the data validation settings.

setAreaList

public void setAreaList(java.util.ArrayList<CellArea> areaList)
Sets a collection of CellArea.

Parameters:
areaList - a collection of CellArea which contains the data validation settings.
Throws:
ExcelException - if the validation has been removed from the validations.

addCellArea

public void addCellArea(CellArea cellArea)
Adds an affected cell range to cell range address list .

Parameters:
cellArea - an affected cell range.
Throws:
ExcelException - if the validation has been removed from the validations.

getErrorMessage

public java.lang.String getErrorMessage()
Gets the data validation error message.

Returns:
the data validation error message.

setErrorMessage

public void setErrorMessage(java.lang.String errorMessage)
Sets the data validation error message.

Parameters:
errorMessage - the data validation error message.
Throws:
ExcelException - if the validation has been removed from the validations.

getErrorTitle

public java.lang.String getErrorTitle()
Gets the title of the data-validation error dialog box.

Returns:
the title of the data-validation error dialog box.

setErrorTitle

public void setErrorTitle(java.lang.String errorTitle)
Sets the title of the data-validation error dialog box.

Parameters:
errorTitle - the title of the data-validation error dialog box.
Throws:
ExcelException - if the validation has been removed from the validations.

getFormula1

public java.lang.String getFormula1()
Gets the value or expression associated with the data validation.

Returns:
the value or expression associated with the data validation.

setFormula1

public void setFormula1(java.lang.String formula1)
Sets the value or expression associated with the data validation. Note: if is formula is specific value:
data type format
DATE yyyy-MM-dd
TIME HH:mm:ss
LISTstring,string,......

Parameters:
formula1 - the value or expression associated with the data validation.
Throws:
ExcelException - if the validation has been removed from the validations.

getFormula2

public java.lang.String getFormula2()
Sets the value or expression associated with the second part of the data validation. Refrence to formula1;

Returns:
the value or expression associated with the second part of the data validation.

setFormula2

public void setFormula2(java.lang.String formula2)
Sets the value or expression associated with the data validation.

Parameters:
formula2 - the value or expression associated with the data validation.
Throws:
ExcelException - if the validation has been removed from the validations.
See Also:
setFormula1(String).

isIgnoreBlank

public boolean isIgnoreBlank()
Indicates whether blank values are permitted by the range data validation.

Returns:
whether blank values are permitted by the range data validation.

setIgnoreBlank

public void setIgnoreBlank(boolean ignoreBlank)
Sets whether blank values are permitted by the range data validation.

Parameters:
ignoreBlank - whether blank values are permitted by the range data validation.
Throws:
ExcelException - if the validation has been removed from the validations.

isInCellDropDown

public boolean isInCellDropDown()
Indicates whether data validation displays a drop-down list that contains acceptable values.

Returns:
whether data validation displays a drop-down list that contains acceptable values.

setInCellDropDown

public void setInCellDropDown(boolean inCellDropDown)
Sets whether data validation displays a drop-down list that contains acceptable values.

Parameters:
inCellDropDown - whether data validation displays a drop-down list that contains acceptable values.
Throws:
ExcelException - if the validation has been removed from the validations.

getInputMessage

public java.lang.String getInputMessage()
Getss the data validation input message.

Returns:
the data validation input message.

setInputMessage

public void setInputMessage(java.lang.String inputMessage)
Sets the data validation input message.

Parameters:
inputMessage - the data validation input message.
Throws:
ExcelException - if the validation has been removed from the validations.

getInputTitle

public java.lang.String getInputTitle()
Gets the title of the data validation input dialog box.

Returns:
the title of the data validation input dialog box.

setInputTitle

public void setInputTitle(java.lang.String inputTitle)
Sets the title of the data validation input dialog box.

Parameters:
inputTitle - the title of the data validation input dialog box.
Throws:
ExcelException - if the validation has been removed from the validations.

getOperator

public int getOperator()
Gets the operator for the data validation.

Returns:
the operator for the data validation.
See Also:
setOperator(int).

setOperator

public void setOperator(int operator)
Sets the operator for the data validation.

Parameters:
operator - the operator for the data validation.It could be one of the following values:
OperatorType.BETWEEN
OperatorType.NOT_BETWEEN
OperatorType.EQUAL
OperatorType.NOT_EQUAL
OperatorType.GREATE_THAN
OperatorType.LESS_THAN
OperatorType.GREATER_OR_EQUAL
OperatorType.LESS_OR_EQUAL
Throws:
ExcelException - if the validation has been removed from the validations.

isShowError

public boolean isShowError()
Indicates whether the data validation error message will be displayed whenever the user enters invalid data.

Returns:
whether the data validation error message will be displayed whenever the user enters invalid data.

setShowError

public void setShowError(boolean showError)
Sets whether the data validation error message will be displayed whenever the user enters invalid data.

Parameters:
showError - whether the data validation error message will be displayed whenever the user enters invalid data.
Throws:
ExcelException - if the validation has been removed from the validations.

isShowInput

public boolean isShowInput()
Indicates whether the data validation input message will be displayed whenever the user selects a cell in the data validation range.

Returns:
whether the data validation input message will be displayed whenever the user selects a cell in the data validation range.

setShowInput

public void setShowInput(boolean showInput)
Sets whether the data validation input message will be displayed whenever the user selects a cell in the data validation range.

Parameters:
showInput - whether the data validation input message will be displayed whenever the user selects a cell in the data validation range.
Throws:
ExcelException - if the validation has been removed from the validations.

getType

public int getType()
Gets the validation data type.

Returns:
the validation data type.
See Also:
setType(int).

setType

public void setType(int type)
Sets the validation data type.

Parameters:
type - the validation data type.It could be one of the following values:
ValidationType.ANYVALUE
ValidationType.WHOLE_NUMBER
ValidationType.DECIMAL
ValidationType.LIST
ValidationType.DATE
ValidationType.TIME
ValidationType.TEXT_LENGTH
ValidationType.CUSTOM
Throws:
java.lang.IllegalArgumentException - if the type is not validation data type.
ExcelException - if the validation has been removed from the validations.