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

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
All Implemented Interfaces:
Binder
Direct Known Subclasses:
EnumComboBoxBinder, TigerEnumComboBoxBinder

public class ComboBoxBinder
extends AbstractListBinder

Author:
Oliver Hutchison

Field Summary
static String EDITOR_KEY
           
static String EMPTY_SELECTION_VALUE
          context key for a value which is used to mark an empty Selection.
static String 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
ComboBoxBinder()
           
ComboBoxBinder(Class requiredSourceClass, String[] supportedContextKeys)
           
ComboBoxBinder(String[] supportedContextKeys)
           
 
Method Summary
protected  void applyContext(AbstractListBinding binding, Map context)
          Applies any context or preset value.
protected  JComponent createControl(Map context)
           
protected  AbstractListBinding createListBinding(JComponent control, FormModel formModel, String formPropertyPath)
          Called to create the binding instance
 Object getEmptySelectionValue()
           
 void setEditor(ComboBoxEditor editor)
           
 void setEditorClosure(Closure editorClosure)
          Defines a closure which is called to create the editor.
 void setEmptySelectionValue(Object emptySelectionValue)
           
 void setRenderer(ListCellRenderer renderer)
           
 void setRendererClosure(Closure rendererClosure)
          Defines a closure which is called to create the renderer.
 
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
 

Field Detail

RENDERER_KEY

public static final String RENDERER_KEY
See Also:
Constant Field Values

EDITOR_KEY

public static final String EDITOR_KEY
See Also:
Constant Field Values

EMPTY_SELECTION_VALUE

public static final String EMPTY_SELECTION_VALUE
context key for a value which is used to mark an empty Selection. If this value is selected null will be assigned to the fields value

See Also:
Constant Field Values
Constructor Detail

ComboBoxBinder

public ComboBoxBinder()

ComboBoxBinder

public ComboBoxBinder(String[] supportedContextKeys)

ComboBoxBinder

public ComboBoxBinder(Class requiredSourceClass,
                      String[] supportedContextKeys)
Method Detail

createListBinding

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

Specified by:
createListBinding in class AbstractListBinder
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

applyContext

protected void applyContext(AbstractListBinding binding,
                            Map context)
Description copied from class: AbstractListBinder
Applies any context or preset value.

Overrides:
applyContext in class AbstractListBinder
Parameters:
binding - the binding to apply the values
context - contains context dependent values

createControl

protected JComponent createControl(Map context)
Specified by:
createControl in class AbstractBinder

setRenderer

public void setRenderer(ListCellRenderer renderer)

setRendererClosure

public void setRendererClosure(Closure rendererClosure)
Defines a closure which is called to create the renderer. The argument for the closure will be the default renderer (see JComboBox.getRenderer() of the combobox. The closure must create an instance of ListCellRenderer

Parameters:
rendererClosure - the closure which is used to create the renderer

setEditor

public void setEditor(ComboBoxEditor editor)

setEditorClosure

public void setEditorClosure(Closure editorClosure)
Defines a closure which is called to create the editor. The argument for the closure will be the default editor (see JComboBox.getEditor() of the combobox. The closure must create an instance of ComboBoxEditor

Parameters:
editorClosure - the closure which is used to create the editor

getEmptySelectionValue

public Object getEmptySelectionValue()

setEmptySelectionValue

public void setEmptySelectionValue(Object emptySelectionValue)


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