Examples of BufferedValueModel


Examples of com.jgoodies.binding.value.BufferedValueModel

      if (masterDialog && useAsUniversal.equalsIgnoreCase("Ja")) {
        universalArticles.add(constructionTypeArticleMain);
      }

      BufferedValueModel bufferedArticles = presentationModel
          .getBufferedModel(ConstructionTypeModel.PROPERTY_CONSTRUCTION_TYPE_ARTICLES);
      bufferedArticles.setValue(new ArrayListModel(constructionType
          .getConstructionTypeArticles()));

    }
  }
View Full Code Here

Examples of com.jgoodies.binding.value.BufferedValueModel

          JOptionPane.PLAIN_MESSAGE, null,
          new Object[] { "Ja", "Nei" }, null);
    }
    if (selectedNode != null && selectedNode.isLeaf()) {

      BufferedValueModel bufferedArticles = presentationModel
          .getBufferedModel(ConstructionTypeModel.PROPERTY_CONSTRUCTION_TYPE_ARTICLES);

      ConstructionTypeArticleAttribute attribute = (ConstructionTypeArticleAttribute) selectedNode
          .getObject();

      String attributeValue;
      if (attribute.isYesNo()) {
        attributeValue = (String) JOptionPane.showInputDialog(window
            .getComponent(), "Gi ny verdi", "Endre verdi",
            JOptionPane.QUESTION_MESSAGE, null, new Object[] {
                "Ja", "Nei" }, attribute
                .getConstructionTypeArticleValue());
      } else if (attribute.getChoices() != null
          && attribute.getChoices().size() != 0) {

        attributeValue = (String) Util.showOptionsDialogCombo(window,
            attribute.getChoices(), "Endre verdi", true, attribute
                .getConstructionTypeArticleValue());

      } else {

        attributeValue = JOptionPane.showInputDialog(window
            .getComponent(), "Gi ny verdi", attribute
            .getConstructionTypeArticleValue());
      }

      if (attributeValue != null) {
        String orderValue = JOptionPane.showInputDialog(window
            .getComponent(), "Rekkef�lge", attribute
            .getDialogOrder());

        if (attributeValue.length() != 0) {
          attribute.setConstructionTypeArticleValue(attributeValue);
        }

        if (orderValue != null && orderValue.length() != 0) {
          attribute.setDialogOrder(Integer.valueOf(orderValue));
        } else {
          attribute.setDialogOrder(null);
        }
        if (masterDialog && useAsUniversal.equalsIgnoreCase("Ja")) {
          universalChangedArticleAttributes.add(attribute);
        }
        ConstructionType constructiontype = (ConstructionType) ((ConstructionTreeNode) constructionTreeTableModel
            .getRoot()).getObject();
        bufferedArticles.setValue(new ArrayListModel(constructiontype
            .getConstructionTypeArticles()));
      }
    } else if (selectedNode != null) {
      DecimalFormat decimalFormat = new DecimalFormat();
      decimalFormat.setDecimalSeparatorAlwaysShown(false);
      decimalFormat.setParseIntegerOnly(true);
      BufferedValueModel bufferedArticles = presentationModel
          .getBufferedModel(ConstructionTypeModel.PROPERTY_CONSTRUCTION_TYPE_ARTICLES);

      ConstructionTypeArticle article = (ConstructionTypeArticle) selectedNode
          .getObject();

      String numberOfValue = null;

      if (article.getNumberOfItems() != null) {
        numberOfValue = decimalFormat
            .format(article.getNumberOfItems());
      }

      numberOfValue = JOptionPane.showInputDialog(window.getComponent(),
          "Gi antall", numberOfValue);

      String orderValue = JOptionPane.showInputDialog(window
          .getComponent(), "Rekkef�lge", article.getDialogOrder());

      if (numberOfValue != null && numberOfValue.length() != 0) {
        article.setNumberOfItems(Integer.valueOf(numberOfValue.replace(
            ',', '.')));

      }
      if (orderValue != null) {
        if (orderValue.length() != 0) {
          article.setDialogOrder(Integer.valueOf(orderValue));
        } else {
          article.setDialogOrder(null);
        }
      }
      if (masterDialog && useAsUniversal.equalsIgnoreCase("Ja")) {
        universalChangedArticles.add(article);
      }

      ConstructionType constructiontype = (ConstructionType) ((ConstructionTreeNode) constructionTreeTableModel
          .getRoot()).getObject();
      bufferedArticles.setValue(new ArrayListModel(constructiontype
          .getConstructionTypeArticles()));
    }
  }
