Subversion Repositories eFlore/Applications.cel

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 aperonnet 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
package org.tela_botanica.client.observation;
16
 
17
 
18
import com.google.gwt.user.client.ui.ClickListener;
19
import com.google.gwt.user.client.ui.Composite;
20
import com.google.gwt.user.client.ui.HTML;
21
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
22
import com.google.gwt.user.client.ui.HorizontalPanel;
23
import com.google.gwt.user.client.ui.Widget;
24
 
25
 
26
public class EtatConnexionVue extends Composite  {
27
 
28
 
29
 
30
  private ObservationMediateur observationMediateur=null;
31
 
32
  private HTML signLabel = new HTML() ;
33
  private boolean connecte = false ;
34
 
35
  public EtatConnexionVue(final ObservationMediateur med)  {
36
 
37
	observationMediateur=med;
38
 
39
 
40
	HorizontalPanel outer = new HorizontalPanel();
41
	HorizontalPanel inner = new HorizontalPanel();
42
 
43
 
44
	outer.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
45
 
46
	inner.add(signLabel);
47
 
48
	inner.setSpacing(3);
49
	outer.add(inner);
50
 
51
	initWidget(outer);
52
 
53
	signLabel.addClickListener(
54
		    	new ClickListener() {
55
		    		public void onClick(Widget sender) {
56
 
57
		    			// Non connecte ? Lien vers boite de connection
58
 
59
		    			if (!connecte) {
60
 
61
		    				observationMediateur.afficherDialogueConnexion();
62
		    			}
63
 
64
		    			else {
65
 
66
		    				observationMediateur.deconnecterUtilisateur();
67
 
68
 
69
		    			}
70
 
71
		    		}
72
		     	}
73
	);
74
 
75
 
76
  }
77
 
78
 
79
public void setEtat(String text, boolean connecte) {
80
	signLabel.setHTML(text);
81
	this.connecte=connecte;
82
}
83
 
84
 
85
 
86
}
87
 
88
 
89
/* +--Fin du code ---------------------------------------------------------------------------------------+
90
* $Log: not supported by cvs2svn $
91
* Revision 1.1  2008-06-09 14:19:37  ddelon
92
* Initialisation observation
93
*
94
* Revision 1.2  2008-04-28 13:10:44  ddelon
95
* Integration MyGwt
96
*
97
* Revision 1.1  2008-01-02 21:26:04  ddelon
98
* mise en place mygwt
99
*
100
* Revision 1.6  2007-12-22 14:48:53  ddelon
101
* Documentation et refactorisation
102
*
103
* Revision 1.5  2007-09-17 19:25:34  ddelon
104
* Documentation
105
*
106
*
107
*/