11,12 → 11,10 |
import org.tela_botanica.client.modeles.ReferentielCommune; |
import org.tela_botanica.client.modeles.ReferentielNom; |
import org.tela_botanica.client.observation.ObservationMediateur; |
import com.google.gwt.user.client.Window; |
import com.gwtext.client.core.EventCallback; |
import com.gwtext.client.core.EventObject; |
import com.gwtext.client.core.ListenerConfig; |
import com.gwtext.client.core.Position; |
import com.gwtext.client.core.Template; |
import com.gwtext.client.data.ArrayReader; |
import com.gwtext.client.data.FieldDef; |
import com.gwtext.client.data.MemoryProxy; |
31,8 → 29,6 |
import com.gwtext.client.widgets.form.ComboBox; |
import com.gwtext.client.widgets.form.DateField; |
import com.gwtext.client.widgets.form.FormPanel; |
import com.gwtext.client.widgets.form.Hidden; |
import com.gwtext.client.widgets.form.TextArea; |
import com.gwtext.client.widgets.form.TextField; |
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter; |
import com.gwtext.client.widgets.layout.ColumnLayout; |
65,9 → 61,7 |
private ComboBox espece = null; |
private String numeroNom = null; |
private String numeroOrdre = null; |
private TextArea motsCles = null; |
|
<<<<<<< .mine |
// Pour remise a zero partielle lors d'une validation |
|
private enum Champs { |
76,10 → 70,7 |
|
|
|
======= |
private String formatDate = null ; |
|
>>>>>>> .r117 |
private Button boutonOK = new Button("Créer"); |
private Button boutonAnnuler = new Button("Réinitialiser"); |
|
232,11 → 223,6 |
milieu.setAllowBlank(true); |
panneauSecondeColonne.add(milieu); |
|
motsCles = new TextArea("Mots clés","motscles") ; |
motsCles.setAllowBlank(true); |
motsCles.setWidth(275); |
panneauSecondeColonne.add(motsCles); |
|
panneauIntermediaire.add(panneauPremierColonne, new ColumnLayoutData(.5)); |
panneauIntermediaire.add(panneauSecondeColonne, new ColumnLayoutData(.5)); |
|
280,8 → 266,8 |
this.add(panneauFormulaire) ; |
this.setTopToolbar(bt) ; |
|
|
this.setAutoHeight(true); |
this.setAutoScroll(true); |
//this.setAutoHeight(true); |
|
|
// on ajoute les listeners |
313,62 → 299,67 |
|
commune.addKeyPressListener(new EventCallback() { |
|
public void execute(EventObject e) { |
|
|
switch(e.getKey()) { |
|
|
case KEY_ALT: |
case KEY_CTRL: |
case KEY_DOWN: |
case KEY_END: |
case KEY_ESCAPE: |
case KEY_HOME: |
case KEY_LEFT: |
case KEY_PAGEDOWN: |
case KEY_PAGEUP: |
case KEY_RIGHT: |
case KEY_SHIFT: |
case KEY_TAB: |
case KEY_UP: |
|
break; |
|
case KEY_ENTER: |
|
public void execute(EventObject e) { |
|
|
switch(e.getKey()) { |
|
case KEY_ENTER: |
|
if (selectionCommune) { |
selectionCommune=false; |
} |
else { |
|
|
else { |
|
validerSaisie(Champs.COMMUNE); |
// lancer mise a jour |
} |
|
|
break; |
|
default: |
break; |
|
default: |
|
departement=""; |
obtenirListeReferentielCommune(); |
|
break; |
} |
|
|
|
} |
|
}, listenerConfigCommune |
|
break; |
} |
} |
}, listenerConfigCommune |
); |
|
// Listener completion espece |
date.addKeyPressListener(new EventCallback() { |
|
public void execute(EventObject e) { |
// TODO Auto-generated method stub |
switch(e.getKey()) { |
|
case KEY_ENTER: |
validerSaisie(Champs.DATE); |
break; |
|
default: |
} |
} |
}); |
|
station.addKeyPressListener(new EventCallback() { |
|
public void execute(EventObject e) { |
// TODO Auto-generated method stub |
switch(e.getKey()) { |
|
case KEY_ENTER: |
validerSaisie(Champs.STATION); |
break; |
|
default: |
} |
} |
}); |
|
|
|
// Listener completion espece |
espece.addListener(new ComboBoxListenerAdapter() { |
public void onSelect(ComboBox comboBox, Record record, int index) { |
espece.setValue(record.getAsString("nom")); |
414,7 → 405,7 |
selectionEspece=false; |
} |
else { |
// lancer mise a jour |
validerSaisie(Champs.ESPECE); |
} |
|
|
436,7 → 427,51 |
|
); |
|
lieudit.addKeyPressListener(new EventCallback() { |
|
public void execute(EventObject e) { |
// TODO Auto-generated method stub |
switch(e.getKey()) { |
|
case KEY_ENTER: |
validerSaisie(Champs.LIEUDIT); |
break; |
|
default: |
} |
} |
}); |
|
milieu.addKeyPressListener(new EventCallback() { |
|
public void execute(EventObject e) { |
// TODO Auto-generated method stub |
switch(e.getKey()) { |
|
case KEY_ENTER: |
validerSaisie(Champs.MILIEU); |
break; |
|
default: |
} |
} |
}); |
|
comment.addKeyPressListener(new EventCallback() { |
|
public void execute(EventObject e) { |
// TODO Auto-generated method stub |
switch(e.getKey()) { |
|
case KEY_ENTER: |
validerSaisie(Champs.COMMENT); |
break; |
|
default: |
} |
} |
}); |
|
|
|
boutonOK.addListener(new ButtonListenerAdapter() { |
472,8 → 507,6 |
} |
|
}); |
|
|
} |
|
/** |
634,13 → 667,13 |
|
public void ajouterObservation() { |
|
Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getRawValue(),motsCles.getValueAsString()); |
Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getRawValue()); |
observationMediateur.ajouterObservation(obs); |
} |
|
private void modifierObservation() { |
|
Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getText(),motsCles.getValueAsString()); |
Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getRawValue()); |
obs.setNumeroOrdre(numeroOrdre); |
observationMediateur.modifierObservation(obs); |
|
693,9 → 726,6 |
if(!obs.getNumeroOrdre().equals("null") && !obs.getNumeroOrdre().equals("000nu2ll")) { |
numeroOrdre = obs.getNumeroOrdre() ; |
} |
if(!obs.getMotsCles().equals("null") && !obs.getMotsCles().equals("000null")) { |
motsCles.setValue(obs.getMotsCles()); |
} |
|
} |
|
726,8 → 756,6 |
milieu.reset() ; |
break; |
|
|
<<<<<<< .mine |
case COMMENT: |
comment.reset() ; |
break; |
758,20 → 786,6 |
break; |
|
} |
|
======= |
date.reset() ; |
lieudit.reset() ; |
station.reset() ; |
milieu.reset(); |
comment.reset(); |
commune.reset(); |
motsCles.reset(); |
departement = ""; |
espece.reset(); |
numeroNom = "" ; |
numeroOrdre = ""; |
>>>>>>> .r117 |
|
} |
|
790,7 → 804,7 |
else |
{ |
|
boutonOK.setText("Créer") ; |
boutonOK.setText("Ajouter") ; |
setTitle("Saisir") ; |
boutonAnnuler.setText("Réinitialiser") ; |
modification = false ; |