Subversion Repositories eFlore/Archives.cel-v2

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
49 ddelon 1
/**
2
 David Delon david.delon@clapas.net 2007
3
 
4
 */
5
 
6
/*
7
 * EtatConnexionVue.java  : affichage information portant sur le statut de la connexion utilisateur
8
 *
9
 *
10
 * 1: Le programme affiche le statut connecte si l'utilisateur s'est connecte precedemment, sinon s'affiche le statut deconnecte
11
 * 2: Le programme arme les actions liees a la connection ou a la deconnection
12
 *    - Connection : affichage de la boite de connexion
13
 *    - Deconnexion : appel du service de deconnexion, et appel de la re-initialisation de l'affichage pour le nouvel identifiant utilisateur obtenu (identifiant  de session)
14
 */
15
 
16
 
17
package org.tela_botanica.client.vues;
18
 
19
 
20
 
21
import org.tela_botanica.client.CarnetEnLigneMediateur;
22
 
23
import com.google.gwt.user.client.ui.ClickListener;
24
import com.google.gwt.user.client.ui.HTML;
25
import com.google.gwt.user.client.ui.Widget;
26
 
27
import com.gwtext.client.widgets.Panel;
28
 
29
 
30
 
31
/**
32
 * Un indicateur d'etat de connexion
33
 *
34
 * @author David Delon
35
 *
36
 */
37
 
38
 
39
 
40
public class EtatConnexionVue  extends Panel  {
41
 
42
 
43
	/**
44
	 * Médiateur associé à la vue
45
	 */
46
	private CarnetEnLigneMediateur carnetEnLigneMediateur = null ;
47
 
48
  /**
49
   * Texte lié à la connexion.
50
   *
51
   */
52
 
53
  private HTML labelEtatConnexion = null;
54
 
55
  /**
56
   * Booleen indiquant si utilisateur connecte
57
   *
58
   */
59
 
60
  private boolean connecte = false ;
61
 
62
  public EtatConnexionVue(CarnetEnLigneMediateur cm)  {
63
 
64
	carnetEnLigneMediateur=cm;
65
 
66
    this.setSize(800,20) ;
67
    this.setBodyBorder(false) ;
68
    this.setBorder(false) ;
69
 
70
	// Pas de word wrap
71
	labelEtatConnexion=new HTML("",false);
72
 
73
	this.add(labelEtatConnexion);
74
 
75
 
76
	ajouterListeners();
77
 
78
  	}
79
 
80
   public void ajouterListeners() {
81
 
82
 
83
 
84
	labelEtatConnexion.addClickListener(
85
		    	new ClickListener() {
86
		    		public void onClick(Widget sender) {
87
 
88
		    			// Non connecte ? Lien  vers dialogue de connection
89
 
90
		    			if (!connecte) {
91
 
92
		    				carnetEnLigneMediateur.afficherDialogueConnexion();
93
		    			}
94
 
95
		    			else {
96
 
97
		    				carnetEnLigneMediateur.deconnecterUtilisateur();
98
 
99
 
100
		    			}
101
 
102
		    		}
103
		     	}
104
	);
105
 
106
	}
107
 
108
 
109
 
110
 
111
/**
112
 * Affichage de l'etat de connexion
113
 * @param text
114
 * @param connecte
115
 */
116
 
117
public void setEtat(String text, boolean connecte) {
118
 
119
 
120
	labelEtatConnexion.setHTML(text);
121
 
122
	this.connecte=connecte;
123
}
124
 
125
 
126
 
127
 
128
 
129
 
130
}
131
 
132
 
133
/* +--Fin du code ---------------------------------------------------------------------------------------+
134
* $Log$
135
* Revision 1.1  2008-06-09 14:19:37  ddelon
136
* Initialisation observation
137
*
138
* Revision 1.2  2008-04-28 13:10:44  ddelon
139
* Integration MyGwt
140
*
141
* Revision 1.1  2008-01-02 21:26:04  ddelon
142
* mise en place mygwt
143
*
144
* Revision 1.6  2007-12-22 14:48:53  ddelon
145
* Documentation et refactorisation
146
*
147
* Revision 1.5  2007-09-17 19:25:34  ddelon
148
* Documentation
149
*
150
*
151
*/