Package com.ledruide.druidegui.helpers

Examples of com.ledruide.druidegui.helpers.KeyValueBean


    private void addLanguages(JComboBox combo) {
        List liste = DruideCaveProps.getInstance().getListeSimple(DruideCaveProps.LANGUAGES);
        if (liste != null && liste.size() > 0) {
            for (int i = 0; i < liste.size(); i++) {
                Locale locale = new Locale((String) liste.get(i));
                combo.addItem(new KeyValueBean(locale.getLanguage(), locale.getDisplayLanguage(locale)));
            }
        }
        else {
            String[] langages = DruideGUII18n.DRUIDEGUI_LOCALES_AVAILABLE;
            for (int i = 0; i < langages.length; i++) {
                Locale locale = new Locale(langages[i]);
                combo.addItem(new KeyValueBean(locale.getLanguage(), locale.getDisplayLanguage(locale)));
            }
        }
    }
View Full Code Here


        CombosProxy.add(combo, list, false);
    }
    public static void add(JComboBox combo, List list, boolean blancEnPremier) throws Exception {
        // on va initialiser les pays
        if (blancEnPremier) {
            combo.addItem(new KeyValueBean("",""));
        }
        if (list != null) {
            for (int i = 0; i < list.size(); i++) {
                combo.addItem(list.get(i));
            }
View Full Code Here

            lavigne.setVigneron_id(recoltant_id);
            // on ne commit pas les donn�e maintenant....
            VignePeer.deleteSome(VignePeer.find(lavigne), false);

            while (regions.hasMoreElements()) {
                KeyValueBean countryRegion = (KeyValueBean) regions.nextElement();
                // kloug avoir une clef en 2 (pays,region) et l'extraire.
                String countryKey = CountryProxy.extract(countryRegion.getKey());
                String regionKey  = RegionProxy.extract(countryRegion.getKey());
                //Region region = RegionPeer.findByPK(countryRegion.getKey(),"");
                Vigne vigne = new Vigne();
                vigne.setVigneron_id(recoltant_id);
                vigne.setCountry_id(countryKey);
                vigne.setRegion_id(regionKey);
View Full Code Here

                        }
                    }
                }
                List vignes = VignePeer.find(vigne);
                if (vignes != null && vignes.size() > 0) {
                    results.add(new KeyValueBean(vigneron.getId(), vigneron.getLastname() + ", " + vigneron.getFirstname()));
                }
            }
        }
        catch (Exception e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
View Full Code Here

            Set keys = RegionProxy.getAllKeys(country);
            if (keys != null) {
                for (Object o : keys) {
                    String regionKey =  (String) o;
                    String regionLabel = RegionProxy.get(country, regionKey);
                    liste.addElement(new KeyValueBean(country + "." + regionKey, countryLabel + " : " + regionLabel));
                }
            }
        }
    }
View Full Code Here

            if (keys != null) {
                for (Object o : keys) {
                    String regionKey =  (String) o;
                    String regionLabel = RegionProxy.get(country, regionKey);
                    // Ici on concatene le pays devant le nom de la r�gion
                    KeyValueBean clefValeur = new KeyValueBean(country + "." + regionKey, countryLabel + " : " + regionLabel);
                    // Si cette clefValeur n'existe pas dans la liste de v�rification : on l'ajoute
                    if (listeVerif.contains(clefValeur) == false) {
                        listeDestination.addElement(clefValeur);
                    }
                }
View Full Code Here

                    Vigne vigne = (Vigne) liste.get(i);
                    // On r�cup�re la r�gion et le pays :
                    String countryLabel = CountryProxy.get(vigne.getCountry_id());
                    String regionLabel = RegionProxy.get(vigne.getCountry_id(), vigne.getRegion_id());
                    // Ici on concatene le pays devant le nom de la r�gion
                    modelRecoltant.addElement(new KeyValueBean(vigne.getCountry_id() + "." + vigne.getRegion_id(), countryLabel + " : " + regionLabel));
                }
                catch (Exception e) {
                    // On passe � la suivante
                    e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
                }
View Full Code Here

    public static List<KeyValueBean> getKeyValueList(String country) {
        Set keys = getAllKeys(country);
        List<KeyValueBean> kvbList = new ArrayList<KeyValueBean>(keys.size());
        for (Object o : keys) {
            String key = (String) o;
            kvbList.add(new KeyValueBean(key, RegionProxy.get(country, key)));
        }
        return kvbList;
    }
View Full Code Here

    public static List<KeyValueBean> getKeyValueList() {
        Set keys = getAllKeys();
        List<KeyValueBean> kvbList = new ArrayList<KeyValueBean>(keys.size());
        for (Object o : keys) {
            String key = (String) o;
            kvbList.add(new KeyValueBean(key, get(key)));
        }
        return kvbList;
    }
View Full Code Here

        }
        if (keys != null) {
            List<KeyValueBean> kvbList = new ArrayList<KeyValueBean>(keys.size());
            for (Object o : keys) {
                String key = (String) o;
                kvbList.add(new KeyValueBean(key, I18nLists.getInstance().get(I18nLists.CLASSIFICATION + country + I18nLists.SEP + region + I18nLists.SEP + denomination + I18nLists.SEP + key)));
            }
            return kvbList;
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of com.ledruide.druidegui.helpers.KeyValueBean

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.