Package org.springframework.richclient.form.binding

Examples of org.springframework.richclient.form.binding.Binder


     * @param id Id of the binder
     * @return Binder or <code>null</code> if not found.
     */
    public Binder getIdBoundBinder(String id)
    {
        Binder binder = idBoundBinders.get(id);
        if (binder == null) //  try to locate the binder bean
        {
            Object binderBean = getApplicationContext().getBean(id);
            if (binderBean instanceof Binder)
            {
View Full Code Here


        registerDefaultBinders();
    }

    public Binder selectBinder(FormModel formModel, String propertyName) {
        // first try and find a binder for the specific property name
        Binder binder = findBinderByPropertyName(formModel.getFormObject().getClass(), propertyName);
        if (binder == null) {
            // next try and find a binder for the specific property type
            binder = findBinderByPropertyType(getPropertyType(formModel, propertyName));
        }
        if (binder == null) {
View Full Code Here

        throw new UnsupportedOperationException("Unable to select a binder for form model [" + formModel
                + "] property [" + propertyName + "]");
    }

    public Binder selectBinder(Class controlType, FormModel formModel, String propertyName) {
        Binder binder = findBinderByControlType(controlType);
        if (binder == null) {
            binder = selectBinder(formModel, propertyName);
        }
        if (binder != null) {
            return binder;
View Full Code Here

     * direct match found try to find binder for any superclass of the provided
     * objectType which also has the same propertyName.
     */
    protected Binder findBinderByPropertyName(Class parentObjectType, String propertyName) {
        PropertyNameKey key = new PropertyNameKey(parentObjectType, propertyName);
        Binder binder = (Binder)propertyNameBinders.get(key);
        if (binder == null) {
            // if no direct match was found try to find a match in any super classes
            final Map potentialMatchingBinders = new HashMap();
            for (Iterator i = propertyNameBinders.entrySet().iterator(); i.hasNext();) {
                Map.Entry entry = (Map.Entry)i.next();
View Full Code Here

            }
        }
        else if (binder.containsKey("binderRef"))
        {
            String binderID = (String) binder.get("binderRef");
            Binder binderBean = (Binder) getApplicationContext().getBean(binderID);
            registerBinderForPropertyName(objectClass, propertyName, binderBean);
        }
        else
            throw new IllegalArgumentException("binder or binderRef is required");
    }
View Full Code Here

        return bindControl(control, formPropertyPath, Collections.EMPTY_MAP);
    }
   
    public Binding createBinding(String formPropertyPath, Map context) {
        Assert.notNull(context, "Context must not be null");
        Binder binder = getBinderSelectionStrategy().selectBinder(formModel, formPropertyPath);
        Binding binding = binder.bind(formModel, formPropertyPath, context);
        interceptBinding(binding);
        return binding;
    }
View Full Code Here

        return binding;
    }

    public Binding createBinding(Class controlType, String formPropertyPath, Map context) {
        Assert.notNull(context, "Context must not be null");
        Binder binder = getBinderSelectionStrategy().selectBinder(controlType, formModel, formPropertyPath);
        Binding binding =  binder.bind(formModel, formPropertyPath, context);
        interceptBinding(binding);
        return binding;
    }
View Full Code Here

        return binding;
    }

    public Binding bindControl(JComponent control, String formPropertyPath, Map context) {
        Assert.notNull(context, "Context must not be null");
        Binder binder = getBinderSelectionStrategy().selectBinder(control.getClass(), formModel, formPropertyPath);
        Binding binding =  binder.bind(control, formModel, formPropertyPath, context);
        interceptBinding(binding);
        return binding;
    }
View Full Code Here

     * @return Specific binding
     */
    public Binding createBinding(String propertyPath, String binderId, Map context)
    {
        Assert.notNull(context, "Context must not be null");
        Binder binder = ((SwingBinderSelectionStrategy)getBinderSelectionStrategy()).getIdBoundBinder(binderId);
        Binding binding = binder.bind(getFormModel(), propertyPath, context);
        interceptBinding(binding);
        return binding;
    }
View Full Code Here

TOP

Related Classes of org.springframework.richclient.form.binding.Binder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.