예제 #1
0
파일: Map3310.java 프로젝트: stephan1/my
  private static String getVilleCP(String name) {
    Ville ville = Ville.getVilleFromVilleEtCode(name);
    if (ville == null) {

      return null;
    }
    return ville.getCodepostal();
  }
예제 #2
0
 @Override
 public void show(SQLRowAccessor r) {
   final String fieldName0 = getFields().get(0).getName();
   final String fieldName1 = getFields().get(1).getName();
   if (r.getFields().contains(fieldName0) && r.getFields().contains(fieldName1)) {
     String cp = r.getString(fieldName0);
     String name = r.getString(fieldName1);
     final Ville villeFromVilleEtCode = Ville.getVilleFromVilleEtCode(name + " (" + cp + ")");
     // get a matching Ville
     if (villeFromVilleEtCode != null) {
       this.getWrapper().setValue(villeFromVilleEtCode);
     } else {
       this.getWrapper().setValue(new Ville(name, 0, 0, 0, cp));
     }
   }
 }
예제 #3
0
파일: Map3310.java 프로젝트: stephan1/my
  private static String getVille(final String name) {

    Ville ville = Ville.getVilleFromVilleEtCode(name);
    if (ville == null) {
      SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              JOptionPane.showMessageDialog(
                  null,
                  "La ville "
                      + "\""
                      + name
                      + "\""
                      + " est introuvable! Veuillez corriger l'erreur!");
            }
          });
      return null;
    }
    return ville.getName();
  }