Author: dgolovin
Date: 2007-09-20 20:54:51 -0400 (Thu, 20 Sep 2007)
New Revision: 3746
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/DataModelValidatorDelegate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-931
Now it save order for validation.
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/DataModelValidatorDelegate.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/DataModelValidatorDelegate.java 2007-09-21
00:21:13 UTC (rev 3745)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/DataModelValidatorDelegate.java 2007-09-21
00:54:51 UTC (rev 3746)
@@ -10,7 +10,9 @@
******************************************************************************/
package org.jboss.tools.seam.ui.internal.project.facet;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import org.eclipse.jface.wizard.WizardPage;
@@ -43,6 +45,8 @@
* Map from property name to IValidator instance
*/
protected Map<String,IValidator> mapPropToValidator = new
HashMap<String,IValidator>();
+
+ private List<String> validationOrder= new ArrayList<String>();
/**
*
@@ -90,7 +94,7 @@
* @return
*/
public String getFirstValidationError() {
- for (String validatorName : mapPropToValidator.keySet()) {
+ for (String validatorName : validationOrder) {
Map<String,String> errors = getValidator(validatorName).validate(
model.getProperty(validatorName),model);
String message = errors.get(validatorName);
@@ -118,5 +122,6 @@
*/
public void addValidatorForProperty(String name, IValidator validator) {
mapPropToValidator.put(name, validator);
+ validationOrder.add(name);
}
}