Package org.apache.poi.xssf.usermodel
Class XSSFDataValidation
- java.lang.Object
-
- org.apache.poi.xssf.usermodel.XSSFDataValidation
-
- All Implemented Interfaces:
DataValidation
public class XSSFDataValidation extends java.lang.Object implements DataValidation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.poi.ss.usermodel.DataValidation
DataValidation.ErrorStyle
-
-
Constructor Summary
Constructors Constructor Description XSSFDataValidation(XSSFDataValidationConstraint constraint, CellRangeAddressList regions, CTDataValidation ctDataValidation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateErrorBox(java.lang.String title, java.lang.String text)Sets the title and text for the error box .voidcreatePromptBox(java.lang.String title, java.lang.String text)Sets the title and text for the prompt box .booleangetEmptyCellAllowed()Retrieve the settings for empty cells allowedjava.lang.StringgetErrorBoxText()java.lang.StringgetErrorBoxTitle()intgetErrorStyle()ojava.lang.StringgetPromptBoxText()java.lang.StringgetPromptBoxTitle()CellRangeAddressListgetRegions()booleangetShowErrorBox()booleangetShowPromptBox()booleangetSuppressDropDownArrow()Useful only list validation objects .DataValidationConstraintgetValidationConstraint()java.lang.StringprettyPrint()voidsetEmptyCellAllowed(boolean allowed)Sets if this object allows empty as a valid valuevoidsetErrorStyle(int errorStyle)Sets the error style for error boxvoidsetShowErrorBox(boolean show)Sets the behaviour when an invalid value is enteredvoidsetShowPromptBox(boolean show)Sets the behaviour when a cell which belongs to this object is selectedvoidsetSuppressDropDownArrow(boolean suppress)Useful for list validation objects .
-
-
-
Constructor Detail
-
XSSFDataValidation
public XSSFDataValidation(XSSFDataValidationConstraint constraint, CellRangeAddressList regions, CTDataValidation ctDataValidation)
-
-
Method Detail
-
createErrorBox
public void createErrorBox(java.lang.String title, java.lang.String text)Description copied from interface:DataValidationSets the title and text for the error box . Error box is displayed when the user enters an invalid value int o a cell which belongs to this validation object . In order for an error box to be displayed you should also use method setShowErrorBox( boolean show )- Specified by:
createErrorBoxin interfaceDataValidation- Parameters:
title- The error box's titletext- The error box's text
-
createPromptBox
public void createPromptBox(java.lang.String title, java.lang.String text)Description copied from interface:DataValidationSets the title and text for the prompt box . Prompt box is displayed when the user selects a cell which belongs to this validation object . In order for a prompt box to be displayed you should also use method setShowPromptBox( boolean show )- Specified by:
createPromptBoxin interfaceDataValidation- Parameters:
title- The prompt box's titletext- The prompt box's text
-
getEmptyCellAllowed
public boolean getEmptyCellAllowed()
Description copied from interface:DataValidationRetrieve the settings for empty cells allowed- Specified by:
getEmptyCellAllowedin interfaceDataValidation- Returns:
- True if this object should treats empty as valid value , false otherwise
-
getErrorBoxText
public java.lang.String getErrorBoxText()
- Specified by:
getErrorBoxTextin interfaceDataValidation- Returns:
- Error box's text or
null
-
getErrorBoxTitle
public java.lang.String getErrorBoxTitle()
- Specified by:
getErrorBoxTitlein interfaceDataValidation- Returns:
- Error box's title or
null
-
getErrorStyle
public int getErrorStyle()
Description copied from interface:DataValidationo- Specified by:
getErrorStylein interfaceDataValidation- Returns:
- the error style of error box
- See Also:
DataValidation.ErrorStyle
-
getPromptBoxText
public java.lang.String getPromptBoxText()
- Specified by:
getPromptBoxTextin interfaceDataValidation- Returns:
- Prompt box's text or
null
-
getPromptBoxTitle
public java.lang.String getPromptBoxTitle()
- Specified by:
getPromptBoxTitlein interfaceDataValidation- Returns:
- Prompt box's title or
null
-
getShowErrorBox
public boolean getShowErrorBox()
- Specified by:
getShowErrorBoxin interfaceDataValidation- Returns:
trueif an error box should be displayed ,falseotherwise
-
getShowPromptBox
public boolean getShowPromptBox()
- Specified by:
getShowPromptBoxin interfaceDataValidation- Returns:
trueif an prompt box should be displayed ,falseotherwise
-
getSuppressDropDownArrow
public boolean getSuppressDropDownArrow()
Description copied from interface:DataValidationUseful only list validation objects . This method always returns false if the object isn't a list validation object- Specified by:
getSuppressDropDownArrowin interfaceDataValidation- Returns:
trueif a list should display the values into a drop down list ,falseotherwise .
-
getValidationConstraint
public DataValidationConstraint getValidationConstraint()
- Specified by:
getValidationConstraintin interfaceDataValidation
-
setEmptyCellAllowed
public void setEmptyCellAllowed(boolean allowed)
Description copied from interface:DataValidationSets if this object allows empty as a valid value- Specified by:
setEmptyCellAllowedin interfaceDataValidation- Parameters:
allowed-trueif this object should treats empty as valid value ,falseotherwise
-
setErrorStyle
public void setErrorStyle(int errorStyle)
Description copied from interface:DataValidationSets the error style for error box- Specified by:
setErrorStylein interfaceDataValidation- See Also:
DataValidation.ErrorStyle
-
setShowErrorBox
public void setShowErrorBox(boolean show)
Description copied from interface:DataValidationSets the behaviour when an invalid value is entered- Specified by:
setShowErrorBoxin interfaceDataValidation- Parameters:
show-trueif an error box should be displayed ,falseotherwise
-
setShowPromptBox
public void setShowPromptBox(boolean show)
Description copied from interface:DataValidationSets the behaviour when a cell which belongs to this object is selected- Specified by:
setShowPromptBoxin interfaceDataValidation- Parameters:
show-trueif an prompt box should be displayed ,falseotherwise
-
setSuppressDropDownArrow
public void setSuppressDropDownArrow(boolean suppress)
Description copied from interface:DataValidationUseful for list validation objects .- Specified by:
setSuppressDropDownArrowin interfaceDataValidation- Parameters:
suppress- True if a list should display the values into a drop down list , false otherwise . In other words , if a list should display the arrow sign on its right side
-
getRegions
public CellRangeAddressList getRegions()
- Specified by:
getRegionsin interfaceDataValidation
-
prettyPrint
public java.lang.String prettyPrint()
-
-