View Full Code Here

Examples of com.jgoodies.binding.value.BufferedValueModel

          constructionType.setConstructionTypeArticles(set);
        }
      }
      constructionTreeTableModel.fireChanged();

      BufferedValueModel bufferedArticles = presentationModel
          .getBufferedModel(ConstructionTypeModel.PROPERTY_CONSTRUCTION_TYPE_ARTICLES);
      bufferedArticles.setValue(new ArrayListModel(constructionType
          .getConstructionTypeArticles()));

      Set<ConstructionTypeAttribute> attributes = ConstructionTypeModel
          .copyConstructionTypeAttributes(currentConstructionType,
              master.getConstructionTypeAttributes());
View Full Code Here

Examples of com.jgoodies.binding.value.BufferedValueModel

     */
    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

Examples of com.jgoodies.binding.value.BufferedValueModel

     *
     * @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));
View Full Code Here

Examples of com.jgoodies.binding.value.BufferedValueModel

     * @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

Examples of com.jgoodies.binding.value.BufferedValueModel

     * @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

Examples of com.jgoodies.binding.value.BufferedValueModel

     *
     * @return combo-box.
     */
    private JComboBox createColorComboBox(String property, ValueModel trigger)
    {
        JComboBox box = new JComboBox(new ColorAdapter(new BufferedValueModel(
                        new PropertyAdapter(config, property), trigger)));
        box.setRenderer(colorListCellRenderer);
        return box;
    }
View Full Code Here

Examples of com.jgoodies.binding.value.BufferedValueModel

        {
            super(Dialog.this, Strings.message("whatshot.dialog.title") + " - " + Strings.message("whatshot.setup"));

            taIgnorePatterns = new JTextArea();
            taIgnorePatterns.setLineWrap(false);
            taIgnorePatterns.setDocument(new DocumentAdapter(new BufferedValueModel(new PropertyAdapter(
                prefs, UserPreferences.PROP_WH_IGNORE), getTriggerChannel())));

            chDontCountSelfLinks = ComponentsFactory.createCheckBox(
                Strings.message("whatshot.setup.no.self.links"),
                prefs, UserPreferences.PROP_WH_NOSELFLINKS, getTriggerChannel());
View Full Code Here

Examples of com.jgoodies.binding.value.BufferedValueModel

        Component tfWording = ComponentsFactory.createWrappedMultilineLabel(
            Strings.message("userprefs.tab.twitter.wording"));

        JCheckBox chEnabled = ComponentsFactory.createCheckBox(
            Strings.message("userprefs.tab.twitter.enable"),
            new ToggleButtonAdapter(new BufferedValueModel(
                new PropertyAdapter(prefs, TwitterPreferences.PROP_ENABLED),
                trigger)));

        JCheckBox chProfilePics = ComponentsFactory.createCheckBox(
            Strings.message("userprefs.tab.twitter.profile.pics"),
            new ToggleButtonAdapter(new BufferedValueModel(
                new PropertyAdapter(prefs, TwitterPreferences.PROP_PROFILE_PICS),
                trigger)));

        JCheckBox chPasteLink = ComponentsFactory.createCheckBox(
            Strings.message("userprefs.tab.twitter.paste.link"),
            new ToggleButtonAdapter(new BufferedValueModel(
                new PropertyAdapter(prefs, TwitterPreferences.PROP_PASTE_LINK),
                trigger)));

        JLabel lbScreenName = new JLabel(Strings.message("userprefs.tab.twitter.screenname"));
        JLabel lbPassword   = new JLabel(Strings.message("userprefs.tab.twitter.password"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.