Package org.apache.poi.xssf.usermodel
Class XSSFDataValidation
java.lang.Object
org.apache.poi.xssf.usermodel.XSSFDataValidation
- All Implemented Interfaces:
DataValidation
- Author:
- Radhakrishnan J
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.poi.ss.usermodel.DataValidation
DataValidation.ErrorStyle -
Constructor Summary
ConstructorsConstructorDescriptionXSSFDataValidation(XSSFDataValidationConstraint constraint, CellRangeAddressList regions, org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDataValidation ctDataValidation) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateErrorBox(String title, String text) Sets the title and text for the error box .voidcreatePromptBox(String title, String text) Sets the title and text for the prompt box .booleanRetrieve the settings for empty cells allowedintobooleanbooleanbooleanUseful only list validation objects .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 Details
-
XSSFDataValidation
public XSSFDataValidation(XSSFDataValidationConstraint constraint, CellRangeAddressList regions, org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDataValidation ctDataValidation)
-
-
Method Details
-
createErrorBox
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
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
- Specified by:
getErrorBoxTextin interfaceDataValidation- Returns:
- Error box's text or
null
-
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:
-
getPromptBoxText
- Specified by:
getPromptBoxTextin interfaceDataValidation- Returns:
- Prompt box's text or
null
-
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
- 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:
-
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
- Specified by:
getRegionsin interfaceDataValidation
-
prettyPrint
-