| Line 8... |
Line 8... |
| 8 |
import java.util.List;
|
8 |
import java.util.List;
|
| 9 |
import java.util.Map;
|
9 |
import java.util.Map;
|
| Line 10... |
Line 10... |
| 10 |
|
10 |
|
| 11 |
import org.tela_botanica.client.CarnetEnLigneMediateur;
|
11 |
import org.tela_botanica.client.CarnetEnLigneMediateur;
|
| - |
|
12 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
| 12 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
13 |
import org.tela_botanica.client.modeles.dao.ListeReferentielChampsEtendusDAO;
|
| 13 |
import org.tela_botanica.client.modeles.objets.ChampEtendu;
|
14 |
import org.tela_botanica.client.modeles.objets.ChampEtendu;
|
| 14 |
import org.tela_botanica.client.modeles.objets.Configuration;
|
15 |
import org.tela_botanica.client.modeles.objets.Configuration;
|
| 15 |
import org.tela_botanica.client.modeles.objets.EntiteGeographiqueObservation;
|
16 |
import org.tela_botanica.client.modeles.objets.EntiteGeographiqueObservation;
|
| 16 |
import org.tela_botanica.client.modeles.objets.ListeObservation;
|
17 |
import org.tela_botanica.client.modeles.objets.ListeObservation;
|
| Line 319... |
Line 320... |
| 319 |
panneauSecondeColonne.setBorder(false);
|
320 |
panneauSecondeColonne.setBorder(false);
|
| Line 320... |
Line 321... |
| 320 |
|
321 |
|
| Line 321... |
Line 322... |
| 321 |
this.setPaddings(5) ;
|
322 |
this.setPaddings(5) ;
|
| 322 |
|
323 |
|
| Line 323... |
Line 324... |
| 323 |
// Accesskey pour debugging
|
324 |
// Accesskey pour debugging
|
| 324 |
commune=new ComboBox("Commune","commune\" accesskey=\"1");
|
325 |
commune = new ComboBox("Commune","commune\" accesskey=\"1");
|
| 325 |
|
326 |
|
| 326 |
final String resultTplCommune = "<div class=\"search-item-commune\">{commune}</div>";
|
327 |
final String resultTplCommune = "<div class=\"search-item-commune\">{commune}</div>";
|
| Line 630... |
Line 631... |
| 630 |
}
|
631 |
}
|
| 631 |
}
|
632 |
}
|
| 632 |
});
|
633 |
});
|
| Line 633... |
Line 634... |
| 633 |
|
634 |
|
| - |
|
635 |
if(Configuration.saisieChampsEtendusActivee()) {
|
| - |
|
636 |
// Chargement du cache des correspondances cles/labels du catalogue
|
| - |
|
637 |
ListeReferentielChampsEtendusDAO lrceDao = new ListeReferentielChampsEtendusDAO(null);
|
| - |
|
638 |
lrceDao.obtenirGroupesChampsEtendus(this);
|
| - |
|
639 |
lrceDao.obtenirCatalogueChampsEtendus(this);
|
| 634 |
if(Configuration.saisieChampsEtendusActivee()) {
|
640 |
|
| 635 |
lienAjouterChampsEtendus = new HTML("Ajouter un champ étendu");
|
641 |
lienAjouterChampsEtendus = new HTML("Ajouter un champ étendu");
|
| 636 |
lienAjouterChampsEtendus.addStyleName("lienAjouterChampEtendu");
|
642 |
lienAjouterChampsEtendus.addStyleName("lienAjouterChampEtendu");
|
| 637 |
lienAjouterChampsEtendus.setVisible(true);
|
643 |
lienAjouterChampsEtendus.setVisible(true);
|
| 638 |
panneauPremierColonne.add(lienAjouterChampsEtendus);
|
644 |
panneauPremierColonne.add(lienAjouterChampsEtendus);
|
| Line 1791... |
Line 1797... |
| 1791 |
listeChampsEtendus = null;
|
1797 |
listeChampsEtendus = null;
|
| 1792 |
}
|
1798 |
}
|
| 1793 |
}
|
1799 |
}
|
| Line 1794... |
Line 1800... |
| 1794 |
|
1800 |
|
| - |
|
1801 |
private void afficherChampsEtendus(Map<String, ChampEtendu> champsEtendus, ChampEtendu champsAFocus) {
|
| 1795 |
private void afficherChampsEtendus(Map<String, ChampEtendu> champsEtendus, ChampEtendu champsAFocus) {
|
1802 |
champsEtendus = Util.trierListeChampsEtendus(champsEtendus);
|
| Line 1796... |
Line 1803... |
| 1796 |
viderChampsEtendus();
|
1803 |
viderChampsEtendus();
|
| 1797 |
|
1804 |
|
| Line 1817... |
Line 1824... |
| 1817 |
conteneurChampEtenduDroite.setPaddings(42, 0, 0, 0);
|
1824 |
conteneurChampEtenduDroite.setPaddings(42, 0, 0, 0);
|
| Line 1818... |
Line 1825... |
| 1818 |
|
1825 |
|
| 1819 |
if(champsEtendus != null && champsEtendus.size() > 0) {
|
1826 |
if(champsEtendus != null && champsEtendus.size() > 0) {
|
| 1820 |
lienAfficherChampsEtendus.setVisible(true);
|
1827 |
lienAfficherChampsEtendus.setVisible(true);
|
| - |
|
1828 |
listeChampsEtendus = new HashMap<String, ChampSaisieEtendu>(champsEtendus.size());
|
| 1821 |
listeChampsEtendus = new HashMap<String, ChampSaisieEtendu>(champsEtendus.size());
|
1829 |
HashMap<String, String> correspondancesClesLabel = ListeReferentielChampsEtendusDAO.cacheClesLabels;
|
| 1822 |
boolean gauche = true;
|
1830 |
boolean gauche = true;
|
| - |
|
1831 |
for (Iterator<String> iterator = champsEtendus.keySet().iterator(); iterator.hasNext();) {
|
| 1823 |
for (Iterator<String> iterator = champsEtendus.keySet().iterator(); iterator.hasNext();) {
|
1832 |
|
| 1824 |
String id = iterator.next();
|
1833 |
String id = iterator.next();
|
| - |
|
1834 |
ChampEtendu champ = champsEtendus.get(id);
|
| 1825 |
ChampEtendu champ = champsEtendus.get(id);
|
1835 |
|
| 1826 |
String valeur = champ.getValeur();
|
1836 |
String valeur = champ.getValeur();
|
| - |
|
1837 |
String label = id;
|
| - |
|
1838 |
|
| - |
|
1839 |
// Si le champ possède un clé déjà définie par le catalogue, elle lui sera affectée
|
| - |
|
1840 |
// sinon on la formate en la "déchamotant" et en ajoutant des espaces
|
| - |
|
1841 |
if(correspondancesClesLabel.containsKey(id)) {
|
| - |
|
1842 |
label = correspondancesClesLabel.get(id);
|
| - |
|
1843 |
} else {
|
| - |
|
1844 |
label = Util.formaterCleChampsEtenduPourAffichage(label);
|
| Line 1827... |
Line 1845... |
| 1827 |
String label = champ.getLabel();
|
1845 |
}
|
| 1828 |
|
1846 |
|
| 1829 |
ChampSaisieEtendu champTexteEtendu = new ChampSaisieEtendu(label, id);
|
1847 |
ChampSaisieEtendu champTexteEtendu = new ChampSaisieEtendu(label, id);
|
| 1830 |
if(champ.equals(champsAFocus)) {
|
1848 |
if(champ.equals(champsAFocus)) {
|
| 1831 |
champTexteEtendu.focus();
|
- |
|
| - |
|
1849 |
champTexteEtendu.focus();
|
| 1832 |
}
|
1850 |
}
|
| 1833 |
champTexteEtendu.setLabel(label);
|
1851 |
|
| 1834 |
champTexteEtendu.setId(id);
|
1852 |
champTexteEtendu.setId(id);
|
| 1835 |
champTexteEtendu.setValue(valeur);
|
1853 |
champTexteEtendu.setValue(valeur);
|
| 1836 |
if(gauche) {
|
1854 |
if(gauche) {
|
| Line 2175... |
Line 2193... |
| 2175 |
String valeurChampBrute = champ.getRawValue();
|
2193 |
String valeurChampBrute = champ.getRawValue();
|
| Line 2176... |
Line 2194... |
| 2176 |
|
2194 |
|
| 2177 |
// Test idiot qui permet de savoir si l'on utilise la valeur saisie directement ou bien la valeur
|
2195 |
// Test idiot qui permet de savoir si l'on utilise la valeur saisie directement ou bien la valeur
|
| 2178 |
// selectionnee car lors du setValue sur le keypress, gwtext ne prends pas en compte le dernier
|
2196 |
// selectionnee car lors du setValue sur le keypress, gwtext ne prends pas en compte le dernier
|
| 2179 |
// caractère
|
- |
|
| 2180 |
|
2197 |
// caractère
|
| 2181 |
if(valeurChampBrute.trim().length() == 0) {
|
2198 |
if(valeurChampBrute.trim().length() == 0) {
|
| 2182 |
valeurChamp = "";
|
2199 |
valeurChamp = "";
|
| 2183 |
} else {
|
2200 |
} else {
|
| 2184 |
if(valeurChamp != null && valeurChamp.length() > 0) {
|
2201 |
if(valeurChamp != null && valeurChamp.length() > 0) {
|