Package com.jgoodies.binding.beans

Examples of com.jgoodies.binding.beans.PropertyAdapter


    {
        initRadioButtons(bbsAllowed, triggerChannel);

        tfDeliciousUser = new JTextField();
        tfDeliciousUser.setDocument(new DocumentAdapter(new BufferedValueModel(
            new PropertyAdapter(this.userPrefs, UserPreferences.PROP_TAGS_DELICIOUS_USER),
            triggerChannel)));

        tfDeliciousPassword = new JPasswordField();
        tfDeliciousPassword.setDocument(new DocumentAdapter(new BufferedValueModel(
            new PropertyAdapter(this.userPrefs, UserPreferences.PROP_TAGS_DELICIOUS_PASSWORD),
            triggerChannel)));

        ValueModel autoFetchModel = new BufferedValueModel(
            new PropertyAdapter(userPrefs, UserPreferences.PROP_TAGS_AUTOFETCH),
            triggerChannel);

        chAutoFetch = ComponentsFactory.createCheckBox(
            Strings.message("userprefs.tab.tags.autofetch"),
            new ToggleButtonAdapter(autoFetchModel));

        lbBBSWording = ComponentsFactory.createWrappedMultilineLabel(
            Strings.message("userprefs.tab.tags.wording.bbservice"));

        lbDIUWording = ComponentsFactory.createWrappedMultilineLabel(
            Strings.message("userprefs.tab.tags.wording.delicious"));

        chPinTagging = ComponentsFactory.createCheckBox(
            "Tag pins with",
            new ToggleButtonAdapter(new BufferedValueModel(
                new PropertyAdapter(userPrefs, UserPreferences.PROP_PIN_TAGGING),
                triggerChannel)));

        tfPinTags = new JTextField();
        tfPinTags.setDocument(new DocumentAdapter(new BufferedValueModel(
            new PropertyAdapter(userPrefs, UserPreferences.PROP_PIN_TAGS),
            triggerChannel)));
    }
