Subversion Repositories eFlore/Applications.cel

Rev

Rev 2 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 5
Line 11... Line 11...
11
import com.gwtext.client.widgets.event.KeyListener;
11
import com.gwtext.client.widgets.event.KeyListener;
12
import com.gwtext.client.widgets.event.WindowListenerAdapter;
12
import com.gwtext.client.widgets.event.WindowListenerAdapter;
13
import com.gwtext.client.widgets.form.TextField;
13
import com.gwtext.client.widgets.form.TextField;
Line 14... Line 14...
14
 
14
 
15
public class IdVue extends Window implements Rafraichissable {
15
public class IdVue extends Window implements Rafraichissable {
16
	
16
 
17
	private ImageMediateur iMediateur ;
17
	private ImageMediateur iMediateur;
18
	private TextField champId = null ;
18
	private TextField champId = null;
19
	private Button ok = null ;
19
	private Button ok = null;
20
	
20
 
21
	public IdVue(ImageMediateur im) 
-
 
22
	{
21
	public IdVue(ImageMediateur im) {
23
		super("Identification") ;
22
		super("Identification");
24
		
23
 
25
		iMediateur = im ;
24
		iMediateur = im;
26
		
25
 
27
		champId = new TextField() ;
26
		champId = new TextField();
28
		ok = new Button("OK") ;
27
		ok = new Button("OK");
29
		
28
 
30
		add(champId) ;
29
		add(champId);
31
		add(ok) ;
30
		add(ok);
32
		
31
 
33
		setSize(156,75) ;
32
		setSize(156, 75);
34
		setClosable(false) ;
33
		setClosable(false);
35
		setModal(true) ;
34
		setModal(true);
36
		this.setCloseAction(HIDE) ;
-
 
37
		
35
		this.setCloseAction(HIDE);
38
		
36
 
39
		ajouterListeners() ;
37
		ajouterListeners();
40
	}
38
	}
41
	
39
 
Line 42... Line 40...
42
	private void ajouterListeners() {
40
	private void ajouterListeners() {
43
 
41
 
Line 44... Line -...
44
		// gestion du clic sur le bouton
-
 
45
		ok.addListener(new ButtonListenerAdapter() {
42
		// gestion du clic sur le bouton
46
 
43
		ok.addListener(new ButtonListenerAdapter() {
47
			
44
 
48
			public void onClick(Button button, EventObject e) {
45
			public void onClick(Button button, EventObject e) {
49
				
46
 
50
				 valider() ;
47
				valider();
51
			}
48
			}
52
			
49
 
53
		}) ;
50
		});
Line 54... Line 51...
54
		
51
 
55
		// gestion de la touche entrée
52
		// gestion de la touche entrée
56
		champId.addKeyListener(EventObject.ENTER, new KeyListener() {
53
		champId.addKeyListener(EventObject.ENTER, new KeyListener() {
57
 
54
 
58
			public void onKey(int key, EventObject e) {
-
 
59
				
55
			public void onKey(int key, EventObject e) {
60
				valider() ;
56
 
61
			}
57
				valider();
62
			
58
			}
Line 63... Line 59...
63
			
59
 
64
		}) ;
-
 
65
		
60
		});
66
		this.addListener(new WindowListenerAdapter() {
61
 
67
 
62
		this.addListener(new WindowListenerAdapter() {
68
			public void onClose(Panel panel) {
63
 
Line 69... Line -...
69
				
-
 
70
				
64
			public void onClose(Panel panel) {
71
			}
65
 
72
			
66
			}
73
		});
-
 
74
 
67
 
75
		
68
		});
76
	}
69
 
77
	
70
	}
78
	public ImageMediateur getIMediateur()
71
 
79
	{
72
	public ImageMediateur getIMediateur() {
80
		return iMediateur ;
73
		return iMediateur;
81
	}
74
	}
82
	
75
 
83
	protected void valider() {
76
	protected void valider() {
84
		
77
 
Line 85... Line 78...
85
		String id = champId.getText() ;
78
		String id = champId.getText();
86
		getIMediateur().setIdentifiant(""+id.hashCode()) ;
79
		getIMediateur().setIdentifiant("" + id.hashCode());
87
		getIMediateur().changerUtilisateur() ;
-
 
88
		this.close() ;
-
 
89
		
-
 
Line -... Line 80...
-
 
80
		getIMediateur().changerUtilisateur();
Line 90... Line 81...
90
	}
81
		this.close();