Subversion Repositories eFlore/Applications.del

Compare Revisions

Ignore whitespace Rev 595 → Rev 597

/trunk/src/org/tela_botanica/del/client/composants/moteurrecherche/MoteurRecherchePresenteur.java
259,19 → 259,19
}
});
 
vue.getChampsAuteur().addKeyPressHandler(createKeyboardAdvancedSearchHandler());
vue.getChampsAuteur().addKeyPressHandler(creerGestionnaireEvenementToucheEntree());
 
vue.getChampsDate().addKeyPressHandler(createKeyboardAdvancedSearchHandler());
vue.getChampsDate().addKeyPressHandler(creerGestionnaireEvenementToucheEntree());
 
vue.getChampsFamille().addKeyPressHandler(createKeyboardAdvancedSearchHandler());
vue.getChampsFamille().addKeyPressHandler(creerGestionnaireEvenementToucheEntree());
 
vue.getChampsGenre().addKeyPressHandler(createKeyboardAdvancedSearchHandler());
vue.getChampsGenre().addKeyPressHandler(creerGestionnaireEvenementToucheEntree());
 
vue.getChampsMotCle().addKeyPressHandler(createKeyboardAdvancedSearchHandler());
vue.getChampsMotCle().addKeyPressHandler(creerGestionnaireEvenementToucheEntree());
 
}
 
public KeyPressHandler createKeyboardAdvancedSearchHandler() {
public KeyPressHandler creerGestionnaireEvenementToucheEntree() {
return new KeyPressHandler() {
public void onKeyPress(KeyPressEvent event) {
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
/trunk/src/org/tela_botanica/del/client/composants/identification/FormulaireIdentificationVue.java
4,6 → 4,7
import org.tela_botanica.del.client.modeles.Utilisateur;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.dom.client.HasKeyPressHandlers;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.Window;
55,7 → 56,7
 
@Override
public void basculerModeConnecte(Utilisateur utilisateur) {
boolean estConnecte = utilisateur.isIdentifie();
boolean estConnecte = utilisateur.estIdentifie();
connecter.setVisible(!estConnecte);
deconnecter.setVisible(estConnecte);
113,4 → 114,14
public String getErreur() {
return erreurIdentification.getText();
}
 
@Override
public HasKeyPressHandlers getLoginHasKeyPressHandler() {
return login;
}
 
@Override
public HasKeyPressHandlers getMotdepasseHasKeyPressHandler() {
return motdepasse;
}
}
/trunk/src/org/tela_botanica/del/client/composants/identification/FormulaireIdentificationPresenteur.java
9,6 → 9,10
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.dom.client.HasKeyPressHandlers;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.dom.client.KeyPressHandler;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.IsWidget;
29,6 → 33,8
public void viderFormulaire();
public void setErreur(String idTexte);
public String getErreur();
public HasKeyPressHandlers getLoginHasKeyPressHandler();
public HasKeyPressHandlers getMotdepasseHasKeyPressHandler();
}
private Vue vue;
66,14 → 72,7
vue.getBoutonOK().addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
String login = vue.getLogin().getText();
String motdepasse = vue.getMotdepasse().getText();
if (login.equals("") || motdepasse.equals("")) {
gererErreur("saisirLogin");
} else {
connecterUtilisateur(login, motdepasse);
}
surTentativeLogin();
}
});
81,12 → 80,35
@Override
public void onClick(ClickEvent event) {
Utilisateur utilisateur = CacheClient.getInstance().getUtilisateur();
deconnecterUtilisateur(utilisateur.getCourriel());
deconnecterUtilisateur(utilisateur.getCourriel());
}
});
vue.getLoginHasKeyPressHandler().addKeyPressHandler(creerGestionnaireEvenementToucheEntree());
vue.getMotdepasseHasKeyPressHandler().addKeyPressHandler(creerGestionnaireEvenementToucheEntree());
}
private void surTentativeLogin() {
String login = vue.getLogin().getText();
String motdepasse = vue.getMotdepasse().getText();
if (login.equals("") || motdepasse.equals("")) {
gererErreur("saisirLogin");
} else {
connecterUtilisateur(login, motdepasse);
}
}
public KeyPressHandler creerGestionnaireEvenementToucheEntree() {
return new KeyPressHandler() {
public void onKeyPress(KeyPressEvent event) {
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
surTentativeLogin();
}
}
};
}
public void gererErreur(String erreur) {
vue.setErreur(erreur);
vue.afficherErreur();
98,7 → 120,7
@Override
public void surRetourUtilisateur(Utilisateur utilisateur) {
CacheClient.getInstance().setUtilisateur(utilisateur);
if (utilisateur.isIdentifie()) {
if (utilisateur.estIdentifie()) {
vue.masquerErreur();
rafraichir();
vue.basculerAffichageFormulaire();
/trunk/src/org/tela_botanica/del/client/modeles/Utilisateur.java
46,7 → 46,7
public void setId(String id) {
this.id = id;
}
public boolean isIdentifie() {
public boolean estIdentifie() {
return identifie;
}
public void setIdentifie(boolean identifie) {
/trunk/src/org/tela_botanica/del/client/i18n/Vocabulary.java
2,7 → 2,7
 
/**
* Interface to represent the constants contained in resource bundle:
* '/home/greg/web/del/src/org/tela_botanica/del/client/i18n/Vocabulary.properties'.
* '/home/aurelien/web/del/src/org/tela_botanica/del/client/i18n/Vocabulary.properties'.
*/
public interface Vocabulary extends com.google.gwt.i18n.client.Constants {
781,11 → 781,11
String transmisLe();
 
/**
* Translated "Tri ".
* Translated "Tri : ".
*
* @return translated "Tri "
* @return translated "Tri : "
*/
@DefaultStringValue("Tri ")
@DefaultStringValue("Tri : ")
@Key("tri")
String tri();
 
/trunk/src/org/tela_botanica/del/client/vues/plateformedetermination/formulaireproposition/FormulairePropositionPresenteur.java
47,7 → 47,7
}
private void remplirAvecInfosUtilisateur() {
if(CacheClient.getInstance().getUtilisateur().isIdentifie()) {
if(CacheClient.getInstance().getUtilisateur().estIdentifie()) {
vue.afficherNomPrenomEtDesactiver(CacheClient.getInstance().getUtilisateur().getNomPrenomFormate());
}
}
/trunk/src/org/tela_botanica/del/test/composants/identification/FormulaireIdentificationPresenteurTest.java
54,7 → 54,7
presenteur.connecterUtilisateur(utilisateurDepart.getId(), "test");
Utilisateur utilisateurCache = CacheClient.getInstance().getUtilisateur();
assertEquals(utilisateurDepart.getCourriel(), utilisateurCache.getCourriel());
assertEquals(true, utilisateurCache.isIdentifie());
assertEquals(true, utilisateurCache.estIdentifie());
}
@Test
62,6 → 62,6
presenteur.deconnecterUtilisateur(utilisateurDepart.getCourriel());
Utilisateur utilisateurCache = CacheClient.getInstance().getUtilisateur();
assertEquals(null, utilisateurCache.getId());
assertEquals(false, utilisateurCache.isIdentifie());
assertEquals(false, utilisateurCache.estIdentifie());
}
}