Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 473 Rev 488
Line 21... Line 21...
21
import org.tela_botanica.client.modeles.Projet;
21
import org.tela_botanica.client.modeles.Projet;
22
import org.tela_botanica.client.modeles.ProjetListe;
22
import org.tela_botanica.client.modeles.ProjetListe;
23
import org.tela_botanica.client.modeles.Valeur;
23
import org.tela_botanica.client.modeles.Valeur;
24
import org.tela_botanica.client.modeles.ValeurListe;
24
import org.tela_botanica.client.modeles.ValeurListe;
Line 25... Line 25...
25
 
25
 
26
import com.extjs.gxt.ui.client.Events;
26
import com.extjs.gxt.ui.client.event.Events;
27
import com.extjs.gxt.ui.client.Registry;
27
import com.extjs.gxt.ui.client.Registry;
28
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
28
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
Line 29... Line 29...
29
import com.extjs.gxt.ui.client.Style.Scroll;
29
import com.extjs.gxt.ui.client.Style.Scroll;
Line -... Line 30...
-
 
30
 
30
 
31
import com.extjs.gxt.ui.client.binding.FormBinding;
-
 
32
 
31
import com.extjs.gxt.ui.client.binding.FormBinding;
33
import com.extjs.gxt.ui.client.event.ButtonEvent;
32
 
34
import com.extjs.gxt.ui.client.event.ComponentEvent;
33
import com.extjs.gxt.ui.client.event.ComponentEvent;
35
import com.extjs.gxt.ui.client.event.IconButtonEvent;
34
import com.extjs.gxt.ui.client.event.KeyListener;
36
import com.extjs.gxt.ui.client.event.KeyListener;
35
import com.extjs.gxt.ui.client.event.Listener;
37
import com.extjs.gxt.ui.client.event.Listener;
Line 63... Line 65...
63
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
65
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
64
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
66
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
65
import com.extjs.gxt.ui.client.widget.layout.FormData;
67
import com.extjs.gxt.ui.client.widget.layout.FormData;
66
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
68
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
67
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
69
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
68
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
70
import com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem;
69
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
71
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
70
import com.google.gwt.core.client.GWT;
72
import com.google.gwt.core.client.GWT;
71
import com.google.gwt.i18n.client.DateTimeFormat;
73
import com.google.gwt.i18n.client.DateTimeFormat;
72
import com.google.gwt.user.client.Window;
74
import com.google.gwt.user.client.Window;
73
import com.google.gwt.user.client.ui.Widget;
75
import com.google.gwt.user.client.ui.Widget;
Line 114... Line 116...
114
		personneSauvegarde = new Personne();
116
		personneSauvegarde = new Personne();
Line 115... Line 117...
115
		
117
		
Line 116... Line 118...
116
		initialiserPanneau();
118
		initialiserPanneau();
117
		
119
		
-
 
120
		ButtonBar barreOutilsBas = new ButtonBar();
Line 118... Line 121...
118
		ButtonBar barreOutilsBas = new ButtonBar();
121
		//barreOutilsBas.setButtonAlign(HorizontalAlignment.CENTER);
119
		barreOutilsBas.setButtonAlign(HorizontalAlignment.CENTER);
122
		barreOutilsBas.setAlignment(HorizontalAlignment.CENTER);
120
		
123
		
Line 366... Line 369...
366
					rbEstDecedee.setBoxLabel("oui");
369
					rbEstDecedee.setBoxLabel("oui");
Line 367... Line 370...
367
					
370
					
