New file |
0,0 → 1,154 |
/** |
David Delon david.delon@clapas.net 2007 |
|
*/ |
|
/* |
* EtatConnexionVue.java : affichage information portant sur le statut de la connexion utilisateur |
* |
* |
* 1: Le programme affiche le statut connecte si l'utilisateur s'est connecte precedemment, sinon s'affiche le statut deconnecte |
* 2: Le programme arme les actions liees a la connection ou a la deconnection |
* - Connection : affichage de la boite de connexion |
* - Deconnexion : appel du service de deconnexion, et appel de la re-initialisation de l'affichage pour le nouvel identifiant utilisateur obtenu (identifiant de session) |
*/ |
|
|
package org.tela_botanica.client.vues; |
|
|
|
import org.tela_botanica.client.CarnetEnLigneMediateur; |
|
import com.google.gwt.user.client.ui.ClickListener; |
import com.google.gwt.user.client.ui.HTML; |
import com.google.gwt.user.client.ui.Widget; |
|
import com.gwtext.client.widgets.Panel; |
|
|
|
/** |
* Un indicateur d'etat de connexion |
* |
* @author David Delon |
* |
*/ |
|
|
|
public class EtatConnexionVue extends Panel { |
|
|
/** |
* Médiateur associé à la vue |
*/ |
private CarnetEnLigneMediateur carnetEnLigneMediateur = null ; |
|
/** |
* Texte lié à la connexion. |
* |
*/ |
|
private HTML labelEtatConnexion = null; |
|
/** |
* Booleen indiquant si utilisateur connecte |
* |
*/ |
|
private boolean connecte = false ; |
|
public EtatConnexionVue(CarnetEnLigneMediateur cm) { |
|
carnetEnLigneMediateur=cm; |
|
this.setSize(800,20) ; |
this.setBodyBorder(false) ; |
this.setBorder(false) ; |
|
// Pas de word wrap |
labelEtatConnexion=new HTML("",false); |
|
this.add(labelEtatConnexion); |
|
|
ajouterListeners(); |
|
} |
|
public void ajouterListeners() { |
|
|
|
labelEtatConnexion.addClickListener( |
new ClickListener() { |
public void onClick(Widget sender) { |
|
// Non connecte ? Lien vers dialogue de connection |
|
if (!connecte) { |
|
carnetEnLigneMediateur.afficherDialogueConnexion(); |
} |
|
else { |
|
carnetEnLigneMediateur.deconnecterUtilisateur(); |
|
|
} |
|
} |
} |
); |
|
} |
|
|
|
|
/** |
* Affichage de l'etat de connexion |
* @param text |
* @param connecte |
*/ |
|
public void setEtat(String text, boolean connecte) { |
|
|
labelEtatConnexion.setHTML(text); |
|
this.connecte=connecte; |
} |
|
|
|
|
|
|
} |
|
|
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log$ |
* Revision 1.1 2008-11-13 11:27:05 ddelon |
* Reecriture gwt-ext |
* |
* Revision 1.1 2008-06-09 14:19:37 ddelon |
* Initialisation observation |
* |
* Revision 1.2 2008-04-28 13:10:44 ddelon |
* Integration MyGwt |
* |
* Revision 1.1 2008-01-02 21:26:04 ddelon |
* mise en place mygwt |
* |
* Revision 1.6 2007-12-22 14:48:53 ddelon |
* Documentation et refactorisation |
* |
* Revision 1.5 2007-09-17 19:25:34 ddelon |
* Documentation |
* |
* |
*/ |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |