Package org.jdesktop.beansbinding

Examples of org.jdesktop.beansbinding.BindingGroup


            SimpleDateFormat format = new SimpleDateFormat("EEEE");
            dayOfWeekComboBox.setRenderer(new DefaultListRenderer(
                    new FormatStringValue(format)));
            Converter<?, ?> days = new DayOfWeekConverter(calendar);
           
            BindingGroup group = new BindingGroup();
            group.addBinding(Bindings.createAutoBinding(READ,
                    selectionModes, BeanProperty.create("selectedItem"),
                    monthView, BeanProperty.create("selectionMode")));
           
            group.addBinding(Bindings.createAutoBinding(READ,
                    traversable, BeanProperty.create("selected"),
                    monthView, BeanProperty.create("traversable")));
           
            Binding dayOfWeek = Bindings.createAutoBinding(READ,
                    dayOfWeekComboBox, BeanProperty.create("selectedItem"),
                    monthView, BeanProperty.create("firstDayOfWeek"));
            dayOfWeek.setConverter(days);
            group.addBinding(dayOfWeek);
           
            Binding flagged = Bindings.createAutoBinding(READ,
                    flaggedDates, BeanProperty.create("date"),
                    this, BeanProperty.create("lastFlagged"));
            group.addBinding(flagged);
           
            Binding unselectable = Bindings.createAutoBinding(READ,
                    unselectableDates, BeanProperty.create("date"),
                    this, BeanProperty.create("lastUnselectable"));
            group.addBinding(unselectable);
           
            group.addBinding(Bindings.createAutoBinding(READ,
                    upperBound, BeanProperty.create("date"),
                    this, BeanProperty.create("upperBound")));

            group.addBinding(Bindings.createAutoBinding(READ,
                    lowerBound, BeanProperty.create("date"),
                    this, BeanProperty.create("lowerBound")));
           
            group.bind();
           
            // PENDING JW: removed the color selection stuff for now
            // future will be to use highlighters anyway - revisit then
        }
View Full Code Here


       
        DefaultListRenderer renderer = new DefaultListRenderer(DisplayValues.DISPLAY_INFO_DESCRIPTION);
        fontChooserCombo.setRenderer(renderer);
        backgroundChooserCombo.setRenderer(renderer);
       
        BindingGroup group = new BindingGroup();
        // <snip> JXTitledPanel configure title properties
        // edit title text
        group.addBinding(Bindings.createAutoBinding(UpdateStrategy.READ,
                titleField, BeanProperty.create("text"),
                titledPanel, BeanProperty.create("title")));
        // </snip>
        Binding fontBinding = Bindings.createAutoBinding(UpdateStrategy.READ,
                fontChooserCombo, BeanProperty.create("selectedItem"),
                titledPanel, BeanProperty.create("titleFont"));
        fontBinding.setConverter(new DisplayInfoConverter<Font>());
        group.addBinding(fontBinding);
       
        Binding backgroundBinding = Bindings.createAutoBinding(UpdateStrategy.READ,
                backgroundChooserCombo, BeanProperty.create("selectedItem"),
                titledPanel, BeanProperty.create("titlePainter"));
        backgroundBinding.setConverter(new DisplayInfoConverter<Painter>());
        group.addBinding(backgroundBinding);
       
        group.bind();
       
        updateUIProperties();
        installUIListener();
    }
View Full Code Here

       
        // <snip> Filter control
        // create the controller
        filterController = new OscarFiltering(oscarTable);
        // bind controller properties to input components
        BindingGroup filterGroup = new BindingGroup();
        filterGroup.addBinding(Bindings.createAutoBinding(READ,
                winnersCheckbox, BeanProperty.create("selected"),
                filterController, BeanProperty.create("showOnlyWinners")));
        filterGroup.addBinding(Bindings.createAutoBinding(READ,
                filterField, BeanProperty.create("text"),
                filterController, BeanProperty.create("filterString")));
        // PENDING JW: crude hack to update the statusbar - fake property
        // how-to do cleanly?
        filterGroup.addBinding(Bindings.createAutoBinding(READ,
                filterController, BeanProperty.create("showOnlyWinners"),
                this, BeanProperty.create("statusContent")));
        filterGroup.addBinding(Bindings.createAutoBinding(READ,
                filterController, BeanProperty.create("filterString"),
                this, BeanProperty.create("statusContent")));
        filterGroup.bind();
