Package com.jgoodies.binding.beans

Examples of com.jgoodies.binding.beans.PropertyAdapter


    private void initGuideComponents(ValueModel triggerChannel)
    {
        // Guide selection mode group
        ValueModel gsmModel = new BufferedValueModel(
            new PropertyAdapter(userPrefs, UserPreferences.PROP_GUIDE_SELECTION_MODE),
            triggerChannel);

        rbGSMFirst = createRadioButton(gsmModel,
            UserPreferences.GSM_FIRST_FEED,
            Strings.message("userprefs.tab.guides.select.first.feed"));
        rbGSMLastSeen = createRadioButton(gsmModel,
            UserPreferences.GSM_LAST_SEEN_FEED,
            Strings.message("userprefs.tab.guides.select.last.seen.feed"));
        rbGSMNoFeed = createRadioButton(gsmModel,
            UserPreferences.GSM_NO_FEED,
            Strings.message("userprefs.tab.guides.select.no.feed"));

        // Publication
        chPing = createCheckBox(userPrefs,
            Strings.message("userprefs.tab.guides.ping.url"),
            UserPreferences.PROP_PING_ON_RL_PUBLICATION);
        chPing.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
                updatePingURLState();
            }
        });
        tfPingURL = new JTextField();
        tfPingURL.setDocument(new DocumentAdapter(new BufferedValueModel(
            new PropertyAdapter(userPrefs, UserPreferences.PROP_PING_ON_RL_PUBLICATION_URL),
            triggerChannel)));
        updatePingURLState();

        String ttPing = Strings.message("userprefs.tab.guides.ping.wording");
        chPing.setToolTipText(ttPing);
View Full Code Here


        chProxyEnabled = createCheckBox(userPrefs, Strings.message("userprefs.tab.advanced.use.proxy"),
            UserPreferences.PROP_PROXY_ENABLED);

        tfProxyHost = new JTextField();
        tfProxyHost.setDocument(new DocumentAdapter(new BufferedValueModel(
            new PropertyAdapter(userPrefs, UserPreferences.PROP_PROXY_HOST), triggerChannel)));

        lbProxyPort = ComponentsFactory.createLabel(Strings.message("userprefs.tab.advanced.use.proxy.port"));
        spinProxyPort = new JSpinner(new SpinnerModelAdapter(new BoundedRangeAdapter(
            new BufferedValueModel(new PropertyAdapter(userPrefs, UserPreferences.PROP_PROXY_PORT),
            triggerChannel), 80, 80, 65536)));
        spinProxyPort.setEditor(new JSpinner.NumberEditor(spinProxyPort, "#"));

        lbProxyExclusions = ComponentsFactory.createLabel(Strings.message("userprefs.tab.advanced.no.proxy.for"));
        tfProxyExclusions = new JTextField();
        tfProxyExclusions.setDocument(new DocumentAdapter(new BufferedValueModel(
            new PropertyAdapter(userPrefs, UserPreferences.PROP_PROXY_EXCLUSIONS), triggerChannel)));

        StateUpdatingToggleListener.install(chProxyEnabled, tfProxyHost, lbProxyPort, spinProxyPort,
            lbProxyExclusions, tfProxyExclusions);
    }
View Full Code Here

     * @return new JCheckbox.
     */
    private JCheckBox createCheckBox(Object obj, String label, String propertyName)
    {
        return ComponentsFactory.createCheckBox(label, new ToggleButtonAdapter(
            new BufferedValueModel(new PropertyAdapter(obj, propertyName), triggerChannel)));
    }
View Full Code Here

            chSortingEnabled = ComponentsFactory.createCheckBox(
                Strings.message("userprefs.tab.feeds.sort"), aPrefs, UserPreferences.PROP_SORTING_ENABLED, trigger);
            chSortingEnabled.addActionListener(new SortingEnabledListener());

            cbSortClass1 = new JComboBox(new SortClassesAdapter(new BufferedValueModel(
                new PropertyAdapter(aPrefs, UserPreferences.PROP_SORT_BY_CLASS_1), trigger)));
            cbSortClass2 = new JComboBox(new SortClassesAdapter(new BufferedValueModel(
                new PropertyAdapter(aPrefs, UserPreferences.PROP_SORT_BY_CLASS_2), trigger)));
            chReverseSort1 = ComponentsFactory.createCheckBox(
                Strings.message("userprefs.tab.feeds.sort.reverse.1"),
                aPrefs, UserPreferences.PROP_REVERSED_SORT_BY_CLASS_1, trigger);
            chReverseSort2 = ComponentsFactory.createCheckBox(
                Strings.message("userprefs.tab.feeds.sort.reverse.2"),
View Full Code Here

        super((String[])null);

        if (bean == null) throw new NullPointerException("Bean should be specified");
        if (propertyName == null) throw new NullPointerException("Property name should be specified");

        adapter = new PropertyAdapter(bean, propertyName);
    }
View Full Code Here

     */
    public static JCheckBox createCheckBox(String textWithMnemonic, Object bean, String propertyName,
                                           ValueModel trigger)
    {
        return createCheckBox(textWithMnemonic, new ToggleButtonAdapter(
            new BufferedValueModel(new PropertyAdapter(bean, propertyName), trigger)));
    }
