Package com.iizigo.prop.editor
Class UnitRange
java.lang.Object
com.iizigo.prop.editor.UnitRange
- All Implemented Interfaces:
IEntryValidator
The UnitRange validator, options[0] is "0" to indicate that zero is allowed. Default is that the value must be positive.
- Author:
- Mikael Andersson
Constructor Summary
Method Summary
Modifier and TypeMethodDescriptiongetDescription
(IPropertyEditorController controller, PropertyEditorInfo info, PropCnr[] parents, String[] options) Gets a description of the validation options.validate
(IPropertyEditorController controller, PropertyEditorInfo info, PropCnr[] parents, String value, String[] options) Validates the property value after editing.
Constructor Details
UnitRange
public UnitRange()Default constructor.
Method Details
validate
public String validate(IPropertyEditorController controller, PropertyEditorInfo info, PropCnr[] parents, String value, String[] options) Validates the property value after editing. If this is successful, null is returned. Otherwise an error message string is returned that can be used as the tooltip text.- Specified by:
validate
in interfaceIEntryValidator
- Parameters:
controller
- The controller of the property editor.info
- Information about the item being edited.parents
- Property containers of the property.value
- The string value to set.options
- Validation options, may be null for none.- Returns:
- An error message or null for OK validation.
getDescription
public String getDescription(IPropertyEditorController controller, PropertyEditorInfo info, PropCnr[] parents, String[] options) Gets a description of the validation options.- Specified by:
getDescription
in interfaceIEntryValidator
- Parameters:
controller
- The controller of the property editor.info
- Information about the item being edited.parents
- Property containers of the property.options
- Validation options, may be null for none.- Returns:
- The descriptive string that can be prepended with e.g. "Enter ";