Line 368... Line 371...
368
					rbEstDecedee.addListener(Events.Change, new Listener<ComponentEvent>() {
371
					rbEstDecedee.addListener(Events.Change, new Listener<ComponentEvent>() {
369
						
372
						
370
						public void handleEvent(ComponentEvent be) {
373
						public void handleEvent(ComponentEvent be) {
371
							if(((Radio) be.component).getValue().equals(true))	{
374
							if(((Radio) be.getComponent()).getValue().equals(true))	{
372
								((DateField) hmIdentite.get("dfDateDeces")).setVisible(true);
375
								((DateField) hmIdentite.get("dfDateDeces")).setVisible(true);
373
								((TextField) hmIdentite.get("tfLieuDeces")).setVisible(true);
376
								((TextField) hmIdentite.get("tfLieuDeces")).setVisible(true);
374
							} else	{
377
							} else	{
Line 440... Line 443...
440
			
443
			
Line 441... Line 444...
441
						mediateur.obtenirListeValeurEtRafraichir(this, "tel");
444
						mediateur.obtenirListeValeurEtRafraichir(this, "tel");
442
			
445
			
443
						IconButton bAjouter = new IconButton(ComposantClass.ICONE_AJOUTER);
446
						IconButton bAjouter = new IconButton(ComposantClass.ICONE_AJOUTER);
444
						bAjouter.addSelectionListener(
447
						bAjouter.addSelectionListener(
Line 445... Line 448...
445
								new SelectionListener<ComponentEvent>() {
448
								new SelectionListener<IconButtonEvent>() {
446
									public void componentSelected(ComponentEvent ce) {
449
									public void componentSelected(IconButtonEvent ce) {
447
			
450
			
448
										String strTelephone = ((TextField<String>) hmIdentite.get("tfTelephone")).getValue();
451
										String strTelephone = ((TextField<String>) hmIdentite.get("tfTelephone")).getValue();
Line 508... Line 511...
508
						hmIdentite.put("hfHiddenCourriel", hfHiddenCourriel);
511
						hmIdentite.put("hfHiddenCourriel", hfHiddenCourriel);
509
						hmIdentite.put("tfCourriel", tfCourriel);
512
						hmIdentite.put("tfCourriel", tfCourriel);
Line 510... Line 513...
510
			
513
			
511
						IconButton bAjouterCourriel = new IconButton(ComposantClass.ICONE_AJOUTER);
514
						IconButton bAjouterCourriel = new IconButton(ComposantClass.ICONE_AJOUTER);
512
						bAjouterCourriel.addSelectionListener(
515
						bAjouterCourriel.addSelectionListener(
Line 513... Line 516...
513
								new SelectionListener<ComponentEvent>() {
516
								new SelectionListener<IconButtonEvent>() {
Line 514... Line 517...
514
						
517
						
515
									public void componentSelected(ComponentEvent ce) {
518
									public void componentSelected(IconButtonEvent ce) {
516
										
519
										
517
										String strEmail = ((TextField<String>) hmIdentite.get("tfCourriel")).getValue();
520
										String strEmail = ((TextField<String>) hmIdentite.get("tfCourriel")).getValue();
Line 562... Line 565...
562
			
565
			
563
						lcUrl.add(tfUrl, new ColumnData(0.8));
566
						lcUrl.add(tfUrl, new ColumnData(0.8));
Line 564... Line 567...
564
						hmIdentite.put("tfUrl", tfUrl);
567
						hmIdentite.put("tfUrl", tfUrl);
565
			
568
			
Line 566... Line 569...
566
						IconButton ibAjouterUrl = new IconButton(ComposantClass.ICONE_AJOUTER);
569
						IconButton ibAjouterUrl = new IconButton(ComposantClass.ICONE_AJOUTER);
Line 567... Line 570...
567
						ibAjouterUrl.addSelectionListener(new SelectionListener<ComponentEvent>() {
570
						ibAjouterUrl.addSelectionListener(new SelectionListener<IconButtonEvent>() {
568
 
571
 
Line 569... Line 572...
569
							public void componentSelected(ComponentEvent ce) {
572
							public void componentSelected(IconButtonEvent ce) {
Line 655... Line 658...
655
	
658
	
656
				lcUrlLogo.add(tfUrlLogo, new ColumnData(0.8));
659
				lcUrlLogo.add(tfUrlLogo, new ColumnData(0.8));
Line 657... Line 660...
657
				hmIdentite.put("tfUrlLogo", tfUrlLogo);
660
				hmIdentite.put("tfUrlLogo", tfUrlLogo);
658
	
661
	
Line 659... Line 662...
659
				IconButton ibAjouterUrlLogo = new IconButton(ComposantClass.ICONE_AJOUTER);
662
				IconButton ibAjouterUrlLogo = new IconButton(ComposantClass.ICONE_AJOUTER);
Line 660... Line 663...
660
				ibAjouterUrlLogo.addSelectionListener(new SelectionListener<ComponentEvent>() {
663
				ibAjouterUrlLogo.addSelectionListener(new SelectionListener<IconButtonEvent>() {
661
 
664
 
Line 662... Line 665...
662
					public void componentSelected(ComponentEvent ce) {
665
					public void componentSelected(IconButtonEvent ce) {
Line 704... Line 707...
704
				public void componentKeyUp(ComponentEvent ev)	{
707
				public void componentKeyUp(ComponentEvent ev)	{
705
					rafraichir(null);	
708
					rafraichir(null);	
706
				}				
709
				}				
707
			};
710
			};
Line 708... Line 711...
708
			
711
			
709
			SelectionChangedListener<InterneValeur> selectionChange = new SelectionChangedListener<InterneValeur>() {
712
			SelectionChangedListener<Valeur> selectionChange = new SelectionChangedListener<Valeur>() {
710
				public void selectionChanged(SelectionChangedEvent se) {
713
				public void selectionChanged(SelectionChangedEvent se) {
711
						rafraichir(null);
714
						rafraichir(null);
712
					}
715
					}
Line 826... Line 829...
826
	 * @param barreOutils la barre d'outils à modifier
829
	 * @param barreOutils la barre d'outils à modifier
827
	 * */
830
	 * */
828
	public void ajouterBoutonReinitialiser(ToolBar barreOutils)	{
831
	public void ajouterBoutonReinitialiser(ToolBar barreOutils)	{
Line 829... Line 832...
829
		
832
		
830
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
833
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
831
		TextToolItem reinitialiser = new TextToolItem("Réinitialiser le formulaire");
834
		Button reinitialiser = new Button("Réinitialiser le formulaire");
832
		reinitialiser.setIconStyle(ComposantClass.ICONE_RAFRAICHIR);
835
		reinitialiser.setIconStyle(ComposantClass.ICONE_RAFRAICHIR);
833
		reinitialiser.addSelectionListener(new SelectionListener<ComponentEvent>() {  
836
		reinitialiser.addSelectionListener(new SelectionListener<ButtonEvent>() {  
834
			public void componentSelected(ComponentEvent ce) {  
837
			public void componentSelected(ButtonEvent ce) {  
835
				//((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicAjouterPersonne();
838
				//((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicAjouterPersonne();
836
				reinitialiser();
839
				reinitialiser();
837
				//System.out.println(personneSelectionnee);
840
				//System.out.println(personneSelectionnee);
838
			}  
841
			}  
Line 848... Line 851...
848
	private void ajouterBoutonEnregistrerEtRevenir(ButtonBar barreOutils)	{
851
	private void ajouterBoutonEnregistrerEtRevenir(ButtonBar barreOutils)	{
Line 849... Line 852...
849
		
852
		
850
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
853
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
851
		Button enregistrer = new Button("Enregistrer et revenir à la liste");
854
		Button enregistrer = new Button("Enregistrer et revenir à la liste");
852
		enregistrer.setIconStyle(ComposantClass.ICONE_PREFERENCE);
855
		enregistrer.setIconStyle(ComposantClass.ICONE_PREFERENCE);
853
		enregistrer.addSelectionListener(new SelectionListener<ComponentEvent>() {  
856
		enregistrer.addSelectionListener(new SelectionListener<ButtonEvent>() {  
Line 854... Line 857...
854
			public void componentSelected(ComponentEvent ce) {  
857
			public void componentSelected(ButtonEvent ce) {  
855
				
858
				
856
			}  
859
			}  
Line 871... Line 874...
871
		
874
		
872
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
875
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
873
		Button enregistrer = new Button("Enregistrer");
876
		Button enregistrer = new Button("Enregistrer");
874
		enregistrer.setIconStyle(ComposantClass.ICONE_PREFERENCE);
877
		enregistrer.setIconStyle(ComposantClass.ICONE_PREFERENCE);
875
		enregistrer.setId("main-button");
878
		enregistrer.setId("main-button");
876
		enregistrer.addSelectionListener(new SelectionListener<ComponentEvent>() {  
879
		enregistrer.addSelectionListener(new SelectionListener<ButtonEvent>() {  
877
			public void componentSelected(ComponentEvent ce) {  
880
			public void componentSelected(ButtonEvent ce) {  
878
				enregistrer();
881
				enregistrer();
879
			}  
882
			}  
880
		});
883
		});
Line 891... Line 894...
891
	 * */
894
	 * */
892
	public static void ajouterBoutonAnnuler(ButtonBar barreOutils)	{
895
	public static void ajouterBoutonAnnuler(ButtonBar barreOutils)	{
Line 893... Line 896...
893
		
896
		
894
		// Le bouton annuler ne sauvegarde pas les informations et renvoie vers la page précédente
897
		// Le bouton annuler ne sauvegarde pas les informations et renvoie vers la page précédente
895
		Button annuler = new Button("Revenir à la liste");
898
		Button annuler = new Button("Revenir à la liste");
896
		annuler.addSelectionListener(new SelectionListener<ComponentEvent>() {  
899
		annuler.addSelectionListener(new SelectionListener<ButtonEvent>() {  
897
			public void componentSelected(ComponentEvent ce) {  
900
			public void componentSelected(ButtonEvent ce) {  
898
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicMenu("Personnes");
901
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicMenu("Personnes");
899
			}  
902
			}  
900
		});
903
		});
901
		annuler.setIconStyle(ComposantClass.ICONE_SUPPRIMER);
904
		annuler.setIconStyle(ComposantClass.ICONE_SUPPRIMER);
Line 1276... Line 1279...
1276
				lcTelephone.add(tTelephone, new ColumnData(0.40));
1279
				lcTelephone.add(tTelephone, new ColumnData(0.40));
Line 1277... Line 1280...
1277
				
1280
				
1278
				IconButton bSupprimer = new IconButton(ComposantClass.ICONE_SUPPRIMER);
1281
				IconButton bSupprimer = new IconButton(ComposantClass.ICONE_SUPPRIMER);
Line 1279... Line 1282...
1279
				bSupprimer.setId(strIdTelephone);
1282
				bSupprimer.setId(strIdTelephone);
1280
				
1283
				
Line 1281... Line 1284...
1281
				bSupprimer.addSelectionListener(new SelectionListener<ComponentEvent>() {
1284
				bSupprimer.addSelectionListener(new SelectionListener<IconButtonEvent>() {
1282
						public void componentSelected(ComponentEvent ce) {
1285
						public void componentSelected(IconButtonEvent ce) {
Line 1283... Line 1286...
1283
							
1286
							
1284
							String strIdTelephone = ce.component.getId();
1287
							String strIdTelephone = ce.getComponent().getId();
Line 1285... Line 1288...
1285
							LayoutContainer lcContactTel = (LayoutContainer) hmIdentite.get("lc-"+strIdTelephone);
1288
							LayoutContainer lcContactTel = (LayoutContainer) hmIdentite.get("lc-"+strIdTelephone);
1286
							
1289
							
Line 1287... Line 1290...
1287
							lcContactTel.remove(hmIdentite.get("type-" + strIdTelephone));
1290
							lcContactTel.remove(hmIdentite.get("type-" + strIdTelephone));
Line 1288... Line 1291...
1288
							hmIdentite.remove("type-" + strIdTelephone);
1291
							hmIdentite.remove("type-" + strIdTelephone);
1289
							
1292
							
Line 1290... Line 1293...
1290
							lcContactTel.remove(hmIdentite.get("tel-" + strIdTelephone));
1293
							lcContactTel.remove(hmIdentite.get("tel-" + strIdTelephone));
Line 1343... Line 1346...
1343
			hmIdentite.put("lc-" + strEmail, lcCourriel);
1346
			hmIdentite.put("lc-" + strEmail, lcCourriel);
Line 1344... Line 1347...
1344
			
1347
			
1345
			//Bouton supprimer
1348
			//Bouton supprimer
1346
			IconButton btnSupprimerCourriel = new IconButton(ComposantClass.ICONE_SUPPRIMER);
1349
			IconButton btnSupprimerCourriel = new IconButton(ComposantClass.ICONE_SUPPRIMER);
1347
			btnSupprimerCourriel.setId(strEmail);
1350
			btnSupprimerCourriel.setId(strEmail);
Line 1348... Line 1351...
1348
			btnSupprimerCourriel.addSelectionListener(new SelectionListener<ComponentEvent>() {
1351
			btnSupprimerCourriel.addSelectionListener(new SelectionListener<IconButtonEvent>() {
1349
				
1352
				
1350
				public void componentSelected(ComponentEvent ce) {
1353
				public void componentSelected(IconButtonEvent ce) {
1351
					//Suppression de l'adresse email
1354
					//Suppression de l'adresse email
1352
					String strEmail = ce.component.getId();
1355
					String strEmail = ce.getComponent().getId();
1353
					LayoutContainer lcCourrielContainer = (LayoutContainer) hmIdentite.get("lcCourrielContainer");
1356
					LayoutContainer lcCourrielContainer = (LayoutContainer) hmIdentite.get("lcCourrielContainer");
Line 1354... Line 1357...
1354
					LayoutContainer lcCourriel = (LayoutContainer) hmIdentite.get("lc-" + strEmail);
1357
					LayoutContainer lcCourriel = (LayoutContainer) hmIdentite.get("lc-" + strEmail);
Line 1399... Line 1402...
1399
		
1402
		
Line 1400... Line 1403...
1400
		lcUrl.add(tUrl, new ColumnData(0.8));
1403
		lcUrl.add(tUrl, new ColumnData(0.8));
1401
		
1404
		
1402
		IconButton ibSupprimerUrl = new IconButton(ComposantClass.ICONE_SUPPRIMER);
1405
		IconButton ibSupprimerUrl = new IconButton(ComposantClass.ICONE_SUPPRIMER);
Line 1403... Line 1406...
1403
		ibSupprimerUrl.setId(strUrl);
1406
		ibSupprimerUrl.setId(strUrl);
Line 1404... Line 1407...
1404
		ibSupprimerUrl.addSelectionListener(new SelectionListener<ComponentEvent>() {
1407
		ibSupprimerUrl.addSelectionListener(new SelectionListener<IconButtonEvent>() {
1405
 
1408
 
1406
			public void componentSelected(ComponentEvent ce) {
1409
			public void componentSelected(IconButtonEvent ce) {
1407
				
1410
				
Line 1408... Line 1411...
1408
				//Suppression url
1411
				//Suppression url
Line 1453... Line 1456...
1453
		
1456
		
Line 1454... Line 1457...
1454
		lcUrl.add(tUrl, new ColumnData(0.8));
1457
		lcUrl.add(tUrl, new ColumnData(0.8));
1455
		
1458
		
1456
		IconButton ibSupprimerUrl = new IconButton(ComposantClass.ICONE_SUPPRIMER);
1459
		IconButton ibSupprimerUrl = new IconButton(ComposantClass.ICONE_SUPPRIMER);
Line 1457... Line 1460...
1457
		ibSupprimerUrl.setId(strUrl);
1460
		ibSupprimerUrl.setId(strUrl);
Line 1458... Line 1461...
1458
		ibSupprimerUrl.addSelectionListener(new SelectionListener<ComponentEvent>() {
1461
		ibSupprimerUrl.addSelectionListener(new SelectionListener<IconButtonEvent>() {
1459
 
1462
 
1460
			public void componentSelected(ComponentEvent ce) {
1463
			public void componentSelected(IconButtonEvent ce) {
1461
				
1464
				
Line 1462... Line 1465...
1462
				//Suppression url
1465
				//Suppression url