Subversion Repositories eFlore/Applications.cel

Rev

Rev 12 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
12 david 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.setBodyBorder(false) ;
67
    this.setBorder(false) ;
68
 
69
	// Pas de word wrap
70
	labelEtatConnexion=new HTML("",false);
71
 
72
	this.add(labelEtatConnexion);
73
 
74
 
75
	ajouterListeners();
76
 
77
  	}
78
 
79
   public void ajouterListeners() {
80
 
81
 
82
 
83
	labelEtatConnexion.addClickListener(
84
		    	new ClickListener() {
85
		    		public void onClick(Widget sender) {
86
 
87
		    			// Non connecte ? Lien  vers dialogue de connection
88
 
89
		    			if (!connecte) {
90
 
91
		    				carnetEnLigneMediateur.afficherDialogueConnexion();
92
		    			}
93
 
94
		    			else {
95
 
96
		    				carnetEnLigneMediateur.deconnecterUtilisateur();
97
 
98
 
99
		    			}
100
 
101
		    		}
102
		     	}
103
	);
104
 
105
	}
106
 
107
 
108
 
109
 
110
/**
111
 * Affichage de l'etat de connexion
112
 * @param text
113
 * @param connecte
114
 */
115
 
116
public void setEtat(String text, boolean connecte) {
117
 
118
 
119
	labelEtatConnexion.setHTML(text);
120
 
121
	this.connecte=connecte;
122
}
123
 
124
 
125
 
126
 
127
 
128
 
129
}
130
 
131
 
132
/* +--Fin du code ---------------------------------------------------------------------------------------+
133
* $Log$
134
* Revision 1.1  2008-11-13 11:27:05  ddelon
135
* Reecriture gwt-ext
136
*
137
* Revision 1.1  2008-06-09 14:19:37  ddelon
138
* Initialisation observation
139
*
140
* Revision 1.2  2008-04-28 13:10:44  ddelon
141
* Integration MyGwt
142
*
143
* Revision 1.1  2008-01-02 21:26:04  ddelon
144
* mise en place mygwt
145
*
146
* Revision 1.6  2007-12-22 14:48:53  ddelon
147
* Documentation et refactorisation
148
*
149
* Revision 1.5  2007-09-17 19:25:34  ddelon
150
* Documentation
151
*
152
*
153
*/