11,10 → 11,12 |
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; |
29,6 → 31,8 |
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; |
61,7 → 65,9 |
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 { |
70,7 → 76,10 |
|
|
|
======= |
private String formatDate = null ; |
|
>>>>>>> .r117 |
private Button boutonOK = new Button("Créer"); |
private Button boutonAnnuler = new Button("Réinitialiser"); |
|
223,6 → 232,11 |
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)); |
|
266,8 → 280,8 |
this.add(panneauFormulaire) ; |
this.setTopToolbar(bt) ; |
|
this.setAutoScroll(true); |
//this.setAutoHeight(true); |
|
this.setAutoHeight(true); |
|
|
// on ajoute les listeners |
299,67 → 313,62 |
|
commune.addKeyPressListener(new EventCallback() { |
|
public void execute(EventObject e) { |
|
|
switch(e.getKey()) { |
|
case KEY_ENTER: |
|
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: |
|
if (selectionCommune) { |
selectionCommune=false; |
} |
else { |
|
else { |
|
|
validerSaisie(Champs.COMMUNE); |
// lancer mise a jour |
} |
break; |
|
default: |
|
|
break; |
|
default: |
|
departement=""; |
obtenirListeReferentielCommune(); |
|
break; |
} |
} |
}, listenerConfigCommune |
break; |
} |
|
|
|
} |
|
}, listenerConfigCommune |
|
); |
|
date.addKeyPressListener(new EventCallback() { |
// Listener completion espece |
|
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")); |
405,7 → 414,7 |
selectionEspece=false; |
} |
else { |
validerSaisie(Champs.ESPECE); |
// lancer mise a jour |
} |
|
|
427,51 → 436,7 |
|
); |
|
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() { |
507,6 → 472,8 |
} |
|
}); |
|
|
} |
|
/** |
667,13 → 634,13 |
|
public void ajouterObservation() { |
|
Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getRawValue()); |
Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getRawValue(),motsCles.getValueAsString()); |
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.getRawValue()); |
Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getText(),motsCles.getValueAsString()); |
obs.setNumeroOrdre(numeroOrdre); |
observationMediateur.modifierObservation(obs); |
|
726,6 → 693,9 |
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()); |
} |
|
} |
|
756,6 → 726,8 |
milieu.reset() ; |
break; |
|
|
<<<<<<< .mine |
case COMMENT: |
comment.reset() ; |
break; |
786,6 → 758,20 |
break; |
|
} |
|
======= |
date.reset() ; |
lieudit.reset() ; |
station.reset() ; |
milieu.reset(); |
comment.reset(); |
commune.reset(); |
motsCles.reset(); |
departement = ""; |
espece.reset(); |
numeroNom = "" ; |
numeroOrdre = ""; |
>>>>>>> .r117 |
|
} |
|
804,7 → 790,7 |
else |
{ |
|
boutonOK.setText("Ajouter") ; |
boutonOK.setText("Créer") ; |
setTitle("Saisir") ; |
boutonAnnuler.setText("Réinitialiser") ; |
modification = false ; |