Package org.springframework.richclient.form.builder

Examples of org.springframework.richclient.form.builder.TableFormBuilder


                        "locationDetails", valueHolder, masterList) {

                    @Override
                    protected void addTabs() {
                        TimeFinderPlannerBindingFactory factory = (TimeFinderPlannerBindingFactory) getBindingFactory();
                        TableFormBuilder fBuilder = createTab(getMessage("features.label"));

                        final Dao<Feature> featureDao = pool.getDao(Feature.class);
                        final ValueHolder featureHolder = new ValueHolder(new ArrayList<Feature>(featureDao.getAll()));
                        ShuttleList sl = (ShuttleList) fBuilder.add(
                                factory.createBoundShuttleList("features", featureHolder, null))[1];
                        sl.setVisibleRowCount(10);

                        featureDao.addListener(new PropertyChangeListener() {

                            @Override
                            public void propertyChange(PropertyChangeEvent evt) {
                                if (Dao.ATTACH.equals(evt.getPropertyName())
                                        || Dao.ATTACH_ALL.equals(evt.getPropertyName())
                                        || Dao.DETACH.equals(evt.getPropertyName())
                                        || Dao.DETACH_ALL.equals(evt.getPropertyName())) {
                                    featureHolder.setValue(new ArrayList<Feature>(featureDao.getAll()));
                                }
                            }
                        });

                        TableFormBuilder builder = createTab(getMessage("planner"));
                        planner = (TimeFinderPlanner) builder.add(
                                factory.createBoundPlanner("events", settings))[1];
                    }
                };
                objForm.setDao(dao);
View Full Code Here


        super(parentFormModel, formId, valueHolder, masterList);
    }

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

        nameEditor = formBuilder.add("name")[1];
        formBuilder.row();
       
        formBuilder.add("capacity");
               
        return super.createFormControl();
    }
View Full Code Here

                        "dualeventsDetails", valueHolder, masterList) {

                    @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

                    @Override
                    protected void addTabs() {
                        TimeFinderPlannerBindingFactory factory = (TimeFinderPlannerBindingFactory) getBindingFactory();
                        // warning: the methods person.set + getEvents is necessary!
                        TableFormBuilder builder = createTab(getMessage("events.label"));

                        final Dao<Event> eventDao = pool.getDao(Event.class);
                        final ValueHolder eventsHolder = new ValueHolder(
                                new ArrayList<Event>(eventDao.getAll()));

                        // TODO SPRING RC the problem of "name" instead null is that duplicate names will be removed!!!
                        ShuttleList sl = (ShuttleList) builder.add(factory.createBoundShuttleList("events", eventsHolder, null))[1];
                        sl.setVisibleRowCount(10);

                        eventDao.addListener(new PropertyChangeListener() {

                            @Override
                            public void propertyChange(PropertyChangeEvent evt) {
                                if (Dao.ATTACH.equals(evt.getPropertyName())
                                        || Dao.ATTACH_ALL.equals(evt.getPropertyName())
                                        || Dao.DETACH.equals(evt.getPropertyName())
                                        || Dao.DETACH_ALL.equals(evt.getPropertyName())) {
                                    eventsHolder.setValue(new ArrayList<Event>(eventDao.getAll()));
                                }
                            }
                        });

                        builder = createTab(getMessage("planner"));
                        planner = (TimeFinderPlanner) builder.add(
                                factory.createBoundPlanner("events", settings))[1];
                    }
                };
                objForm.setDao(dao);
View Full Code Here

    }

    @Override
    protected JComponent createFormControl() {
        SwingBindingFactory factory = (SwingBindingFactory) getBindingFactory();
        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();

        formBuilder.addTextArea("description");
        formBuilder.row();

//        addFormValueChangeListener("start", new PropertyChangeListener() {
//
//            @Override
//            public void propertyChange(PropertyChangeEvent evt) {
View Full Code Here

                        SwingBindingFactory factory = (SwingBindingFactory) getBindingFactory();

                        getFormBuilder().add(factory.createBoundComboBox(
                                "location", pool.getDao(Location.class).getAll(), "name"));

                        TableFormBuilder builder = createTab(getMessage("persons.label"));

                        final Dao<Person> personDao = pool.getDao(Person.class);

                        /****************************************************************
                         * WARNING: it is important to wrap the (person) collection in
                         * another one (here ArrayList). Otherwise the changes
                         * to the dao will have direct effect to the value in ValueHolder
                         * and newValue.equals(oldValue) == true for every change!
                         ****************************************************************/
                        final ValueHolder personHolder = new ValueHolder(new ArrayList<Person>(personDao.getAll()));
                        //1. persons => Event.set and getPersons are necessary
                        //2. personDao.getAll() => all available persons
                        //3. name => prints the name as one list item
                        ShuttleList sl = (ShuttleList) builder.add(
                                factory.createBoundShuttleList("persons",
                                personHolder, "name"))[1];
                        sl.setVisibleRowCount(10);

                        TableFormBuilder fBuilder = createTab(getMessage("features.label"));
                        final Dao<Feature> featureDao = pool.getDao(Feature.class);
                        final ValueHolder featureHolder = new ValueHolder(new ArrayList<Feature>(featureDao.getAll()));
                        sl = (ShuttleList) fBuilder.add(factory.createBoundShuttleList("features",
                                featureHolder, null))[1];
                        sl.setVisibleRowCount(10);

                        // now notify ShuttleList when collection change to update the JList
                        personDao.addListener(new PropertyChangeListener() {
View Full Code Here

        super(parentFormModel, formId, valueHolder, masterList);
    }

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

        nameEditor = formBuilder.add("name")[1];
       
        return super.createFormControl();
    }
View Full Code Here

//        subForm.newSimpleValidationResultsReporter(getFormModel().getValidationResults(), messageReceiver );
//        return l;
//    }   
    public TableFormBuilder getFormBuilder() {
        if (propertiesFB == null) {
            propertiesFB = new TableFormBuilder(getBindingFactory());
            propertiesFB.setLabelAttributes("colGrId=label colSpec=right:pref");
        }
        return propertiesFB;
    }
View Full Code Here

        return mainPanel;
    }

    protected TableFormBuilder createTab(String str) {
        TableFormBuilder formBuilder = new TableFormBuilder(getBindingFactory());
        formBuilder.setLabelAttributes("colGrId=label colSpec=right:pref");
        allTabs.put(str, formBuilder);

        return formBuilder;
    }
View Full Code Here

        super(parentFormModel, formId, valueHolder, masterList);
    }

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

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

        formBuilder.add("birthDay", "colSpan=1 align=left");
        formBuilder.row();

        formBuilder.add("street");
        formBuilder.add("streetNumber");
        formBuilder.row();

        formBuilder.add("zip");
        formBuilder.add("city");
        formBuilder.row();

        formBuilder.add("telephon", "colSpan=1 align=left");

        return super.createFormControl();
    }
View Full Code Here

TOP

Related Classes of org.springframework.richclient.form.builder.TableFormBuilder

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.