org.apache.poi.xssf.usermodel
Class XSSFDataValidation

java.lang.Object
  extended by org.apache.poi.xssf.usermodel.XSSFDataValidation
All Implemented Interfaces:
DataValidation

public class XSSFDataValidation
extends java.lang.Object
implements DataValidation

Author:
Radhakrishnan J

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.poi.ss.usermodel.DataValidation
DataValidation.ErrorStyle
 
Constructor Summary
XSSFDataValidation(XSSFDataValidationConstraint constraint, CellRangeAddressList regions, org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDataValidation ctDataValidation)
           
 
Method Summary
 void createErrorBox(java.lang.String title, java.lang.String text)
          Sets the title and text for the error box .
 void createPromptBox(java.lang.String title, java.lang.String text)
          Sets the title and text for the prompt box .
 boolean getEmptyCellAllowed()
          Retrieve the settings for empty cells allowed
 java.lang.String getErrorBoxText()
           
 java.lang.String getErrorBoxTitle()
           
 int getErrorStyle()
          o
 java.lang.String getPromptBoxText()
           
 java.lang.String getPromptBoxTitle()
           
 CellRangeAddressList getRegions()
           
 boolean getShowErrorBox()
           
 boolean getShowPromptBox()
           
 boolean getSuppressDropDownArrow()
          Useful only list validation objects .
 DataValidationConstraint getValidationConstraint()
           
 java.lang.String prettyPrint()
           
 void setEmptyCellAllowed(boolean allowed)
          Sets if this object allows empty as a valid value
 void setErrorStyle(int errorStyle)
          Sets the error style for error box
 void setShowErrorBox(boolean show)
          Sets the behaviour when an invalid value is entered
 void setShowPromptBox(boolean show)
          Sets the behaviour when a cell which belongs to this object is selected
 void setSuppressDropDownArrow(boolean suppress)
          Useful for list validation objects .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSSFDataValidation

public XSSFDataValidation(XSSFDataValidationConstraint constraint,
                          CellRangeAddressList regions,
                          org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDataValidation ctDataValidation)
Method Detail

createErrorBox

public void createErrorBox(java.lang.String title,
                           java.lang.String text)
Description copied from interface: DataValidation
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 )

Specified by:
createErrorBox in interface DataValidation
Parameters:
title - The error box's title
text - The error box's text

createPromptBox

public void createPromptBox(java.lang.String title,
                            java.lang.String text)
Description copied from interface: DataValidation
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 )

Specified by:
createPromptBox in interface DataValidation
Parameters:
title - The prompt box's title
text - The prompt box's text

getEmptyCellAllowed

public boolean getEmptyCellAllowed()
Description copied from interface: DataValidation
Retrieve the settings for empty cells allowed

Specified by:
getEmptyCellAllowed in interface DataValidation
Returns:
True if this object should treats empty as valid value , false otherwise

getErrorBoxText

public java.lang.String getErrorBoxText()
Specified by:
getErrorBoxText in interface DataValidation
Returns:
Error box's text or null

getErrorBoxTitle

public java.lang.String getErrorBoxTitle()
Specified by:
getErrorBoxTitle in interface DataValidation
Returns:
Error box's title or null

getErrorStyle

public int getErrorStyle()
Description copied from interface: DataValidation
o

Specified by:
getErrorStyle in interface DataValidation
Returns:
the error style of error box
See Also:
DataValidation.ErrorStyle

getPromptBoxText

public java.lang.String getPromptBoxText()
Specified by:
getPromptBoxText in interface DataValidation
Returns:
Prompt box's text or null

getPromptBoxTitle

public java.lang.String getPromptBoxTitle()
Specified by:
getPromptBoxTitle in interface DataValidation
Returns:
Prompt box's title or null

getShowErrorBox

public boolean getShowErrorBox()
Specified by:
getShowErrorBox in interface DataValidation
Returns:
true if an error box should be displayed , false otherwise

getShowPromptBox

public boolean getShowPromptBox()
Specified by:
getShowPromptBox in interface DataValidation
Returns:
true if an prompt box should be displayed , false otherwise

getSuppressDropDownArrow

public boolean getSuppressDropDownArrow()
Description copied from interface: DataValidation
Useful only list validation objects . This method always returns false if the object isn't a list validation object

Specified by:
getSuppressDropDownArrow in interface DataValidation
Returns:
true if a list should display the values into a drop down list , false otherwise .

getValidationConstraint

public DataValidationConstraint getValidationConstraint()
Specified by:
getValidationConstraint in interface DataValidation

setEmptyCellAllowed

public void setEmptyCellAllowed(boolean allowed)
Description copied from interface: DataValidation
Sets if this object allows empty as a valid value

Specified by:
setEmptyCellAllowed in interface DataValidation
Parameters:
allowed - true if this object should treats empty as valid value , false otherwise

setErrorStyle

public void setErrorStyle(int errorStyle)
Description copied from interface: DataValidation
Sets the error style for error box

Specified by:
setErrorStyle in interface DataValidation
See Also:
DataValidation.ErrorStyle

setShowErrorBox

public void setShowErrorBox(boolean show)
Description copied from interface: DataValidation
Sets the behaviour when an invalid value is entered

Specified by:
setShowErrorBox in interface DataValidation
Parameters:
show - true if an error box should be displayed , false otherwise

setShowPromptBox

public void setShowPromptBox(boolean show)
Description copied from interface: DataValidation
Sets the behaviour when a cell which belongs to this object is selected

Specified by:
setShowPromptBox in interface DataValidation
Parameters:
show - true if an prompt box should be displayed , false otherwise

setSuppressDropDownArrow

public void setSuppressDropDownArrow(boolean suppress)
Description copied from interface: DataValidation
Useful for list validation objects .

Specified by:
setSuppressDropDownArrow in interface DataValidation
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:
getRegions in interface DataValidation

prettyPrint

public java.lang.String prettyPrint()


Copyright 2012 The Apache Software Foundation or its licensors, as applicable.