Package com.jgoodies.binding.value

Examples of com.jgoodies.binding.value.ValueModel


                1)); // step

        List<LocomotiveType> locomotiveTypes = new ArrayList<LocomotiveType>(
                locomotivePersistence.getAllLocomotiveTypes());

        ValueModel locomotiveTypeModel = presentationModel
                .getModel(Locomotive.PROPERTYNAME_LOCOMOTIVE_TYPE);
        locomotiveTypeComboBox = BasicComponentFactory
                .createComboBox(new SelectionInList<LocomotiveType>(
                        locomotiveTypes, locomotiveTypeModel));
        locomotiveTypeComboBox.setSelectedIndex(0);
View Full Code Here


                "Inverted");

        List<TurnoutType> turnoutTypes = new ArrayList<TurnoutType>(
                turnoutPersistence.getAllTurnoutTypes());

        ValueModel turnoutTypeModel = presentationModel
                .getModel(Turnout.PROPERTYNAME_TURNOUT_TYPE);
        turnoutTypeComboBox = BasicComponentFactory
                .createComboBox(new SelectionInList<TurnoutType>(turnoutTypes,
                        turnoutTypeModel));
        turnoutTypeComboBox.setRenderer(new TurnoutTypeComboBoxCellRenderer());
        turnoutTypeComboBox
                .addActionListener(new TurnoutTypeSelectionListener());

        switch (presentationModel.getBean().getTurnoutType()
                .getTurnoutTypeEnum()) {
        case DEFAULT:
        case DOUBLECROSS:
            bus2TextField.setValue(0);
            bus2TextField.setEnabled(false);
            address2TextField.setValue(0);
            address2TextField.setEnabled(false);
            break;
        case THREEWAY:
            bus2TextField.setEnabled(true);
            address2TextField.setEnabled(true);
            break;
        }

        ValueModel defaultStateModel = presentationModel
                .getModel(Turnout.PROPERTYNAME_DEFAULT_STATE);
        turnoutDefaultStateComboBox = BasicComponentFactory
                .createComboBox(new SelectionInList<SRCPTurnoutState>(
                        new SRCPTurnoutState[] { SRCPTurnoutState.STRAIGHT,
                                SRCPTurnoutState.LEFT }, defaultStateModel));
        turnoutDefaultStateComboBox
                .setRenderer(new TurnoutDefaultStateComboBoxCellRenderer());

        ValueModel orientationModel = presentationModel
                .getModel(Turnout.PROPERTYNAME_ORIENTATION);
        turnoutOrientationComboBox = BasicComponentFactory
                .createComboBox(new SelectionInList<TurnoutOrientation>(
                        TurnoutOrientation.values(), orientationModel));
View Full Code Here

            GlobalModel.SINGLETON.getGlobalRenderingSettings();

        // Factory for valueModels corresponding to bean properties of GlobalRenderingSettings
        BeanAdapter globChannelRenderingAdapter = new BeanAdapter(feedRenderingSettings, true);

        ValueModel articleFilterModelHolder = globChannelRenderingAdapter.getValueModel("articleFilter");
        ValueModel articleViewModeHolder = GlobalModel.SINGLETON.getViewModeValueModel();

        ActionManager.register(CMD_ARTICLE_WHATIS,
            new ShowTipAction(TipOfTheDay.TIP_WHAT_IS_ARTICLE));
        ActionManager.register(CMD_ARTICLE_BROWSE, BrowseArticleAction.getInstance());
        ActionManager.register(CMD_ARTICLE_BROWSE_TB,
View Full Code Here

     */
    public SettingsDialog(Frame frame, SentimentsConfig config)
    {
        super(frame, Strings.message("sentiment.analysis"));

        ValueModel trigger = getTriggerChannel();
        advancedDialog = new AdvancedSettingsDialog(SettingsDialog.this, config, trigger);

        chEnabled = ComponentsFactory.createCheckBox(Strings.message("sentiment.analysis.enable"),
            config, SentimentsConfig.PROP_ENABLED, trigger);
        btnAdvanced = new JButton(new AdvancedAction());
View Full Code Here

        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

        setModal(false);

        // Only unread selector
        Preferences prefs = Application.getUserPreferences();
        ValueModel mdlOnlyUnread = new PreferencesAdapter(prefs, PROP_WH_UNREAD_ONLY, false);
        chOnlyUnread = ComponentsFactory.createCheckBox(Strings.message("whatshot.unreadonly"),
            new ToggleButtonAdapter(mdlOnlyUnread));

        // Time options
        ValueModel mdlTimeOption = new AbstractConverter(
            new PreferencesAdapter(prefs, PROP_WH_TIME_OPTION, TimeOption.THIS_WEEK.getCode()))
        {
            public Object convertFromSubject(Object o)
            {
                return TimeOption.fromCode((Integer)o);
            }

            public void setValue(Object o)
            {
                TimeOption to = (TimeOption)o;
                subject.setValue(to.getCode());
            }
        };
        cbTimeOptions = new JComboBox(new ComboBoxAdapter(TimeOption.OPTIONS, mdlTimeOption));

        // Starz selector
        ValueModel mdlStarz = new PreferencesAdapter(prefs, PROP_WH_STARZ, 1);
        starz = new StarsSelectionComponent(new BoundedRangeAdapter(mdlStarz, 0, 1, 5));

        // Make toolbar fonts smaller
        UifUtilities.smallerFont(chOnlyUnread);
        UifUtilities.smallerFont(cbTimeOptions);
View Full Code Here

                guides.add(fg);
                guidesMap.put(fg.key, fg);
            }

            ValueModel mdlGuides = new AbstractConverter(
                new PropertyAdapter(prefs, UserPreferences.PROP_WH_TARGET_GUIDE))
            {
                public Object convertFromSubject(Object o)
                {
                    return guidesMap.get(o);
View Full Code Here

            "articleViewMode", articleViewChangeHandler);

        // Set the sub-toolbar (right justified in the CoolInternalFrame)
        pageModel = new ValueHolder(0);
        pageModel.addValueChangeListener(new PageModelListener());
        ValueModel pageCountModel = new ValueHolder(0);
        subToolBar = createSubtoolbar();
        setHeaderControl(subToolBar);

        // Create the list that will contain the channels. Uses a custom
        // renderer.
View Full Code Here

TOP

Related Classes of com.jgoodies.binding.value.ValueModel

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.