Top Description Fields Constructors Methods
org.apache.poi.hssf.usermodel

public final Class HSSFDataValidation

extends Object
implements DataValidation
Class Inheritance
All Implemented Interfaces
org.apache.poi.ss.usermodel.DataValidation
Imports
org.apache.poi.hssf.record.DVRecord, org.apache.poi.hssf.usermodel.DVConstraint.FormulaPair, org.apache.poi.ss.usermodel.DataValidation, .DataValidationConstraint, .DataValidationConstraint.ValidationType, org.apache.poi.ss.util.CellRangeAddressList

Utility class for creating data validation cells

Field Summary

Modifier and TypeField and Description
private DVConstraint
private boolean
private String
private String
private int
private String
private String
private CellRangeAddressList
private boolean
private boolean
private boolean

Constructor Summary

AccessConstructor and Description
public
HSSFDataValidation(CellRangeAddressList
A list of regions where the constraint is validated.
regions
,
DataValidationConstraint
The constraints to apply for this validation.
constraint
)

Constructor which initializes the cell range on which this object will be applied

Method Summary

Modifier and TypeMethod and Description
public DVRecord
public void
createErrorBox(String
The error box's title
title
,
String
The error box's text
text
)

Implements org.apache.poi.ss.usermodel.DataValidation.createErrorBox.

Sets the title and text for the error box .

public void
createPromptBox(String
The prompt box's title
title
,
String
The prompt box's text
text
)

Implements org.apache.poi.ss.usermodel.DataValidation.createPromptBox.

Sets the title and text for the prompt box .

public DVConstraint
public boolean
getEmptyCellAllowed()

Implements org.apache.poi.ss.usermodel.DataValidation.getEmptyCellAllowed.

Retrieve the settings for empty cells allowed

public String
public String
public int
public String
public String
public CellRangeAddressList
public boolean
public boolean
public boolean
public DataValidationConstraint
public void
setEmptyCellAllowed(boolean
true if this object should treats empty as valid value , false otherwise
allowed
)

Implements org.apache.poi.ss.usermodel.DataValidation.setEmptyCellAllowed.

Sets if this object allows empty as a valid value

public void
setErrorStyle(int error_style)

Implements org.apache.poi.ss.usermodel.DataValidation.setErrorStyle.

Sets the error style for error box

public void
setShowErrorBox(boolean
true if an error box should be displayed , false otherwise
show
)

Implements org.apache.poi.ss.usermodel.DataValidation.setShowErrorBox.

Sets the behaviour when an invalid value is entered

public void
setShowPromptBox(boolean
true if an prompt box should be displayed , false otherwise
show
)

Implements org.apache.poi.ss.usermodel.DataValidation.setShowPromptBox.

Sets the behaviour when a cell which belongs to this object is selected

public void
setSuppressDropDownArrow(boolean
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
suppress
)

Implements org.apache.poi.ss.usermodel.DataValidation.setSuppressDropDownArrow.

Useful for list validation objects .

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_constraintback to summary
private DVConstraint _constraint
_emptyCellAllowedback to summary
private boolean _emptyCellAllowed
_error_textback to summary
private String _error_text
_error_titleback to summary
private String _error_title
_errorStyleback to summary
private int _errorStyle
_prompt_textback to summary
private String _prompt_text
_prompt_titleback to summary
private String _prompt_title
_regionsback to summary
private CellRangeAddressList _regions
_showErrorBoxback to summary
private boolean _showErrorBox
_showPromptBoxback to summary
private boolean _showPromptBox
_suppress_dropdown_arrowback to summary
private boolean _suppress_dropdown_arrow

Constructor Detail

HSSFDataValidationback to summary
public HSSFDataValidation(CellRangeAddressList regions, DataValidationConstraint constraint)

Constructor which initializes the cell range on which this object will be applied

Parameters
regions:CellRangeAddressList

A list of regions where the constraint is validated.

constraint:DataValidationConstraint

The constraints to apply for this validation.

Method Detail

createDVRecordback to summary
public DVRecord createDVRecord(HSSFSheet sheet)
createErrorBoxback to summary
public void createErrorBox(String title, String text)

Implements org.apache.poi.ss.usermodel.DataValidation.createErrorBox.

Doc from org.apache.poi.ss.usermodel.DataValidation.createErrorBox.

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:String

The error box's title

text:String

The error box's text

createPromptBoxback to summary
public void createPromptBox(String title, String text)

Implements org.apache.poi.ss.usermodel.DataValidation.createPromptBox.

Doc from org.apache.poi.ss.usermodel.DataValidation.createPromptBox.

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:String

The prompt box's title

text:String

The prompt box's text

getConstraintback to summary
public DVConstraint getConstraint()
getEmptyCellAllowedback to summary
public boolean getEmptyCellAllowed()

Implements org.apache.poi.ss.usermodel.DataValidation.getEmptyCellAllowed.

