uidesigner/com.nokia.sdt.component.symbian.test/data/componentValidatorTest/validate.js
author fturovic <frank.turovich@nokia.com>
Thu, 14 May 2009 16:28:33 -0500
changeset 152 9e83cc047260
parent 0 fb279309251b
permissions -rw-r--r--
bug 8066 - revised image and option description for dynamic variants


function ComponentValidator() {
}

ComponentValidator.prototype.validate = function(instance, laf) {
	return null;
}

ComponentValidator.prototype.queryPropertyChange = function(instance, propertyPath, newValue, laf) {
	var result = null;
	if (propertyPath == "always")
		result = null;
	else if (propertyPath == "never")
		result = "not allowed";
	else if (propertyPath == "notnull") {
		if (newValue == null)
			result = "not null";
	}
	else if (propertyPath == "compound.oddonly") {
		if ((newValue & 1)==0)
			result = "odd only";
	}
	else 
		result = "unknown";
	return result;
}