Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 352 Rev 356
Line 36... Line 36...
36
 
36
 
37
import com.extjs.gxt.ui.client.widget.TabItem;
37
import com.extjs.gxt.ui.client.widget.TabItem;
38
import com.extjs.gxt.ui.client.widget.TabPanel;
38
import com.extjs.gxt.ui.client.widget.TabPanel;
Line -... Line 39...
-
 
39
import com.extjs.gxt.ui.client.widget.Text;
-
 
40
 
39
import com.extjs.gxt.ui.client.widget.Text;
41
import com.extjs.gxt.ui.client.widget.button.Button;
40
 
42
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
41
import com.extjs.gxt.ui.client.widget.button.IconButton;
43
import com.extjs.gxt.ui.client.widget.button.IconButton;
42
import com.extjs.gxt.ui.client.widget.form.ComboBox;
44
import com.extjs.gxt.ui.client.widget.form.ComboBox;
43
import com.extjs.gxt.ui.client.widget.form.DateField;
45
import com.extjs.gxt.ui.client.widget.form.DateField;
Line 49... Line 51...
49
import com.extjs.gxt.ui.client.widget.form.TextField;
51
import com.extjs.gxt.ui.client.widget.form.TextField;
50
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
52
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
51
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
53
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
52
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
54
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
53
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
55
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
-
 
56
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
54
import com.extjs.gxt.ui.client.widget.layout.FormData;
57
import com.extjs.gxt.ui.client.widget.layout.FormData;
55
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
58
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
-
 
59
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
-
 
60
import com.extjs.gxt.ui.client.widget.layout.TableData;
56
import com.extjs.gxt.ui.client.widget.layout.TableLayout;
61
import com.extjs.gxt.ui.client.widget.layout.TableLayout;
57
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
62
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
58
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
63
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
59
import com.google.gwt.i18n.client.DateTimeFormat;
64
import com.google.gwt.i18n.client.DateTimeFormat;
60
import com.google.gwt.user.client.Window;
65
import com.google.gwt.user.client.Window;
Line 99... Line 104...
99
	
104
	
Line 100... Line 105...
100
	public void initialiserComposants(Personne personne)	{
105
	public void initialiserComposants(Personne personne)	{
Line 101... Line 106...
101
		
106
		
-
 
107
		initialiserPanneau();
Line 102... Line 108...
102
		initialiserPanneau();
108
		
103
		
109
		ButtonBar barreOutilsBas = new ButtonBar();
104
		ToolBar barreOutilsBas = new ToolBar();
110
		barreOutilsBas.setButtonAlign(HorizontalAlignment.CENTER);
Line 358... Line 364...
358
			tiIdentite.add(main);
364
			tiIdentite.add(main);
Line 359... Line 365...
359
			
365
			
360
			// Contact - Téléphone
366
			// Contact - Téléphone
361
			FieldSet fsContactTel = new FieldSet();
367
			FieldSet fsContactTel = new FieldSet();
362
			fsContactTel.setHeading("Contact - Téléphones");
368
			fsContactTel.setHeading("Contact - Téléphones");
363
			fsContactTel.setLayout(new TableLayout(3));
369
			fsContactTel.setLayout(new RowLayout());
Line 364... Line 370...
364
			hmIdentite.put("fsContactTel", fsContactTel);
370
			hmIdentite.put("fsContactTel", fsContactTel);
Line 365... Line 371...
365
			
371
			
-
 
372
			right.add(fsContactTel);
-
 
373
			
-
 
374
			//Téléphone
-
 
375
			LayoutContainer lcTelephone = new LayoutContainer();
-
 
376
			lcTelephone.setLayout(new ColumnLayout());
366
			right.add(fsContactTel);
377
			
367
			
378
			
368
			//Téléphone
379
			
Line 369... Line 380...
369
			TextField tfTelephone = new TextField();
380
			TextField tfTelephone = new TextField();
Line 370... Line 381...
370
			tfTelephone.setFieldLabel("tel");
381
			tfTelephone.setFieldLabel("tel");
371
			fsContactTel.add(tfTelephone);
382
			lcTelephone.add(tfTelephone, new ColumnData(0.40));
Line 378... Line 389...
378
			cbTelephone.setDisplayField("nom");
389
			cbTelephone.setDisplayField("nom");
379
			cbTelephone.setEmptyText("Choisissez:");
390
			cbTelephone.setEmptyText("Choisissez:");
380
			ListStore<Valeur> storeTel = new ListStore<Valeur>();
391
			ListStore<Valeur> storeTel = new ListStore<Valeur>();
381
			cbTelephone.setStore(storeTel);
392
			cbTelephone.setStore(storeTel);
Line 382... Line 393...
382
			
393
			
Line 383... Line 394...
383
			fsContactTel.add(cbTelephone);
394
			lcTelephone.add(cbTelephone, new ColumnData(0.40));
Line 384... Line 395...
384
			
395
			
Line 420... Line 431...
420
							}
431
							}
