Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 197 Rev 198
Line 42... Line 42...
42
	// Onglet 1 : identite & contact
42
	// Onglet 1 : identite & contact
43
	private TabItem identite;
43
	private TabItem identite;
44
	private FieldSet fsIdentite;
44
	private FieldSet fsIdentite;
45
	private FieldSet fsContact;
45
	private FieldSet fsContact;
Line -... Line 46...
-
 
46
	
-
 
47
	//A ajouter : 
-
 
48
	// Onglet Adresse
-
 
49
		// contient : adresse perso / adresse pro
-
 
50
	
-
 
51
	//Onglet Info Naturaliste
-
 
52
	
-
 
53
	// > Se baser sur la présentation thunderBird
-
 
54
	
46
	
55
	
Line -... Line 56...
-
 
56
	public PersonneDetailPanneauVue() {
47
	public PersonneDetailPanneauVue() {
57
		
48
		
58
		//Constructeur de la classe
Line 49... Line 59...
49
		Registry.register(RegistreId.PANNEAU_PERSONNE_DETAIL, this);
59
		Registry.register(RegistreId.PANNEAU_PERSONNE_DETAIL, this);
50
		setLayout(new FitLayout());
60
		setLayout(new FitLayout());
51
		
61
		
Line 52... Line 62...
52
		identite = new TabItem("Identité");
62
		identite = new TabItem("Identité");
53
		identite.setLayout(new TableLayout(2));		
-
 
54
		identite.setScrollMode(Scroll.AUTO);
63
		identite.setLayout(new TableLayout(2));		
Line 55... Line 64...
55
		
64
		identite.setScrollMode(Scroll.AUTO);
56
		fsIdentite = new FieldSet();
-
 
57
		
65
		
Line 58... Line -...
58
		fsIdentite.setLayout(new FormLayout());
-
 
59
		
66
		fsIdentite = new FieldSet();
Line -... Line 67...
-
 
67
		fsIdentite.setLayout(new FormLayout());
-
 
68
		
-
 
69
		
60
		
70
		fsContact = new FieldSet();
Line 61... Line 71...
61
		fsContact = new FieldSet();
71
		fsContact.setLayout(new FormLayout());
62
		
72
		
-
 
73
		this.add(identite);
-
 
74
		
-
 
75
		//TODO : ajouter adresse
63
		fsContact.setLayout(new FormLayout());
76
		//TODO : ajouter info naturaliste
Line 64... Line 77...
64
		
77
		
65
		
78
	}
66
		this.add(identite);
-
 
Line 67... Line 79...
67
		
79
 
68
	}
