Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 232 → Rev 233

/trunk/src/org/tela_botanica/client/modeles/aDonnee.java
5,6 → 5,8
import java.util.List;
import java.util.Set;
 
import org.tela_botanica.client.util.UtilArray;
 
import com.extjs.gxt.ui.client.data.BaseModelData;
import com.extjs.gxt.ui.client.widget.form.CheckBox;
 
40,6 → 42,7
}
return sortie;
}
/**
* Permet de constuire correctement une chaine dénormalisée (champ de type "truk").
*
58,6 → 61,19
}
}
/**
* Permet de constuire correctement une chaine dénormalisée unique (champ de type "ce_truk").
*
* @param champ le nom du champ dénormalisé
* @param type le type de la valeur à ajouter
* @param valeur la valeur à ajouter
*/
protected void setChaineDenormaliseUnique(String champ, String type, Object valeur) {
if (valeur instanceof String) {
this.set(champ, type+"##"+valeur);
}
}
protected String getInfoDenormaliseParType(String chaineExistante, String type) {
String sortie = "";
if (!chaineExistante.equals("")) {
71,6 → 87,32
return sortie;
}
/**
* Permet de modifier correctement une chaine dénormalisée (champ de type "truk").
* Remplace par la valeur de la première instance du type indiqué dans la chaine dénormalisée.
*
* @param champ le nom du champ dénormalisé
* @param type le type de la valeur à modifier
* @param valeur la valeur pour le type en question
*/
protected void setChaineDenormaliseParType(String champ, String type, Object valeur) {
if (valeur instanceof String) {
String chaineExistante = renvoyerValeurCorrecte(champ);
if (chaineExistante.equals("")) {
this.set(champ, type+"##"+valeur);
} else {
String[] valeurs = chaineExistante.split(";;");
for (int i = 0; i < valeurs.length; i++) {
if (valeurs[i].startsWith(type+"##") || i == (valeurs.length -1)) {
valeurs[i] = type+"##"+valeur;
break;
}
}
this.set(champ, UtilArray.implode(valeurs, ";;"));
}
}
}
protected String getInfoDenormaliseParPosition(String chaineExistante, int position) {
String sortie = "";
if (!chaineExistante.equals("")) {
91,6 → 133,34
return sortie;
}
/**
* Permet de modifier correctement une chaine dénormalisée (champ de type "truk").
* Remplace par la valeur l'instance dont la position a été indiquée.
*
* @param champ le nom du champ dénormalisé
* @param position le type de la valeur à modifier
* @param valeur la valeur à remplacer à la position indiquée
*/
protected void setChaineDenormaliseParPosition(String champ, int position, Object valeur) {
if (valeur instanceof String) {
String chaineExistante = renvoyerValeurCorrecte(champ);
if (!chaineExistante.equals("")) {
String[] valeurs = chaineExistante.split(";;");
if (valeurs.length == 0) {
this.set(champ, valeur);
} else if (valeurs.length >= position) {
for (int i = 0; i < valeurs.length; i++) {
if (i == (position - 1)) {
valeurs[i] = (String) valeur;
break;
}
}
this.set(champ, UtilArray.implode(valeurs, ";;"));
}
}
}
}
public String getDateModification() {
return (String) renvoyerValeurCorrecte("cmhl_date_modification");
}