421
						}
432
						}
422
					}			
433
					}			
423
			);
434
			);
Line -... Line 435...
-
 
435
			
424
			
436
			lcTelephone.add(bAjouter, new ColumnData(0.15));
Line 425... Line 437...
425
			fsContactTel.add(bAjouter);
437
			fsContactTel.add(lcTelephone);
426
			
438
			
427
			//Contact - autres
439
			//Contact - autres
428
			FieldSet fsContact = new FieldSet();
440
			FieldSet fsContact = new FieldSet();
429
			fsContact.setHeading("Contact - Autres");
-
 
430
			fsContact.setId("fsContact");
-
 
431
			
-
 
432
			formLayout = new FormLayout();
441
			fsContact.setHeading("Contact - Autres");
Line 433... Line 442...
433
			formLayout.setLabelAlign(LabelAlign.LEFT);
442
			fsContact.setId("fsContact");
Line 434... Line 443...
434
			fsContact.setLayout(formLayout);
443
			fsContact.setLayout(new RowLayout());
-
 
444
			
-
 
445
			right.add(fsContact);
-
 
446
			
-
 
447
			// Courriels
-
 
448
			LabelField lfCourriel = new LabelField();
-
 
449
			lfCourriel.setFieldLabel("Courriel:");
-
 
450
			lfCourriel.setText("<b>Courriels:</b>");
-
 
451
			
-
 
452
			fsContact.add(lfCourriel);
-
 
453
			
-
 
454
			
-
 
455
			LayoutContainer lcCourriel = new LayoutContainer();
-
 
456
			ColumnLayout clLayout = new ColumnLayout();
-
 
457
			
-
 
458
			
-
 
459
			lcCourriel.setLayout(clLayout);
-
 
460
			TextField tfCourriel = new TextField();
-
 
461
			lcCourriel.add(tfCourriel, new ColumnData(0.80));
-
 
462
			
-
 
463
			// Bouton ajouter
-
 
464
			IconButton bAjouterCourriel = new IconButton(ComposantClass.ICONE_AJOUTER);
435
			
465
			lcCourriel.add(bAjouterCourriel, new ColumnData(0.15));
436
			right.add(fsContact);
466
			
437
			
467
			fsContact.add(lcCourriel);
Line 438... Line 468...
438
			// Courriels
468
			
Line 439... Line 469...
439
			TextArea taCourriel = new TextArea();
469
			TextArea taCourriel = new TextArea();
Line 440... Line 470...
440
			taCourriel.setFieldLabel("Courriels");
470
			taCourriel.setFieldLabel("Courriels");
441
			taCourriel.setEmptyText("Saisissez les adresses courriels séparées par un saut de ligne");
471
			taCourriel.setEmptyText("Saisissez les adresses courriels séparées par un saut de ligne");
442
			
472
			
443
			fsContact.add(taCourriel, fd100);
473
			//fsContact.add(taCourriel, fd100);
444
			
474
			
445
			hmIdentite.put("taCourriel", taCourriel);
475
			hmIdentite.put("taCourriel", taCourriel);
Line 446... Line 476...
446
			
476
			
Line 447... Line 477...
447
			// URLS
477
			// URLS
