This issue is very easy to resolve in Spring-RCP, you simply put the follwong bean definition into the context:
<bean id="binderSelectionStrategy" class="org.springframework.richclient.form.binding.swing.SwingBinderSelectionStrategy"> <property name="bindersForPropertyTypes"> <map> <entry> <key><value type="java.lang.Class">com.company.app.YourClass</value></key> <bean class="com.company.app.YourCustomBinder" /> </entry> </map> </property> </bean>
For each class that needs a modified binding, just add an entry in this map, they will get picked up automagically.
<entry> <key><value type="java.lang.Class">java.lang.Enum</value></key> <bean class="org.springframework.richclient.form.binding.swing.TigerEnumComboBoxBinder" /> </entry>
<bean id="binderSelectionStrategy" class="org.springframework.richclient.form.binding.swing.SwingBinderSelectionStrategy"> <property name="bindersForPropertyNames"> <list> <props> <prop key="objectClass">com.company.app.model.Person</prop> <prop key="propertyName">gender</prop> <prop key="binderRef">tigerBinder</prop> </props> </list> </property> </bean> <bean id="tigerBinder" class="org.springframework.richclient.form.binding.swing.TigerEnumComboBoxBinder"/>
<entry> <key><value type="java.lang.Class">java.util.Date</value></key> <bean class="org.springframework.richclient.form.binding.swing.NachoCalendarDateFieldBinder" /> </entry>
To use this component, an additional library is needed, just add the following definition to the pom.xml:
<dependency> <groupId>net.sf.nachocalendar</groupId> <artifactId>nachocalendar</artifactId> </dependency>