| java.lang.Object org.apache.poi.hssf.util.HSSFDataValidation
HSSFDataValidation | public class HSSFDataValidation (Code) | | Title: HSSFDataValidation
Description: Utilty class for creating data validation cells
Copyright: Copyright (c) 2004
Company:
author: Dragos Buleandra (dragos.buleandra@trade2b.ro) version: 2.0-pre |
DATA_TYPE_ANY | final public static int DATA_TYPE_ANY(Code) | | Any type
|
DATA_TYPE_DATE | final public static int DATA_TYPE_DATE(Code) | | Date type
|
DATA_TYPE_DECIMAL | final public static int DATA_TYPE_DECIMAL(Code) | | Decimal type
|
DATA_TYPE_FORMULA | final public static int DATA_TYPE_FORMULA(Code) | | Formula ( custom ) type
|
DATA_TYPE_INTEGER | final public static int DATA_TYPE_INTEGER(Code) | | Integer type
|
DATA_TYPE_LIST | final public static int DATA_TYPE_LIST(Code) | | List type ( combo box type )
|
DATA_TYPE_TEXT_LENGTH | final public static int DATA_TYPE_TEXT_LENGTH(Code) | | String length type
|
DATA_TYPE_TIME | final public static int DATA_TYPE_TIME(Code) | | Time type
|
ERROR_STYLE_INFO | final public static int ERROR_STYLE_INFO(Code) | | INFO style like
|
ERROR_STYLE_STOP | final public static int ERROR_STYLE_STOP(Code) | | STOP style like
|
ERROR_STYLE_WARNING | final public static int ERROR_STYLE_WARNING(Code) | | WARNING style like
|
OPERATOR_BETWEEN | final public static int OPERATOR_BETWEEN(Code) | | Condition operator
|
OPERATOR_EQUAL | final public static int OPERATOR_EQUAL(Code) | | |
OPERATOR_GREATER_OR_EQUAL | final public static int OPERATOR_GREATER_OR_EQUAL(Code) | | |
OPERATOR_GREATER_THAN | final public static int OPERATOR_GREATER_THAN(Code) | | |
OPERATOR_LESS_OR_EQUAL | final public static int OPERATOR_LESS_OR_EQUAL(Code) | | |
OPERATOR_LESS_THAN | final public static int OPERATOR_LESS_THAN(Code) | | |
OPERATOR_NOT_BETWEEN | final public static int OPERATOR_NOT_BETWEEN(Code) | | |
OPERATOR_NOT_EQUAL | final public static int OPERATOR_NOT_EQUAL(Code) | | |
HSSFDataValidation | public HSSFDataValidation()(Code) | | Empty constructor
|
HSSFDataValidation | public HSSFDataValidation(short first_row, short first_col, short last_row, short last_col)(Code) | | Constructor wich initializes the cell range on wich this object will be applied
Parameters: first_row - First row Parameters: first_col - First column Parameters: last_row - Last row Parameters: last_col - Last column |
createErrorBox | public void createErrorBox(String title, String text)(Code) | | 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 title Parameters: text - The error box's text See Also: setShowErrorBox( boolean show ) |
createPromptBox | public void createPromptBox(String title, String text)(Code) | | 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 title Parameters: text - The prompt box's text See Also: setShowPromptBox( boolean show ) |
getDataValidationType | public int getDataValidationType()(Code) | | The data type of this object
The type See Also: DATA_TYPE_ANY, DATA_TYPE_INTEGER, DATA_TYPE_DECIMNAL, DATA_TYPE_LIST, DATA_TYPE_DATE, See Also: DATA_TYPE_TIME, DATA_TYPE_TEXT_LENTGH, DATA_TYPE_FORMULA |
getEmptyCellAllowed | public boolean getEmptyCellAllowed()(Code) | | Retrieve the settings for empty cells allowed
True if this object should treats empty as valid value , false otherwise |
getErrorBoxText | public String getErrorBoxText()(Code) | | Returns the error box's text
Error box's text or null |
getErrorBoxTitle | public String getErrorBoxTitle()(Code) | | Returns the error box's title
Error box's title or null |
getErrorStyle | public int getErrorStyle()(Code) | | returns the error style of errror box
the style constant See Also: ERROR_STYLE_STOP, ERROR_STYLE_WARNING, ERROR_STYLE_INFO |
getExplicitListFormula | public boolean getExplicitListFormula()(Code) | | Returns the settings for explicit formula . This is useful only for list data validation objects.
This method always returns false if the object isn't a list validation object
See Also: setDataValidationType( int data_type ) |
getFirstColumn | public short getFirstColumn()(Code) | | |
getFirstFormula | public String getFirstFormula()(Code) | | Returns the first formula
|
getFirstRow | public short getFirstRow()(Code) | | |
getLastColumn | public short getLastColumn()(Code) | | |
getLastRow | public short getLastRow()(Code) | | |
getOperator | public int getOperator()(Code) | | Retrieves the operator used for this object's formula
See Also: OPERATOR_BETWEEN, OPERATOR_NOT_BETWEEN, OPERATOR_EQUAL, OPERATOR_NOT_EQUAL See Also: OPERATOR_GREATER_THAN, OPERATOR_LESS_THAN, OPERATOR_GREATER_OR_EQUAL, See Also: OPERATOR_LESS_OR_EQUAL |
getPromptBoxText | public String getPromptBoxText()(Code) | | Returns the prompt box's text
Prompt box's text or null |
getPromptBoxTitle | public String getPromptBoxTitle()(Code) | | Returns the prompt box's title
Prompt box's title or null |
getSecondFormula | public String getSecondFormula()(Code) | | Returns the second formula
|
getShowErrorBox | public boolean getShowErrorBox()(Code) | | True if an error box should be displayed , false otherwise |
getShowPromptBox | public boolean getShowPromptBox()(Code) | | Parameters: show - True if an prompt box should be displayed , false otherwise |
getSurppressDropDownArrow | public boolean getSurppressDropDownArrow()(Code) | | Useful only list validation objects .
This method always returns false if the object isn't a list validation object
True if a list should display the values into a drop down list , false otherwise . See Also: setDataValidationType( int data_type ) |
setDataValidationType | public void setDataValidationType(int data_type)(Code) | | Set the type of this object
Parameters: data_type - The type See Also: DATA_TYPE_ANY, DATA_TYPE_INTEGER, DATA_TYPE_DECIMNAL, DATA_TYPE_LIST, DATA_TYPE_DATE, See Also: DATA_TYPE_TIME, DATA_TYPE_TEXT_LENTGH, DATA_TYPE_FORMULA |
setEmptyCellAllowed | public void setEmptyCellAllowed(boolean allowed)(Code) | | Sets if this object allows empty as a valid value
Parameters: allowed - True if this object should treats empty as valid value , false otherwise |
setErrorStyle | public void setErrorStyle(int error_style)(Code) | | Sets the error style for error box
Parameters: error_style - Error style constant See Also: ERROR_STYLE_STOP, ERROR_STYLE_WARNING, ERROR_STYLE_INFO |
setExplicitListFormula | public void setExplicitListFormula(boolean explicit)(Code) | | If this object has an explicit formula . This is useful only for list data validation object
Parameters: explicit - True if use an explicit formula |
setFirstColumn | public void setFirstColumn(short first_column)(Code) | | |
setFirstFormula | public void setFirstFormula(String formula)(Code) | | Sets the first formula for this object .
A formula is divided into three parts : first formula , operator and second formula .
In other words , a formula contains a left oprand , an operator and a right operand.
This is the general rule . An example is 1<= value <= 5 . In this case ,
the left operand ( or the first formula ) is the number 1 . The operator is
OPERATOR_BETWEEN and the right operand ( or the second formula ) is 5 .
Parameters: formula - |
setFirstRow | public void setFirstRow(short first_row)(Code) | | |
setLastColumn | public void setLastColumn(short last_column)(Code) | | |
setLastRow | public void setLastRow(short last_row)(Code) | | |
setOperator | public void setOperator(int operator)(Code) | | Sets the operator involved in the formula whic governs this object
Example : if you wants that a cell to accept only values between 1 and 5 , which
mathematically means 1 <= value <= 5 , then the operator should be OPERATOR_BETWEEN
Parameters: operator - A constant for operator See Also: OPERATOR_BETWEEN, OPERATOR_NOT_BETWEEN, OPERATOR_EQUAL, OPERATOR_NOT_EQUAL See Also: OPERATOR_GREATER_THAN, OPERATOR_LESS_THAN, OPERATOR_GREATER_OR_EQUAL, See Also: OPERATOR_LESS_OR_EQUAL |
setSecondFormula | public void setSecondFormula(String formula)(Code) | | Sets the first formula for this object .
A formula is divided into three parts : first formula , operator and second formula .
In other words , a formula contains a left oprand , an operator and a right operand.
This is the general rule . An example is 1<= value <=5 . In this case ,
the left operand ( or the first formula ) is the number 1 . The operator is
OPERATOR_BETWEEN and the right operand ( or the second formula ) is 5 .
But there are cases when a second formula isn't needed :
You want somethink like : all values less than 5 . In this case , there's only a first
formula ( in our case 5 ) and the operator OPERATOR_LESS_THAN
Parameters: formula - |
setShowErrorBox | public void setShowErrorBox(boolean show)(Code) | | Sets the behaviour when an invalid value is entered
Parameters: show - True if an error box should be displayed , false otherwise |
setShowPromptBox | public void setShowPromptBox(boolean show)(Code) | | 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 |
setSurppressDropDownArrow | public void setSurppressDropDownArrow(boolean surppres)(Code) | | Useful for list validation objects .
Parameters: surppres - 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 |
|
|