Author: scabanovich
Date: 2010-10-01 10:28:05 -0400 (Fri, 01 Oct 2010)
New Revision: 25396
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintList.java
Log:
JBIDE-7235
https://jira.jboss.org/browse/JBIDE-7235
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintList.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintList.java 2010-10-01
14:01:23 UTC (rev 25395)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintList.java 2010-10-01
14:28:05 UTC (rev 25396)
@@ -21,7 +21,22 @@
}
public String getError(String value) {
- return accepts(value) ? null : ModelMessages.CONSTRAINT_IS_NOT_IN_LIST;
+ if(accepts(value)) {
+ return null;
+ }
+ String[] vs = getValues();
+ if(vs.length < 6) {
+ String message = " should be one of ";
+ int j = 0;
+ for (int i = 0; i < vs.length; i++) {
+ if(vs[i].length() == 0 || vs[i].startsWith("Default(")) continue;
//$NON-NLS-1$
+ if(j > 0) message += ", "; //$NON-NLS-1$
+ message += getValues()[i];
+ j++;
+ }
+ return message;
+ }
+ return ModelMessages.CONSTRAINT_IS_NOT_IN_LIST;
}
}