80
	public void afficherDetailPersonne(Personne personne) {
Line 69... Line -...
69
 
-
 
70
	public void afficherDetailPersonne(Personne personne) {
81
		if (personne != null) {
Line -... Line 82...
-
 
82
			
71
		if (personne != null) {
83
			
-
 
84
			//MAJ Identité : Configurer les fieldSet
72
			identite.removeAll();
85
			identite.removeAll();
73
			
-
 
-
 
86
			
74
			fsIdentite.setHeading("Identité");
87
			fsIdentite.setHeading("Identité");
75
			fsIdentite.setWidth("350px");
88
			fsIdentite.setWidth("350px");
76
			fsIdentite.setStyleAttribute("padding", "1px");
89
			
-
 
90
			fsContact.setHeading("Contact");
-
 
91
			fsContact.setWidth("350px");
-
 
92
			
-
 
93
			identite.add(fsIdentite);
-
 
94
			
77
			
95
			//La personne peut avoir un logo
Line 78... Line 96...
78
			fsContact.setHeading("Contact");
96
			String logoUrl = (String) personne.obtenirValeurChamp("truk_logo");
-
 
97
			
79
			fsContact.setWidth("350px");
98
			if ((logoUrl!=null)&&(!logoUrl.trim().equals("")))	{
80
			
99
				//Si c'est le cas, on l'affiche sur la même ligne que fsIdentité
Line 81... Line 100...
81
			
100
				Image img = new Image();
82
			identite.add(fsIdentite);
-
 
83
			
101
				img.setUrl(logoUrl);
Line 84... Line 102...
84
			String logoUrl = (String) personne.obtenirValeurChamp("truk_logo");
102
				img.setTitle("logo-personne");
85
			if ((logoUrl!=null)&&(!logoUrl.trim().equals("")))	{
103
				
Line 136... Line 154...
136
			
154
			
Line -... Line 155...
-
 
155
			
-
 
156
			
137
			
157
			//CONTACT
138
			
158
			
139
			//CONTACT
159
			//FIXME : courriel est un champ TRUK
140
			
160
			// on doit afficher N entrées
Line 141... Line 161...
141
			String courriel =  (String) personne.obtenirValeurChamp("truk_courriel");
161
			String courriel =  (String) personne.obtenirValeurChamp("truk_courriel");
Line -... Line 162...
-
 
162
			Hyperlink lnkCourriel = new Hyperlink();
-
 
163
			lnkCourriel.setHTML("<b style=\"margin:0 50px 0 0 ; color:black;\">Courriel:</b><a href=\"mailto:" + courriel + "\">" + courriel + "</a>");
-
 
164
			fsContact.add(lnkCourriel);
142
			Hyperlink lnkCourriel = new Hyperlink();
165
			
143
			lnkCourriel.setHTML("<b style=\"margin:0 50px 0 0 ; color:black;\">Courriel:</b><a href=\"mailto:" + courriel + "\">" + courriel + "</a>");
166
			fsContact.addText("<br >");
Line 144... Line 167...
144
			fsContact.add(lnkCourriel);
167
			
Line 165... Line 188...
165
			ajouterTextFieldNonEditable(fsContact, "Région", region);
188
			ajouterTextFieldNonEditable(fsContact, "Région", region);
Line 166... Line 189...
166
			
189
			
167
			String pays = (String) personne.obtenirValeurChamp("pays");
190
			String pays = (String) personne.obtenirValeurChamp("pays");
Line 168... Line 191...
168
			ajouterTextFieldNonEditable(fsContact, "Pays", pays);
191
			ajouterTextFieldNonEditable(fsContact, "Pays", pays);
Line 169... Line 192...
169
			
192
			
170
			fsContact.addText("<br >");	
193
			fsContact.addText("<br >");	*/
Line 199... Line 222...
199
			//Ajout au fieldSet
222
			//Ajout au fieldSet
200
			fs.add(tf);
223
			fs.add(tf);
201
		}
224
		}
202
	}
225
	}
Line 203... Line -...
203
	
-
 
204
	/*public void visualiserPersonneIdentite()	{
-
 
205
		
-
 
206
		//FieldSet identité
-
 
207
		
-
 
208
		FieldSet fsId = new FieldSet();
-
 
209
		fsId.setHeading("Identité");
-
 
210
		fsId.setLayout(new FormLayout());
-
 
211
		
-
 
212
		visualiser(champsIdentite, fsId);
-
 
213
		
-
 
214
		/*NodeList nl = (NodeList) fsId.getElement().getChildNodes();
-
 
215
		Window.alert(String.valueOf(nl.getLength()));*/
-
 
216
		
-
 
217
		/*identite.add(fsId);
-
 
218
		
-
 
219
		//TEST
-
 
220
		Widget w = (TextField) fsId.getWidget(0);
-
 
221
		
-
 
222
		
-
 
223
		//FieldSet contact
-
 
224
		FieldSet fsContact = new FieldSet();
-
 
225
		fsContact.setHeading("Contact");
-
 
226
		
-
 
227
		
-
 
228
		
-
 
229
	}
-
 
230
	
-
 
231
	public void visualiser(HashMap champs, LayoutContainer lContent)	{
-
 
232
		
-
 
233
		Iterator<String> itNomChamps = champs.keySet().iterator();
-
 
234
		while (itNomChamps.hasNext())	{
-
 
235
			TextField<String> nom = new TextField();
-
 
236
			String cle = itNomChamps.next();
-
 
237
			nom.setFieldLabel(cle);
-
 
238
			nom.setValue((String) champs.get(cle));
-
 
239
			
-
 
240
			//Dans le cas de la visualisation, on ne veut aucun évènement sur la saisie clavier.
-
 
241
			nom.addKeyListener(new KeyListener(){
-
 
242
				public void componentKeyPress(ComponentEvent ev)	{
-
 
243
					ev.stopEvent();
-
 
244
				}
-
 
245
				
-
 
246
			});
-
 
247
			
-
 
248
			lContent.add(nom);
-
 
249
			
-
 
250
	}
-
 
251
		
-
 
252
	}/*/
-
 
253
	
-
 
254
	
226
	
255
	public void rafraichir(Object nouvelleDonnees) {
227
	public void rafraichir(Object nouvelleDonnees) {
256
		if (nouvelleDonnees instanceof Personne) {
228
		if (nouvelleDonnees instanceof Personne) {
257
			afficherDetailPersonne((Personne) nouvelleDonnees);
229
			afficherDetailPersonne((Personne) nouvelleDonnees);
258
		} else if (nouvelleDonnees instanceof StructureListe) {
230
		} else if (nouvelleDonnees instanceof StructureListe) {