View Full Code Here


     * @param triggerChannel    changes commit trigger channel.
     */
    private void initRadioButtons(boolean bbsAllowed, ValueModel triggerChannel)
    {
        ValueModel storageModel = new BufferedValueModel(
            new PropertyAdapter(userPrefs, UserPreferences.PROP_TAGS_STORAGE), triggerChannel);
        storageModel.addValueChangeListener(new StorageTypeListener());

        rbStorageNone = ComponentsFactory.createRadioButton(
            Strings.message("userprefs.tab.tags.dont.share"));
        rbStorageNone.setModel(new RadioButtonAdapter(storageModel,
View Full Code Here

        }

        private Component buildBriefModePanel(UserPreferences prefs, ValueModel trigger)
        {
            SpinnerModelAdapter mdlSentences = new SpinnerModelAdapter(new BoundedRangeAdapter(
                new BufferedValueModel(new PropertyAdapter(prefs, UserPreferences.PROP_BRIEF_SENTENCES),
                    trigger), 0, 1, 10));
            JSpinner spSentences = new JSpinner(mdlSentences);

            SpinnerModelAdapter mdlMaxLength = new SpinnerModelAdapter(new BoundedRangeAdapter(
                new BufferedValueModel(new PropertyAdapter(prefs, UserPreferences.PROP_BRIEF_MAX_LENGTH),
                    trigger), 0, 100, 1000));
            mdlMaxLength.setStepSize(100);
            JSpinner spMaxLength = new JSpinner(mdlMaxLength);

            BBFormBuilder builder = new BBFormBuilder("p, 4dlu, 25dlu, 4dlu, p, 4dlu, 35dlu, 4dlu, p");
View Full Code Here

        }

        private Component buildPaginationPanel(UserPreferences prefs, ValueModel trigger)
        {
            SpinnerModelAdapter mdlPageSize = new SpinnerModelAdapter(new BoundedRangeAdapter(
                new BufferedValueModel(new PropertyAdapter(prefs, UserPreferences.PROP_PAGE_SIZE),
                    trigger), 0, 10, 200));
            JSpinner spPageSize = new JSpinner(mdlPageSize);
            SpinnerNumberModel model = (SpinnerNumberModel)spPageSize.getModel();
            model.setStepSize(10);
View Full Code Here

                for (int j = 0; j < modes.length; j++)
                {
                    ViewModePreferences.ViewModeBean mode = modes[j];

                    ButtonModel model = new ToggleButtonAdapter(new BufferedValueModel(
                        new PropertyAdapter(mode, property), trigger));
                    checks[i][j] = ComponentsFactory.createCheckBox(null, model);
                }
            }

            return checks;
View Full Code Here

        ValueModel triggerChannel)
    {
        chReadOnChanChange = ComponentsFactory.createCheckBox(
            Strings.message("userprefs.tab.general.when.changing.feeds.mark.all.articles.read"),
            new ToggleButtonAdapter(
                new BufferedValueModel(new PropertyAdapter(settings,
                    UserPreferences.PROP_MARK_READ_WHEN_CHANGING_CHANNELS), triggerChannel)));

        chReadOnGuideChange = ComponentsFactory.createCheckBox(
            Strings.message("userprefs.tab.general.when.changing.guides.mark.all.articles.read"),
            new ToggleButtonAdapter(
                new BufferedValueModel(new PropertyAdapter(settings,
                    UserPreferences.PROP_MARK_READ_WHEN_CHANGING_GUIDES), triggerChannel)));

        chReadOnDelay = ComponentsFactory.createCheckBox(
            Strings.message("userprefs.tab.general.mark.article.as.read.on.delay"),
            new ToggleButtonAdapter(
                new BufferedValueModel(new PropertyAdapter(settings,
                    UserPreferences.PROP_MARK_READ_AFTER_DELAY), triggerChannel)));

        tfReadOnDelaySeconds = new JTextField();
        tfReadOnDelaySeconds.setDocument(new DocumentAdapter(new BufferedValueModel(
            new PropertyAdapter(settings, "markReadAfterSecondsString"), triggerChannel)));

        configurePurgeControls(settings, triggerChannel);

        rssPollInterval = new JTextField();
        rssPollInterval.setDocument(new DocumentAdapter(new BufferedValueModel(
            new PropertyAdapter(settings, "rssPollIntervalString"), triggerChannel)));

        cbTheme = new JComboBox();
        ValueModel valueModel = new BufferedValueModel(
            new PropertyAdapter(frs, RenderingSettingsNames.THEME), triggerChannel);
        cbTheme.setModel(new ThemeListModel(valueModel));

        cbFontFamilies = new JComboBox();
        final BufferedValueModel vmMainFont = new BufferedValueModel(
            new MainFontFamilyValueModel(frs), triggerChannel);
        cbFontFamilies.setModel(new FontFamiliesListModel(vmMainFont));

        valueModel.addValueChangeListener(new PropertyChangeListener()
        {
            public void propertyChange(PropertyChangeEvent evt)
            {
                Theme theme = (Theme)evt.getNewValue();
                Font newFont = theme.getMainFontDirect();
                vmMainFont.setValue(newFont.getFamily());
            }
        });

        chShowToolbar = ComponentsFactory.createCheckBox(
            Strings.message("userprefs.tab.general.show.toolbar"),
            new ToggleButtonAdapter(new BufferedValueModel(new PropertyAdapter(settings,
                UserPreferences.PROP_SHOW_TOOLBAR), triggerChannel)));
        chShowToolbarLabels = ComponentsFactory.createCheckBox(
            Strings.message("userprefs.tab.general.show.toolbar.labels"),
            new ToggleButtonAdapter(new BufferedValueModel(new PropertyAdapter(settings,
            UserPreferences.PROP_SHOW_TOOLBAR_LABELS), triggerChannel)));

        chShowToolbar.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
View Full Code Here

     * @param settings          settings.
     * @param triggerChannel    trigger.
     */
    private void configurePurgeControls(UserPreferences settings, ValueModel triggerChannel)
    {
        PropertyAdapter propCheck, propCount;
        propCheck = new PropertyAdapter(settings, UserPreferences.PROP_PRESERVE_UNREAD);
        propCount = new PropertyAdapter(settings, "purgeCountString");

        BufferedValueModel modelCheck = null, modelCount;

        // The order of initialization dictates the order of events upon change.
        // We need checkbox event to be fired before the count when it wasn't selected initially,
View Full Code Here

        tfSyncPeriod.setEnabled(false);

        chFeedList = ComponentsFactory.createCheckBox(
            Strings.message("service.sync.feed.list"),
            new ToggleButtonAdapter(new BufferedValueModel(new PropertyAdapter(servicePrefs,
                ServicePreferences.PROP_SYNC_FEEDS), triggerChannel)));
        chFeedList.addActionListener(new FullSyncEnabled());

        chPreferences = ComponentsFactory.createCheckBox(
            Strings.message("service.sync.preferences"),
            new ToggleButtonAdapter(new BufferedValueModel(new PropertyAdapter(servicePrefs,
                ServicePreferences.PROP_SYNC_PREFERENCES), triggerChannel)));

        new MandatoryCheckBoxController(chFeedList, chPreferences);
       
        tfEmail.setDocument(new DocumentAdapter(new BufferedValueModel(
                new PropertyAdapter(servicePrefs, "email"), triggerChannel)));

        tfPassword.setDocument(new DocumentAdapter(new BufferedValueModel(
                new PropertyAdapter(servicePrefs, "password"), triggerChannel)));

        tfSyncPeriod.setDocument(new DocumentAdapter(new BufferedValueModel(
                new PropertyAdapter(new ServicePreferencesWrapper(servicePrefs), "syncPeriod"),
                triggerChannel)));

        updateFullSyncButton();
        updateSyncDatesView();
        selectMode();
View Full Code Here

        g1.add(rbUpdatePeriodically);

        setUpdatePeriodState();

        PeriodMonitor monitor = new PeriodMonitor(new BufferedValueModel(
            new PropertyAdapter(prefs, UserPreferences.PROP_READING_LIST_UPDATE_PERIOD),
            triggerChannel));

        rbUpdateManually.addChangeListener(monitor);
        rbUpdatePeriodically.addChangeListener(monitor);
        cbUpdatePeriod.addItemListener(monitor);

        ValueModel updatesModel = new BufferedValueModel(
            new PropertyAdapter(prefs, UserPreferences.PROP_ON_READING_LIST_UPDATE_ACTIONS),
            triggerChannel);

        // Applying changes
        rbChangeSilently = ComponentsFactory.createRadioButton(
            Strings.message("userprefs.tab.readinglists.action.accept.silently"),
            new RadioButtonAdapter(updatesModel,
            new Integer(UserPreferences.RL_UPDATE_NONE)));
        rbChangeWithNotification = ComponentsFactory.createRadioButton(
            Strings.message("userprefs.tab.readinglists.action.notify"),
            new RadioButtonAdapter(updatesModel,
            new Integer(UserPreferences.RL_UPDATE_NOTIFY)));
        rbChangeWithConfirmation = ComponentsFactory.createRadioButton(
            Strings.message("userprefs.tab.readinglists.action.confirm"),
            new RadioButtonAdapter(updatesModel,
            new Integer(UserPreferences.RL_UPDATE_CONFIRM)));

        // Get Latest command actions
        chUpdateFeeds = ComponentsFactory.createCheckBox(
            Strings.message("userprefs.tab.readinglists.command.latest.articles"),
            new ToggleButtonAdapter(new BufferedValueModel(new PropertyAdapter(prefs,
                UserPreferences.PROP_UPDATE_FEEDS), triggerChannel)));
        chUpdateReadingLists = ComponentsFactory.createCheckBox(
            Strings.message("userprefs.tab.readinglists.command.lists.changes"),
            new ToggleButtonAdapter(new BufferedValueModel(new PropertyAdapter(prefs,
                UserPreferences.PROP_UPDATE_READING_LISTS), triggerChannel)));

        new MandatoryCheckBoxController(chUpdateFeeds, chUpdateReadingLists);
    }
View Full Code Here

        String msg = Strings.message("userprefs.tab.general.check.for.new.versions");
        if (ApplicationLauncher.isAutoUpdatesEnabled())
        {
            chDoUpdatesCheck = ComponentsFactory.createCheckBox(
                msg, new ToggleButtonAdapter(new BufferedValueModel(new PropertyAdapter(userPrefs,
                    UserPreferences.PROP_CHECKING_FOR_UPDATES_ON_STARTUP),
                    triggerChannel)));
        } else
        {
            msg = msg.replaceAll("&", "");
            chDoUpdatesCheck = new JCheckBox(msg);
            chDoUpdatesCheck.setSelected(true);
            chDoUpdatesCheck.setEnabled(false);
        }

        chAlwaysUseEnglish = ComponentsFactory.createCheckBox(
            Strings.message("userprefs.tab.advanced.always.use.english"),
            new ToggleButtonAdapter(new BufferedValueModel(new PropertyAdapter(userPrefs,
                UserPreferences.PROP_ALWAYS_USE_ENGLISH),
                triggerChannel)));
       
        tfInternetBrowser = new JTextField();
        tfInternetBrowser.setDocument(new DocumentAdapter(new BufferedValueModel(
            new PropertyAdapter(userPrefs, UserPreferences.PROP_INTERNET_BROWSER),
            triggerChannel)));

        if (BrowserLauncher.isUsingJWSBrowser())
        {
            tfInternetBrowser.setEnabled(false);
            tfInternetBrowser.setToolTipText(Strings.message("userprefs.tab.advanced.browser.tooltip.disabled"));
        } else
        {
            tfInternetBrowser.setEnabled(true);
            tfInternetBrowser.setToolTipText(Strings.message("userprefs.tab.advanced.browser.tooltip.enabled"));
        }

        initProxyComponents(triggerChannel);

        SpinnerModelAdapter spinModelFeedSelectionDelay = new SpinnerModelAdapter(
            new BoundedRangeAdapter(new BufferedValueModel(new PropertyAdapter(userPrefs,
                UserPreferences.PROP_FEED_SELECTION_DELAY), triggerChannel), 0, 0, 1000));
        spinModelFeedSelectionDelay.setStepSize(100);

        chAAText = createCheckBox(userPrefs, Strings.message("userprefs.tab.advanced.antialiased.fonts"),
            UserPreferences.PROP_AA_TEXT);

        // The following code registers listener on Apply/Accept actions to track down
        // changes in BlogStarz limits. If changes are detected then channel list is
        // repainted.

        saveInitialLimits();
        triggerChannel.addValueChangeListener(new PropertyChangeListener()
        {
            public void propertyChange(PropertyChangeEvent evt)
            {
                if (Boolean.TRUE.equals(evt.getNewValue())) doRepaintChannelList();
            }
        });

        chShowUnreadButtonMenu = createCheckBox(userPrefs,
            Strings.message("userprefs.tab.advanced.show.the.unread.buttons.menu"),
            UserPreferences.PROP_SHOW_UNREAD_BUTTON_MENU);

        SpinnerModelAdapter spinModelFeedImportLimit =
            new SpinnerModelAdapter(new BoundedRangeAdapter(
                new BufferedValueModel(new PropertyAdapter(userPrefs,
                    UserPreferences.PROP_FEED_IMPORT_LIMIT),
                    triggerChannel), 1, 1, UserPreferences.MAX_FEED_IMPORT_LIMITATION));
        spinModelFeedImportLimit.setStepSize(100);
        spinFeedImportLimit = new JSpinner(spinModelFeedImportLimit);

        initGuideComponents(triggerChannel);

        chHideOldArticles = createCheckBox(feedRS,
            Strings.message("userprefs.tab.articles.hide.articles.older.than"), "suppressingOlderThan");
        chDisplayFullTitles = createCheckBox(feedRS,
            Strings.message("userprefs.tab.articles.display.full.titles"), "displayingFullTitles");
        chSortingAscending = createCheckBox(feedRS,
            Strings.message("userprefs.tab.articles.sort.earlier.articles.first"), "sortingAscending");

        tfSuppressOlderThan = new JTextField();
        tfSuppressOlderThan.setDocument(new DocumentAdapter(new BufferedValueModel(
            new PropertyAdapter(feedRS, "suppressOlderThanString"), triggerChannel)));

        chCopyLinksInHREFFormat = createCheckBox(userPrefs,
            Strings.message("userprefs.tab.articles.use.href.format.for.links.copied.to.clipboard"),
            UserPreferences.PROP_COPY_LINKS_IN_HREF_FORMAT);
        chBrowseOnTitleDblClick = createCheckBox(userPrefs,
            Strings.message("userprefs.tab.articles.browse.on.double.click.over.the.title"),
            UserPreferences.PROP_BROWSE_ON_DBL_CLICK);

        chShowAppIconInSystray = createCheckBox(userPrefs,
            Strings.message("userprefs.tab.advanced.show.appicon.in.systray"),
            UserPreferences.PROP_SHOW_APPICON_IN_SYSTRAY);
        chMinimizeToSystray = createCheckBox(userPrefs,
            Strings.message("userprefs.tab.advanced.minimize.to.systray"),
            UserPreferences.PROP_MINIMIZE_TO_SYSTRAY);

        // Dock icon
        ValueModel modeModel = new BufferedValueModel(
            new BIDModeToStringConverter(new PropertyAdapter(userPrefs, UserPreferences.PROP_DIB_MODE)),
            triggerChannel);

        cbBIDMode = new JComboBox(new ComboBoxAdapter(BIDModeToStringConverter.MODES, modeModel));
    }
View Full Code Here

TOP

Related Classes of com.jgoodies.binding.beans.PropertyAdapter

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.