org.springframework.richclient.form.binding.swing
Class TigerEnumComboBoxBinder

java.lang.Object
  extended by org.springframework.richclient.application.support.ApplicationServicesAccessor
      extended by org.springframework.richclient.form.binding.support.AbstractBinder
          extended by org.springframework.richclient.form.binding.swing.AbstractListBinder
              extended by org.springframework.richclient.form.binding.swing.ComboBoxBinder
                  extended by org.springframework.richclient.form.binding.swing.TigerEnumComboBoxBinder
All Implemented Interfaces:
Binder

public class TigerEnumComboBoxBinder
extends ComboBoxBinder

Binds a Tiger enum in a combobox and supports i18n.
The i18n key of an enum is the full classname + "." + enumfield.
For example:
x.y.Season.WINTER = Winter

configuration happens like this:

   <bean id="binderSelectionStrategy"
           class="org.springframework.richclient.form.binding.swing.SwingBinderSelectionStrategy">
       <property name="bindersForPropertyTypes">
           <map>
               <entry>
                   <key>
                       <value type="java.lang.Class">java.lang.Enum</value>
                   </key>
                   <bean class="org.springframework.richclient.form.binding.swing.TigerEnumComboBoxBinder" />
               </entry>
           </map>
       </property>
   </bean>
 

Author:
Geoffrey De Smet

Nested Class Summary
 class TigerEnumComboBoxBinder.TigerEnumComboBoxEditor
           
 class TigerEnumComboBoxBinder.TigerEnumListRenderer
           
 
Field Summary
 
Fields inherited from class org.springframework.richclient.form.binding.swing.ComboBoxBinder
EDITOR_KEY, EMPTY_SELECTION_VALUE, RENDERER_KEY
 
Fields inherited from class org.springframework.richclient.form.binding.swing.AbstractListBinder
COMPARATOR_KEY, FILTER_KEY, SELECTABLE_ITEMS_KEY
 
Fields inherited from class org.springframework.richclient.form.binding.support.AbstractBinder
BINDING_CLIENT_PROPERTY_KEY, log
 
Fields inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor
logger
 
Constructor Summary
protected TigerEnumComboBoxBinder()
           
 
Method Summary
protected  Enum[] createEnumSelectableItems(FormModel formModel, String formPropertyPath)
           
protected  AbstractListBinding createListBinding(JComponent control, FormModel formModel, String formPropertyPath)
          Called to create the binding instance
 
Methods inherited from class org.springframework.richclient.form.binding.swing.ComboBoxBinder
applyContext, createControl, getEmptySelectionValue, setEditor, setEditorClosure, setEmptySelectionValue, setRenderer, setRendererClosure
 
Methods inherited from class org.springframework.richclient.form.binding.swing.AbstractListBinder
decorate, doBind, getComparator, getFilter, getSelectableItems, setComparator, setFilter, setSelectableItems
 
Methods inherited from class org.springframework.richclient.form.binding.support.AbstractBinder
bind, bind, getPropertyType, getRequiredSourceClass, validateContextKeys
 
Methods inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor
getActiveWindow, getApplication, getApplicationContext, getApplicationName, getApplicationServices, getCommandConfigurer, getComponentFactory, getConversionService, getIconSource, getImageSource, getMessage, getMessage, getMessage, getMessage, getMessages, getMessageSource, getObjectConfigurer, getService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TigerEnumComboBoxBinder

protected TigerEnumComboBoxBinder()
Method Detail

createListBinding

protected AbstractListBinding createListBinding(JComponent control,
                                                FormModel formModel,
                                                String formPropertyPath)
Description copied from class: AbstractListBinder
Called to create the binding instance

Overrides:
createListBinding in class ComboBoxBinder
Parameters:
control - the control to bind
formModel - the formmodel with the value of the formPropertyPath field
formPropertyPath - the field path to bind
Returns:
the binding instance. Must not be null

createEnumSelectableItems

protected Enum[] createEnumSelectableItems(FormModel formModel,
                                           String formPropertyPath)


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.