Package org.springframework.richclient.form.binding

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


                    @Override
                    protected JComponent createFormControl() {
                        SwingBindingFactory factory = (SwingBindingFactory) getBindingFactory();
                        TableFormBuilder formBuilder = getFormBuilder();

                        Binding bind = factory.createBoundList("commonPersons");
                        formBuilder.add(bind);
                        JPanel mainPanel = new JPanel(new BorderLayout());
                        mainPanel.add(getFormBuilder().getForm(), BorderLayout.CENTER);
                        updateControlsForState();
                        return mainPanel;
View Full Code Here


        TableFormBuilder formBuilder = getFormBuilder();

        nameEditor = formBuilder.add("name")[1];
        formBuilder.row();

        Binding binding = new EventStartBinding(getFormModel(), settings);
        formBuilder.addBinding(binding, (JComponent) null, "colSpan=1 align=left");       

        formBuilder.add(factory.createBoundComboBox("duration", EventStartBinding.createList(1, settings.getTimeslotsPerDay() + 1)));
        formBuilder.row();
View Full Code Here

            JPanel panel = new JPanel(new FormLayout("center:pref", "pref,3dlu,pref,3dlu,pref,3dlu, pref"));
            CellConstraints cc = new CellConstraints();

            panel.add(new JLabel(getMessage("radioButtonEnumForm.smallEnum.label")), cc.xy(1, 1));
            EnumRadioButtonBinder binder = new EnumRadioButtonBinder();
            Binding binding = binder.bind(getFormModel(), "smallEnum", Collections.EMPTY_MAP);
            panel.add(binding.getControl(), cc.xy(1, 3));

            panel.add(new JLabel(getMessage("radioButtonEnumForm.nullableEnum.label")), cc.xy(1, 5));
            binder = new EnumRadioButtonBinder();
            binder.setNullable(true);
            binding = binder.bind(getFormModel(), "nullableEnum", Collections.EMPTY_MAP);
            panel.add(binding.getControl(), cc.xy(1, 7));
            return panel;
        }
View Full Code Here

    @SuppressWarnings("unchecked")
    public Binding bind(JComponent control, FormModel formModel,
                        String formPropertyPath, Map context)
    {
        Binding binding = (Binding) control
                .getClientProperty(BINDING_CLIENT_PROPERTY_KEY);
        if (binding != null)
        {
            throw new IllegalStateException(
                    "Component is already bound to property: "
                            + binding.getProperty());
        }
        binding = doBind(control, formModel, formPropertyPath, context);
        control.putClientProperty(BINDING_CLIENT_PROPERTY_KEY, binding);
        return binding;
    }
View Full Code Here

    }
   
    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

    }

    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

    }

    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

    protected abstract JComponent createControl(Map context);

    public Binding bind(JComponent control, FormModel formModel, String formPropertyPath, Map context) {
        // Ensure that this component has not already been bound
        Binding binding = (Binding)control.getClientProperty(BINDING_CLIENT_PROPERTY_KEY);
        if( binding != null ) {
            throw new IllegalStateException( "Component is already bound to property: " + binding.getProperty());
        }
        validateContextKeys(context);
        binding = doBind(control, formModel, formPropertyPath, context);
        control.putClientProperty(BINDING_CLIENT_PROPERTY_KEY, binding);
        return binding;
View Full Code Here

     */
    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

      context.put(NachoCalendarDateFieldBinder.SHOW_OK_CANCEL_KEY, Boolean.TRUE);
      context.put(NachoCalendarDateFieldBinder.SHOW_WEEKNUMBERS_KEY, Boolean.TRUE);
//      context.put(NachoCalendarDateFieldBinder.DATE_FORMAT, "MM'/'yyyy");
      context.put(NachoCalendarDateFieldBinder.WORKING_DAYS_KEY, new boolean[] {true, true, true, false, false, false, false});
      final SwingBindingFactory bf = (SwingBindingFactory) getBindingFactory();
      Binding b = bf.createBinding("birthday", context);
      builder.add(b);
//      builder.add("birthday");
      builder.row();
      ConfigurableFormModel formModel = getFormModel();
      ValueModel derivedValueModel = new MessageFormatValueModel("{0} {1} was born on {2}", new ValueModel[] {
View Full Code Here

TOP

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

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.