View Full Code Here

     *
     * @param parent parent dialog.
     */
    private void initComponents(JDialog parent)
    {
        vmURL = new BufferedValueModel(new PropertyAdapter(proxy, TargetBlog.PROP_API_URL, true), trigger);
        vmUser = new BufferedValueModel(new PropertyAdapter(proxy, TargetBlog.PROP_USER, true), trigger);
        vmPass = new BufferedValueModel(new PropertyAdapter(proxy, TargetBlog.PROP_PASSWORD, true), trigger);

        tfTitle.setDocument(new DocumentAdapter(new PropertyAdapter(proxy, TargetBlog.PROP_TITLE, true)));
        tfURL.setDocument(new DocumentAdapter(vmURL));
        tfURLSummary.setDocument(new DocumentAdapter(new URLSummaryConverter(
            new PropertyAdapter(proxy, TargetBlog.PROP_API_URL, true))));
        tfURLSummary.setEditable(false);
        tfUser.setDocument(new DocumentAdapter(vmUser));
        tfPassword.setDocument(new DocumentAdapter(vmPass));

        taDescription = ComponentsFactory.createInstructionsArea("");

        loadCategoriesLookup();

        ValueModel mdlDefaultCategory = new PropertyAdapter(proxy, TargetBlog.PROP_DEFAULT_CATEGORY, true);
        ComboBoxAdapter adapter = new ComboBoxAdapter((ListModel)lmdlCategories, mdlDefaultCategory);
        cbDefaultCategory = new JComboBox(adapter);

        ValueModel mdlBlog = new PropertyAdapter(proxy, TargetBlog.PROP_BLOG, true);
        adapter = new ComboBoxAdapter((ListModel)lmdlBlogs, mdlBlog);
        cbBlog = new JComboBox(adapter);

        ValueModel mdlDraft = new PropertyAdapter(proxy, TargetBlog.PROP_DRAFT, true);
        rbPublic.setModel(new RadioButtonAdapter(mdlDraft, Boolean.FALSE));
        rbDraft.setModel(new RadioButtonAdapter(mdlDraft, Boolean.TRUE));

        Collection apis = WeblogAPIs.getWeblogAPIs();
        ValueModel mdlAPIs = new PropertyAdapter(proxy, TargetBlog.PROP_API_TYPE, true);
        vmAPI = new BufferedValueModel(mdlAPIs, trigger);
        adapter = new ComboBoxAdapter(apis.toArray(), vmAPI);
        cbWeblogAPIType = new JComboBox(adapter);
        vmAPI.addPropertyChangeListener(new WeblogTypeChangeListener());

        btnSetup = new JButton(new SetupAction(parent));
        btnFetchCategories = new JButton();
        actFetchCategories = new FetchCategoriesAction(); // It uses btnFetchCategories (hence the order)
        btnFetchCategories.setAction(actFetchCategories);
        btnFetchBlogs = new JButton();
        actFetchBlogs = new FetchBlogsAction(); // It uses btnFetchBlogs (hence the order)
        btnFetchBlogs.setAction(actFetchBlogs);

        // Templates
        Set<String> templateNames = Templates.getUserTemplates().keySet();
        lmTemplateNames = new ArrayListModel(templateNames);

        ValueModel mdlTemplates = new PropertyAdapter(proxy, TargetBlog.PROP_TEMPLATE_NAME, true);
        cbTemplate = new JComboBox(new ComboBoxAdapter((ListModel)lmTemplateNames, mdlTemplates));
        btnTemplateEditor = new JButton(new TemplateEditorAction());

        proxy.addPropertyChangeListener(TargetBlogProxy.PROP_BLOG_PREFERENCES, this);
        updateViewState();
View Full Code Here

    }

    private Component buildPostTextEditorOptionsPanel()
    {
        JLabel lbPostEditor = new JLabel(Strings.message("ptb.prefs.editor.label"));
        ValueModel orientMdl = new PropertyAdapter(new EditorModeFilter(), BloggingPreferences.PROP_RICH_EDITOR, true);
        JRadioButton rbRichEditor = BasicComponentFactory.createRadioButton(orientMdl, true,
                Strings.message("ptb.prefs.editor.rich"));
        rbRichEditor.setToolTipText(Strings.message("ptb.prefs.editor.rich.tt"));
        JRadioButton rbPlainEditor = BasicComponentFactory.createRadioButton(orientMdl, false,
                Strings.message("ptb.prefs.editor.plain"));
View Full Code Here

     * @return spinner.
     */
    private JSpinner createThresholdSpinner(String property)
    {
        SpinnerModelAdapter model = new SpinnerModelAdapter(new BoundedRangeAdapter(
                new BufferedValueModel(new PropertyAdapter(config, property), trigger), 0,-100, 100));
        model.setStepSize(1);
        return new JSpinner(model);
    }
View Full Code Here

     * @return area.
     */
    private JTextArea createExpressionsArea(String property)
    {
        JTextArea area = new JTextArea();
        area.setDocument(new DocumentAdapter(new BufferedValueModel(new PropertyAdapter(config, property), trigger)));
        return area;
    }
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.