2
|
1 |
|
|
2 |
function ComponentValidator() {
|
|
3 |
}
|
|
4 |
|
|
5 |
ComponentValidator.prototype.validate = function(instance, laf) {
|
|
6 |
return null;
|
|
7 |
}
|
|
8 |
|
|
9 |
ComponentValidator.prototype.queryPropertyChange = function(instance, propertyPath, newValue, laf) {
|
|
10 |
var result = null;
|
|
11 |
if (propertyPath == "always")
|
|
12 |
result = null;
|
|
13 |
else if (propertyPath == "never")
|
|
14 |
result = "not allowed";
|
|
15 |
else if (propertyPath == "notnull") {
|
|
16 |
if (newValue == null)
|
|
17 |
result = "not null";
|
|
18 |
}
|
|
19 |
else if (propertyPath == "compound.oddonly") {
|
|
20 |
if ((newValue & 1)==0)
|
|
21 |
result = "odd only";
|
|
22 |
}
|
|
23 |
else
|
|
24 |
result = "unknown";
|
|
25 |
return result;
|
|
26 |
}
|
|
27 |
|
|
28 |
|