Examples of LabelValue


Examples of es.uma.crudframework.model.LabelValue

        if (availableCountries == null) {
            final String EMPTY = "";
            final Locale[] available = Locale.getAvailableLocales();

            final List<LabelValue> countries = new ArrayList<LabelValue>();
            countries.add(new LabelValue("", ""));

            for (Locale anAvailable : available) {
                final String iso = anAvailable.getCountry();
                final String name = anAvailable.getDisplayCountry(locale);

                if (!EMPTY.equals(iso) && !EMPTY.equals(name)) {
                    final LabelValue country = new LabelValue(name, iso);

                    if (!countries.contains(country)) {
                        countries.add(new LabelValue(name, iso));
                    }
                }
            }

            Collections.sort(countries, new LabelValueComparator(locale));

            final Map<String, String> options = new LinkedHashMap<String, String>();
            // loop through and convert list to a JSF-Friendly Map for a
            // <select>
            for (Object country : countries) {
                final LabelValue option = (LabelValue) country;
                if (!options.containsValue(option.getValue())) {
                    options.put(option.getLabel(), option.getValue());
                }
            }
            this.availableCountries = options;
        }
View Full Code Here

Examples of es.uma.crudframework.model.LabelValue

         * @param o2
         *            The second LabelValue to compare.
         * @return The value returned by comparing the localized labels.
         */
        public final int compare(Object o1, Object o2) {
            final LabelValue lhs = (LabelValue) o1;
            final LabelValue rhs = (LabelValue) o2;

            return c.compare(lhs.getLabel(), rhs.getLabel());
        }
View Full Code Here

Examples of jmt.framework.data.LabelValue

    final JComboBox delimiters = new JComboBox(DELIMITERS);
    delimiters.setSelectedItem(LabelValue.getElement(DELIMITERS, stationData.getLoggingGlbParameter("delim")));
    delimiters.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        LabelValue element = (LabelValue) delimiters.getSelectedItem();
        if (!element.getValue().equals(stationData.getLoggingGlbParameter("decimalSeparator"))) {
          stationData.setLoggingGlbParameter("delim", element.getValue());
        } else {
          JOptionPane.showMessageDialog(MeasurePanel.this,
                "Delimiter and Decimal separator cannot be the same. Please make sure that they are different.",
                "Error", JOptionPane.ERROR_MESSAGE);
          delimiters.setSelectedItem(LabelValue.getElement(DELIMITERS, stationData.getLoggingGlbParameter("delim")));
        }
      }
    });
    label.setLabelFor(delimiters);
    logSettings.add(label);
    logSettings.add(delimiters);
    label = new JLabel("Decimal separator:");
    final JComboBox decimals = new JComboBox(DECIMAL);
    decimals.setSelectedItem(LabelValue.getElement(DECIMAL, stationData.getLoggingGlbParameter("decimalSeparator")));
    label.setLabelFor(decimals);
    decimals.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        LabelValue element = (LabelValue) decimals.getSelectedItem();
        if (!element.getValue().equals(stationData.getLoggingGlbParameter("delim"))) {
          stationData.setLoggingGlbParameter("decimalSeparator", element.getValue());
        } else {
          JOptionPane.showMessageDialog(MeasurePanel.this,
                "Delimiter and Decimal separator cannot be the same. Please make sure that they are different.",
                "Error", JOptionPane.ERROR_MESSAGE);
          decimals.setSelectedItem(LabelValue.getElement(DECIMAL, stationData.getLoggingGlbParameter("decimalSeparator")));
View Full Code Here

Examples of org.appfuse.model.LabelValue

        for (int i = 0; i < available.length; i++) {
            final String iso = available[i].getCountry();
            final String name = available[i].getDisplayCountry(locale);

            if (!EMPTY.equals(iso) && !EMPTY.equals(name)) {
                LabelValue country = new LabelValue(name, iso);

                if (!countries.contains(country)) {
                    countries.add(new LabelValue(name, iso));
                }
            }
        }

        Collections.sort(countries, new Comparator<LabelValue>() {
View Full Code Here

Examples of org.appfuse.model.LabelValue

                sb.append("    <option value=\"\" selected=\"selected\">");
                sb.append(eval.evalString("prompt", prompt)).append("</option>\n");
            }

            for (Object country1 : countries) {
                LabelValue country = (LabelValue) country1;
                sb.append("    <option value=\"").append(country.getValue()).append("\"");

                if ((selected != null) && selected.equals(country.getValue())) {
                    sb.append(" selected=\"selected\"");
                }

                sb.append(">").append(country.getLabel()).append("</option>\n");
            }

            sb.append("</select>");

            try {
View Full Code Here

Examples of org.appfuse.model.LabelValue

        for (Locale anAvailable : available) {
            final String iso = anAvailable.getCountry();
            final String name = anAvailable.getDisplayCountry(locale);

            if (!"".equals(iso) && !"".equals(name)) {
                LabelValue country = new LabelValue(name, iso);

                if (!countries.contains(country)) {
                    countries.add(new LabelValue(name, iso));
                }
            }
        }

        Collections.sort(countries, new LabelValueComparator(locale));
View Full Code Here

Examples of org.appfuse.model.LabelValue

         *
         * @return The value returned by comparing the localized labels.
         */
        @SuppressWarnings("unchecked")
        public final int compare(Object o1, Object o2) {
            LabelValue lhs = (LabelValue) o1;
            LabelValue rhs = (LabelValue) o2;

            return c.compare(lhs.getLabel(), rhs.getLabel());
        }
View Full Code Here

Examples of org.appfuse.model.LabelValue

        if (availableCountries == null) {
            final String EMPTY = "";
            final Locale[] available = Locale.getAvailableLocales();
   
            List<LabelValue> countries = new ArrayList<LabelValue>();
            countries.add(new LabelValue("",""));

            for (Locale anAvailable : available) {
                final String iso = anAvailable.getCountry();
                final String name = anAvailable.getDisplayCountry(locale);

                if (!EMPTY.equals(iso) && !EMPTY.equals(name)) {
                    LabelValue country = new LabelValue(name, iso);

                    if (!countries.contains(country)) {
                        countries.add(new LabelValue(name, iso));
                    }
                }
            }

            Collections.sort(countries, new LabelValueComparator(locale));
           
            Map<String, String> options = new LinkedHashMap<String, String>();
            // loop through and convert list to a JSF-Friendly Map for a <select>
            for (Object country : countries) {
                LabelValue option = (LabelValue) country;
                if (!options.containsValue(option.getValue())) {
                    options.put(option.getLabel(), option.getValue());
                }
            }
            this.availableCountries = options;
        }
View Full Code Here

Examples of org.appfuse.model.LabelValue

         * @param o2 The second LabelValue to compare.
         *
         * @return The value returned by comparing the localized labels.
         */
        public final int compare(Object o1, Object o2) {
            LabelValue lhs = (LabelValue) o1;
            LabelValue rhs = (LabelValue) o2;

            return c.compare(lhs.getLabel(), rhs.getLabel());
        }
View Full Code Here

Examples of org.appfuse.model.LabelValue

                sb.append("    <option value=\"\" selected=\"selected\">");
                sb.append(eval.evalString("prompt", prompt) + "</option>\n");
            }

            for (Iterator i = countries.iterator(); i.hasNext();) {
                LabelValue country = (LabelValue) i.next();
                sb.append("    <option value=\"" + country.getValue() + "\"");

                if ((selected != null) && selected.equals(country.getValue())) {
                    sb.append(" selected=\"selected\"");
                }

                sb.append(">" + country.getLabel() + "</option>\n");
            }

            sb.append("</select>");

            try {
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.