Revision: 1442 http://svn.sourceforge.net/spring-rich-c/?rev=1442&view=rev Author: ge0ffrey Date: 2006-09-25 06:33:35 -0700 (Mon, 25 Sep 2006)
Log Message: ----------- Improved the I18n slightly, the rest is up to Hibernate's validator: ANN-445 Modified Paths: -------------- trunk/spring-richclient/tiger/src/main/java/org/springframework/richclient/exceptionhandling/HibernateValidatorDialogExceptionHandler.java Modified: trunk/spring-richclient/tiger/src/main/java/org/springframework/richclient/exceptionhandling/HibernateValidatorDialogExceptionHandler.java =================================================================== --- trunk/spring-richclient/tiger/src/main/java/org/springframework/richclient/exceptionhandling/HibernateValidatorDialogExceptionHandler.java 2006-09-25 09:54:09 UTC (rev 1441) +++ trunk/spring-richclient/tiger/src/main/java/org/springframework/richclient/exceptionhandling/HibernateValidatorDialogExceptionHandler.java 2006-09-25 13:33:35 UTC (rev 1442) @@ -4,6 +4,7 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.WordUtils; import org.hibernate.validator.InvalidStateException; +import org.hibernate.validator.InvalidValue; import javax.swing.JPanel; import javax.swing.JLabel; @@ -42,7 +43,16 @@ JPanel panel = new JPanel(new BorderLayout()); JLabel explanationLabel = new JLabel(explanation); panel.add(explanationLabel, BorderLayout.NORTH); - JList invalidValuesJList = new JList(invalidStateException.getInvalidValues()); + List<String> invalidValueMessageList = new ArrayList<String>(); + for (InvalidValue invalidValue : invalidStateException.getInvalidValues()) { + StringBuffer messageBuffer = new StringBuffer(); + String propertyName = invalidValue.getPropertyName(); + messageBuffer.append(messageSourceAccessor.getMessage(propertyName + ".label", propertyName)); + messageBuffer.append(" "); + messageBuffer.append(invalidValue.getMessage()); + invalidValueMessageList.add(messageBuffer.toString()); + } + JList invalidValuesJList = new JList(invalidValueMessageList.toArray()); JScrollPane invalidValuesScrollPane = new JScrollPane(invalidValuesJList, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); panel.add(invalidValuesScrollPane, BorderLayout.CENTER); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ spring-rich-c-cvs mailing list spring-rich-c-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spring-rich-c-cvs