uidesigner/com.nokia.sdt.component.symbian.test/data/componentValidatorTest/validate.js
author fturovic <frank.turovich@nokia.com>
Tue, 07 Apr 2009 13:41:27 -0500
branchRCL_2_0
changeset 67 47ecdc260147
parent 2 d760517a8095
permissions -rw-r--r--
updated release date
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
cawthron
parents:
diff changeset
     1
cawthron
parents:
diff changeset
     2
function ComponentValidator() {
cawthron
parents:
diff changeset
     3
}
cawthron
parents:
diff changeset
     4
cawthron
parents:
diff changeset
     5
ComponentValidator.prototype.validate = function(instance, laf) {
cawthron
parents:
diff changeset
     6
	return null;
cawthron
parents:
diff changeset
     7
}
cawthron
parents:
diff changeset
     8
cawthron
parents:
diff changeset
     9
ComponentValidator.prototype.queryPropertyChange = function(instance, propertyPath, newValue, laf) {
cawthron
parents:
diff changeset
    10
	var result = null;
cawthron
parents:
diff changeset
    11
	if (propertyPath == "always")
cawthron
parents:
diff changeset
    12
		result = null;
cawthron
parents:
diff changeset
    13
	else if (propertyPath == "never")
cawthron
parents:
diff changeset
    14
		result = "not allowed";
cawthron
parents:
diff changeset
    15
	else if (propertyPath == "notnull") {
cawthron
parents:
diff changeset
    16
		if (newValue == null)
cawthron
parents:
diff changeset
    17
			result = "not null";
cawthron
parents:
diff changeset
    18
	}
cawthron
parents:
diff changeset
    19
	else if (propertyPath == "compound.oddonly") {
cawthron
parents:
diff changeset
    20
		if ((newValue & 1)==0)
cawthron
parents:
diff changeset
    21
			result = "odd only";
cawthron
parents:
diff changeset
    22
	}
cawthron
parents:
diff changeset
    23
	else 
cawthron
parents:
diff changeset
    24
		result = "unknown";
cawthron
parents:
diff changeset
    25
	return result;
cawthron
parents:
diff changeset
    26
}
cawthron
parents:
diff changeset
    27
	
cawthron
parents:
diff changeset
    28