//        </snip>
        oscarModel.addTableModelListener(new TableModelListener() {
            public void tableChanged(TableModelEvent e) {
                updateStatusBar();
            }
View Full Code Here

        // display progress bar while data loads
        progressBar = new JProgressBar();
        statusBarLeft.add(progressBar);
        // bind the worker's progress notification to the progressBar
        // and the worker's state notification to this
        BindingGroup group = new BindingGroup();
        group.addBinding(Bindings.createAutoBinding(READ,
                loader, BeanProperty.create("progress"),
                progressBar, BeanProperty.create("value")));
        group.addBinding(Bindings.createAutoBinding(READ,
                loader, BeanProperty.create("state"),
                this, BeanProperty.create("loadState")));
        group.bind();
        loader.execute();
//        </snip>
    }
View Full Code Here

    private void bind() {
        monthViewDemoControl = new MonthViewDemoControl();
       
        // PENDING JW: re-visit distribution of binding control ...
        // this is quite arbitrary (time of coding ;-)
        BindingGroup group = new BindingGroup();
        group.bind();
       
    }
View Full Code Here

        private HashMap<String, ColorHighlighter> colorCellMarkers;
       
        public SearchControl() {
            DemoUtils.setSnippet("MatchingTextHighlighter", extendedMarkerBox, painterBox);
            initMatchMarkers();
            BindingGroup group = new BindingGroup();
            group.addBinding(Bindings.createAutoBinding(READ,
                    extendedMarkerBox, BeanProperty.create("selected"),
                    this, BeanProperty.create("extendedMarker")));
            group.addBinding(Bindings.createAutoBinding(READ,
                    painterBox, BeanProperty.create("selected"),
                    this, BeanProperty.create("animatedPainter")));
            group.addBinding(Bindings.createAutoBinding(READ,
                    this, BeanProperty.create("extendedMarker"),
                    painterBox, BeanProperty.create("enabled")));
            group.bind();
        }
View Full Code Here

                    DisplayValues.DISPLAY_INFO_DESCRIPTION));
            // </snip>
           
            DemoUtils.setSnippet("Custom CalendarHeaderHandler", customHeaderBox, zoomableBox);
           
            BindingGroup group = new BindingGroup();
           
            group.addBinding(Bindings.createAutoBinding(READ_WRITE,
                    calendarBox, BeanProperty.create("selected"),
                    this, BeanProperty.create("calendarVisible")));
           
            group.addBinding(Bindings.createAutoBinding(READ,
                    zoomableBox, BeanProperty.create("selected"),
                    monthView, BeanProperty.create("zoomable")));
           
            // <snip> Custom CalendarHeaderHandler
            // bind the combo box
            group.addBinding(Bindings.createAutoBinding(READ,
                    monthView, BeanProperty.create("zoomable"),
                    customHeaderBox, BeanProperty.create("enabled")
                    ));
            Binding handlerBinding = Bindings.createAutoBinding(READ,
                    customHeaderBox, BeanProperty.create("selectedItem"),
                    this, BeanProperty.create("calendarHeaderHandler"));
            handlerBinding.setConverter(new DisplayInfoConverter<CalendarHeaderHandler>());
            // </snip>
            group.addBinding(handlerBinding);
            group.bind();
        }
View Full Code Here

            list.addHighlighter(valueBasedHighlighter);
            tree.addHighlighter(valueBasedHighlighter);
           
            setSpreadColumns(false);
           
            BindingGroup group = new BindingGroup();
            group.addBinding(Bindings.createAutoBinding(READ,
                    extendedMarkerBox, BeanProperty.create("selected"),
                    this, BeanProperty.create("spreadColumns")));
            group.bind();
        }
View Full Code Here

    private void bind() {
        new MonthViewDemoControl();
       
        // PENDING JW: re-visit distribution of binding control ...
        // this is quite arbitrary (time of coding ;-)
        BindingGroup group = new BindingGroup();
        group.addBinding(Bindings.createAutoBinding(READ,
                leadingDaysBox, BeanProperty.create("selected"),
                monthView, BeanProperty.create("showingLeadingDays")));
        group.addBinding(Bindings.createAutoBinding(READ,
                trailingDaysBox, BeanProperty.create("selected"),
                monthView, BeanProperty.create("showingTrailingDays")));
       
        group.addBinding(Bindings.createAutoBinding(READ,
                weekNumberBox, BeanProperty.create("selected"),
                monthView, BeanProperty.create("showingWeekNumber")));

        group.addBinding(Bindings.createAutoBinding(READ,
                prefColumnSlider, BeanProperty.create("value"),
                monthView, BeanProperty.create("preferredColumnCount")));
       
        group.addBinding(Bindings.createAutoBinding(READ,
                prefRowSlider, BeanProperty.create("value"),
                monthView, BeanProperty.create("preferredRowCount")));
       
        group.bind();
       
    }
View Full Code Here

       
        // control combos
        comparatorCombo.setModel(createComparators());
        highlighterCombo.setModel(createRolloverHighlighters());
       
        BindingGroup group = new BindingGroup();
        group.addBinding(Bindings.createAutoBinding(READ,
                rolloverEnabledBox, BeanProperty.create("selected"),
                this, BeanProperty.create("rolloverEnabled")));
        Binding comparatorBinding = Bindings.createAutoBinding(READ,
                comparatorCombo, BeanProperty.create("selectedItem"),
                this, BeanProperty.create("comparator"));
        comparatorBinding.setConverter(new DisplayInfoConverter<Comparator<?>>());
        group.addBinding(comparatorBinding);
   
        Binding rolloverBinding = Bindings.createAutoBinding(READ,
                highlighterCombo, BeanProperty.create("selectedItem"),
                this, BeanProperty.create("rolloverHighlighter"));
        rolloverBinding.setConverter(new DisplayInfoConverter<Highlighter>());
        group.addBinding(rolloverBinding);
       
        group.bind();
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.beansbinding.BindingGroup

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.