Line 634... Line 664...
634
	/**
664
	/**
635
	 * Ajouter le bouton Sauvegarder et revenir à la liste à la barre d'outils donnée
665
	 * Ajouter le bouton Sauvegarder et revenir à la liste à la barre d'outils donnée
636
	 * 
666
	 * 
637
	 * @param barreOutils la barre d'outils à modifier
667
	 * @param barreOutils la barre d'outils à modifier
638
	 * */
668
	 * */
639
	public static void ajouterBoutonEnregistrerEtRevenir(ToolBar barreOutils)	{
669
	public static void ajouterBoutonEnregistrerEtRevenir(ButtonBar barreOutils)	{
Line 640... Line 670...
640
		
670
		
641
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
671
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
642
		TextToolItem enregistrer = new TextToolItem("Enregistrer et revenir à la liste");
672
		Button enregistrer = new Button("Enregistrer et revenir à la liste");
643
		enregistrer.setIconStyle(ComposantClass.ICONE_PREFERENCE);
673
		enregistrer.setIconStyle(ComposantClass.ICONE_PREFERENCE);
644
		enregistrer.addSelectionListener(new SelectionListener<ComponentEvent>() {  
674
		enregistrer.addSelectionListener(new SelectionListener<ComponentEvent>() {  
645
			public void componentSelected(ComponentEvent ce) {  
675
			public void componentSelected(ComponentEvent ce) {  
646
				// TODO : Enregistrer le formulaire
676
				// TODO : Enregistrer le formulaire
Line 652... Line 682...
652
	/**
682
	/**
653
	 * Ajouter le bouton Sauvegarder à la barre d'outils donnée
683
	 * Ajouter le bouton Sauvegarder à la barre d'outils donnée
654
	 * 
684
	 * 
655
	 * @param barreOutils la barre d'outils à modifier
685
	 * @param barreOutils la barre d'outils à modifier
656
	 * */
686
	 * */
657
	public static void ajouterBoutonEnregistrer(ToolBar barreOutils)	{
687
	public static void ajouterBoutonEnregistrer(ButtonBar barreOutils)	{
Line 658... Line 688...
658
		
688
		
659
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
689
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
660
		TextToolItem enregistrer = new TextToolItem("Enregistrer");
690
		Button enregistrer = new Button("Enregistrer");
661
		enregistrer.setIconStyle(ComposantClass.ICONE_PREFERENCE);
691
		enregistrer.setIconStyle(ComposantClass.ICONE_PREFERENCE);
662
		enregistrer.setId("main-button");
692
		enregistrer.setId("main-button");
663
		enregistrer.addSelectionListener(new SelectionListener<ComponentEvent>() {  
693
		enregistrer.addSelectionListener(new SelectionListener<ComponentEvent>() {  
664
			public void componentSelected(ComponentEvent ce) {  
694
			public void componentSelected(ComponentEvent ce) {  
Line 671... Line 701...
671
	/**
701
	/**
672
	 * Ajouter le bouton annuler à la barre d'outils donnée
702
	 * Ajouter le bouton annuler à la barre d'outils donnée
673
	 * 
703
	 * 
674
	 * @param barreOutils la barre d'outils à modifier
704
	 * @param barreOutils la barre d'outils à modifier
675
	 * */
705
	 * */
676
	public static void ajouterBoutonAnnuler(ToolBar barreOutils)	{
706
	public static void ajouterBoutonAnnuler(ButtonBar barreOutils)	{
Line 677... Line 707...
677
		
707
		
678
		// Le bouton annuler ne sauvegarde pas les informations et renvoie vers la page précédente
708
		// Le bouton annuler ne sauvegarde pas les informations et renvoie vers la page précédente
679
		TextToolItem annuler = new TextToolItem("Revenir à la liste");
709
		Button annuler = new Button("Revenir à la liste");
680
		annuler.addSelectionListener(new SelectionListener<ComponentEvent>() {  
710
		annuler.addSelectionListener(new SelectionListener<ComponentEvent>() {  
681
			public void componentSelected(ComponentEvent ce) {  
711
			public void componentSelected(ComponentEvent ce) {  
682
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicMenu("Personnes");
712
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicMenu("Personnes");
683
			}  
713
			}  
Line 984... Line 1014...
984
				hfTelephone.setValue(strTelephone);
1014
				hfTelephone.setValue(strTelephone);
985
				hmIdentite.put("hidden-" + strTelephone, hfTelephone);
1015
				hmIdentite.put("hidden-" + strTelephone, hfTelephone);
Line 986... Line 1016...
986
				
1016
				
Line -... Line 1017...
-
 
1017
				FieldSet fsContactTel = (FieldSet) hmIdentite.get("fsContactTel");
-
 
1018
				
-
 
1019
				LayoutContainer lcTelephone = new LayoutContainer();
987
				FieldSet fsContactTel = (FieldSet) hmIdentite.get("fsContactTel");
1020
				lcTelephone.setLayout(new ColumnLayout());
988
				
1021
				
Line 989... Line 1022...
989
				Text tTypeTelephone = new Text();
1022
				Text tTypeTelephone = new Text();
990
				tTypeTelephone.setText(strValeurTypeTel+":");
1023
				tTypeTelephone.setText(strValeurTypeTel+":");
Line 991... Line 1024...
991
				
1024
				
992
				hmIdentite.put("type-" + strTelephone, tTypeTelephone);
1025
				hmIdentite.put("type-" + strTelephone, tTypeTelephone);
993
				fsContactTel.add(tTypeTelephone);
1026
				lcTelephone.add(tTypeTelephone, new ColumnData(0.40));
994
				
1027
				
Line 995... Line 1028...
995
				Text tTelephone = new Text();
1028
				Text tTelephone = new Text();
996
				tTelephone.setText(strTelephone);
1029
				tTelephone.setText(strTelephone);
Line 997... Line 1030...
997
				hmIdentite.put("tel-" + strTelephone, tTelephone);
1030
				hmIdentite.put("tel-" + strTelephone, tTelephone);
998
				fsContactTel.add(tTelephone);
1031
				lcTelephone.add(tTelephone, new ColumnData(0.40));
Line 999... Line 1032...
999
				
1032
				
1000
				IconButton bSupprimer = new IconButton(ComposantClass.ICONE_SUPPRIMER);
1033
				IconButton bSupprimer = new IconButton(ComposantClass.ICONE_SUPPRIMER);
Line 1001... Line 1034...
1001
				bSupprimer.setId(strTelephone);
1034
				bSupprimer.setId(strTelephone);
1002
				
1035
				
Line 1003... Line 1036...
1003
				bSupprimer.addSelectionListener(new SelectionListener<ComponentEvent>() {
1036
				bSupprimer.addSelectionListener(new SelectionListener<ComponentEvent>() {
1004
						public void componentSelected(ComponentEvent ce) {
1037
						public void componentSelected(ComponentEvent ce) {
Line 1005... Line 1038...
1005
							
1038
							
1006
							String strTelephone = ce.component.getId();
1039
							String strTelephone = ce.component.getId();
Line 1007... Line 1040...
1007
							FieldSet fsContactTel = (FieldSet) hmIdentite.get("fsContactTel");
1040
							LayoutContainer lcContactTel = (LayoutContainer) hmIdentite.get("lc-"+strTelephone);
-
 
1041
							
-
 
1042
							lcContactTel.remove(hmIdentite.get("type-" + strTelephone));
-
 
1043
							hmIdentite.remove("type-" + strTelephone);
-
 
1044
							
Line 1008... Line 1045...
1008
							
1045
							lcContactTel.remove(hmIdentite.get("tel-" + strTelephone));
Line 1009... Line 1046...
1009
							fsContactTel.remove(hmIdentite.get("type-" + strTelephone));
1046
							hmIdentite.remove("tel-" + strTelephone);
1010
							hmIdentite.remove("type-" + strTelephone);
1047
							
Line -... Line 1048...
-
 
1048
							((TabItem) hmIdentite.get("tiIdentite")).remove(hmIdentite.get("hidden-" + strTelephone));
-
 
1049
							hmIdentite.remove("hidden-" + strTelephone);
-
 
1050
							
1011
							
1051
							lcContactTel.remove(ce.component);
Line 1012... Line 1052...
1012
							fsContactTel.remove(hmIdentite.get("tel-" + strTelephone));
1052
							
Line 1013... Line 1053...
1013
							hmIdentite.remove("tel-" + strTelephone);
1053