Doc from org.apache.poi.ss.usermodel.DataValidation.getEmptyCellAllowed.

Retrieve the settings for empty cells allowed

Returns:boolean

True if this object should treats empty as valid value , false otherwise

getErrorBoxTextback to summary
public String getErrorBoxText()

Implements org.apache.poi.ss.usermodel.DataValidation.getErrorBoxText.

Returns:String

Doc from org.apache.poi.ss.usermodel.DataValidation.getErrorBoxText.

Error box's text or null

getErrorBoxTitleback to summary
public String getErrorBoxTitle()

Implements org.apache.poi.ss.usermodel.DataValidation.getErrorBoxTitle.

Returns:String

Doc from org.apache.poi.ss.usermodel.DataValidation.getErrorBoxTitle.

Error box's title or null

getErrorStyleback to summary
public int getErrorStyle()

Implements org.apache.poi.ss.usermodel.DataValidation.getErrorStyle.

Doc from org.apache.poi.ss.usermodel.DataValidation.getErrorStyle.

o

Returns:int

the error style of error box

getPromptBoxTextback to summary
public String getPromptBoxText()

Implements org.apache.poi.ss.usermodel.DataValidation.getPromptBoxText.

Returns:String

Doc from org.apache.poi.ss.usermodel.DataValidation.getPromptBoxText.

Prompt box's text or null

getPromptBoxTitleback to summary
public String getPromptBoxTitle()

Implements org.apache.poi.ss.usermodel.DataValidation.getPromptBoxTitle.

Returns:String

Doc from org.apache.poi.ss.usermodel.DataValidation.getPromptBoxTitle.

Prompt box's title or null

getRegionsback to summary
public CellRangeAddressList getRegions()

Implements org.apache.poi.ss.usermodel.DataValidation.getRegions.

getShowErrorBoxback to summary
public boolean getShowErrorBox()

Implements org.apache.poi.ss.usermodel.DataValidation.getShowErrorBox.

Returns:boolean

Doc from org.apache.poi.ss.usermodel.DataValidation.getShowErrorBox.

true if an error box should be displayed , false otherwise

getShowPromptBoxback to summary
public boolean getShowPromptBox()

Implements org.apache.poi.ss.usermodel.DataValidation.getShowPromptBox.

Returns:boolean

Doc from org.apache.poi.ss.usermodel.DataValidation.getShowPromptBox.

true if an prompt box should be displayed , false otherwise

getSuppressDropDownArrowback to summary
public boolean getSuppressDropDownArrow()

Implements org.apache.poi.ss.usermodel.DataValidation.getSuppressDropDownArrow.

Doc from org.apache.poi.ss.usermodel.DataValidation.getSuppressDropDownArrow.

Useful only list validation objects . This method always returns false if the object isn't a list validation object

Returns:boolean

true if a list should display the values into a drop down list , false otherwise .

getValidationConstraintback to summary
public DataValidationConstraint getValidationConstraint()

Implements org.apache.poi.ss.usermodel.DataValidation.getValidationConstraint.

setEmptyCellAllowedback to summary
public void setEmptyCellAllowed(boolean allowed)

Implements org.apache.poi.ss.usermodel.DataValidation.setEmptyCellAllowed.

Doc from org.apache.poi.ss.usermodel.DataValidation.setEmptyCellAllowed.

Sets if this object allows empty as a valid value

Parameters
allowed:boolean

true if this object should treats empty as valid value , false otherwise

setErrorStyleback to summary
public void setErrorStyle(int error_style)

Implements org.apache.poi.ss.usermodel.DataValidation.setErrorStyle.

Doc from org.apache.poi.ss.usermodel.DataValidation.setErrorStyle.

Sets the error style for error box

setShowErrorBoxback to summary
public void setShowErrorBox(boolean show)

Implements org.apache.poi.ss.usermodel.DataValidation.setShowErrorBox.

Doc from org.apache.poi.ss.usermodel.DataValidation.setShowErrorBox.

Sets the behaviour when an invalid value is entered

Parameters
show:boolean

true if an error box should be displayed , false otherwise

setShowPromptBoxback to summary
public void setShowPromptBox(boolean show)

Implements org.apache.poi.ss.usermodel.DataValidation.setShowPromptBox.

Doc from org.apache.poi.ss.usermodel.DataValidation.setShowPromptBox.

Sets the behaviour when a cell which belongs to this object is selected

Parameters
show:boolean

true if an prompt box should be displayed , false otherwise

setSuppressDropDownArrowback to summary
public void setSuppressDropDownArrow(boolean suppress)

Implements org.apache.poi.ss.usermodel.DataValidation.setSuppressDropDownArrow.

Doc from org.apache.poi.ss.usermodel.DataValidation.setSuppressDropDownArrow.

Useful for list validation objects .

Parameters
suppress:boolean

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