Package org.apache.poi.ss.usermodel
Interface DataValidation
-
- All Known Implementing Classes:
HSSFDataValidation
public interface DataValidation
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
DataValidation.ErrorStyle
Error style constants for error box
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
createErrorBox(String title, String text)
Sets the title and text for the error box .void
createPromptBox(String title, String text)
Sets the title and text for the prompt box .boolean
getEmptyCellAllowed()
Retrieve the settings for empty cells allowedString
getErrorBoxText()
String
getErrorBoxTitle()
int
getErrorStyle()
oString
getPromptBoxText()
String
getPromptBoxTitle()
CellRangeAddressList
getRegions()
boolean
getShowErrorBox()
boolean
getShowPromptBox()
boolean
getSuppressDropDownArrow()
Useful only list validation objects .DataValidationConstraint
getValidationConstraint()
void
setEmptyCellAllowed(boolean allowed)
Sets if this object allows empty as a valid valuevoid
setErrorStyle(int error_style)
Sets the error style for error boxvoid
setShowErrorBox(boolean show)
Sets the behaviour when an invalid value is enteredvoid
setShowPromptBox(boolean show)
Sets the behaviour when a cell which belongs to this object is selectedvoid
setSuppressDropDownArrow(boolean suppress)
Useful for list validation objects .
-
-
-
Method Detail
-
getValidationConstraint
DataValidationConstraint getValidationConstraint()
-
setErrorStyle
void setErrorStyle(int error_style)
Sets the error style for error box- See Also:
DataValidation.ErrorStyle
-
getErrorStyle
int getErrorStyle()
o- Returns:
- the error style of error box
- See Also:
DataValidation.ErrorStyle
-
setEmptyCellAllowed
void setEmptyCellAllowed(boolean allowed)
Sets if this object allows empty as a valid value- Parameters:
allowed
-true
if this object should treats empty as valid value ,false
otherwise
-
getEmptyCellAllowed
boolean getEmptyCellAllowed()
Retrieve the settings for empty cells allowed- Returns:
- True if this object should treats empty as valid value , false otherwise
-
setSuppressDropDownArrow
void setSuppressDropDownArrow(boolean suppress)
Useful for list validation objects .- 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
-
getSuppressDropDownArrow
boolean getSuppressDropDownArrow()
Useful only list validation objects . This method always returns false if the object isn't a list validation object- Returns:
true
if a list should display the values into a drop down list ,false
otherwise .
-
setShowPromptBox
void setShowPromptBox(boolean show)
Sets the behaviour when a cell which belongs to this object is selected- Parameters:
show
-true
if an prompt box should be displayed ,false
otherwise
-
getShowPromptBox
boolean getShowPromptBox()
- Returns:
true
if an prompt box should be displayed ,false
otherwise
-
setShowErrorBox
void setShowErrorBox(boolean show)
Sets the behaviour when an invalid value is entered- Parameters:
show
-true
if an error box should be displayed ,false
otherwise
-
getShowErrorBox
boolean getShowErrorBox()
- Returns:
true
if an error box should be displayed ,false
otherwise
-
createPromptBox
void createPromptBox(String title, String text)
Sets 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 )- Parameters:
title
- The prompt box's titletext
- The prompt box's text
-
getPromptBoxTitle
String getPromptBoxTitle()
- Returns:
- Prompt box's title or
null
-
getPromptBoxText
String getPromptBoxText()
- Returns:
- Prompt box's text or
null
-
createErrorBox
void createErrorBox(String title, String text)
Sets 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 )- Parameters:
title
- The error box's titletext
- The error box's text
-
getErrorBoxTitle
String getErrorBoxTitle()
- Returns:
- Error box's title or
null
-
getErrorBoxText
String getErrorBoxText()
- Returns:
- Error box's text or
null
-
getRegions
CellRangeAddressList getRegions()
-
-