Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 2734 Rev 2737
Line 91... Line 91...
91
	private AutoCompletionComboBox lieudit = null;
91
	private AutoCompletionComboBox lieudit = null;
92
	private AutoCompletionComboBox station = null;
92
	private AutoCompletionComboBox station = null;
93
	private AutoCompletionComboBox milieu = null;
93
	private AutoCompletionComboBox milieu = null;
94
	private TextField comment = null;
94
	private TextField comment = null;
95
	private AutoCompletionComboBox  localite = null;
95
	private AutoCompletionComboBox  localite = null;
96
	private Button effacerLocalite = null;
-
 
Line 97... Line 96...
97
	
96
	
98
	private String codeLocalite = null;
97
	private String codeLocalite = null;
Line 99... Line 98...
99
	private String pays = null;
98
	private String pays = null;
Line 339... Line 338...
339
				verifierPresenceTaxonSaisi();
338
				verifierPresenceTaxonSaisi();
340
			}
339
			}
Line 341... Line 340...
341
			
340
			
342
			@Override
341
			@Override
343
			protected void onModificationValeur() {
342
			protected void onModificationValeur() {
344
				localiteModifiee = true;
343
				localiteModifiee = true;	
345
				verifierPresenceTaxonSaisi();
344
				verifierPresenceTaxonSaisi();
Line 346... Line 345...
346
			}
345
			}
347
 
346
 
348
			@Override
347
			@Override
349
			public void onValidationSaisie() {
348
			public void onValidationSaisie() {
350
				validerSaisie(Champs.LOCALITE);
349
				validerSaisie(Champs.LOCALITE);
Line 351... Line -...
351
			}
-
 
352
		};
-
 
353
 
-
 
354
		// Bouton pour supprimer totalement la localisation d'une obs (zone géo + coords)
-
 
355
		effacerLocalite = new Button("X", new ButtonListenerAdapter() {
-
 
356
			public void onClick(Button button, EventObject e) {
-
 
357
				localite.setText("");
-
 
358
				localite.setValue("");
-
 
359
				localiteModifiee = true;
-
 
360
				latitude.setValue("");
-
 
361
				latModifiee = true;
-
 
362
				longitude.setValue("");
-
 
363
				longModifiee = true;
-
 
364
				altitude.setValue("");
-
 
365
				altModifiee = true;
-
 
Line 366... Line 350...
366
			}
350
			}
367
		});
351
		};
368
		effacerLocalite.setTooltip("Supprimer la localisation de l'observation (localité, coordonnées, altitude)");
352
 
Line 377... Line 361...
377
		tip2.applyTo(basculerverscarto.getElement());
361
		tip2.applyTo(basculerverscarto.getElement());
Line 378... Line 362...
378
 
362
 
379
		//Sur une meme ligne, ajout de plusieurs champs
363
		//Sur une meme ligne, ajout de plusieurs champs
Line 380... Line 364...
380
		htmllocalitePanel = new MultiFieldPanel();
364
		htmllocalitePanel = new MultiFieldPanel();
381
 
365
 
382
		//int largeurlocalite = Window.getClientWidth()/5;
-
 
383
		htmllocalitePanel.addToRow(localite, 280);
366
		int largeurlocalite = Window.getClientWidth()/4;
Line 384... Line 367...
384
		htmllocalitePanel.addToRow(effacerLocalite, 150);
367
		htmllocalitePanel.addToRow(localite, largeurlocalite);
385
		htmllocalitePanel.addToRow(basculerverscarto, 130);
368
		htmllocalitePanel.addToRow(basculerverscarto, 160);
Line 386... Line 369...
386
 
369
 
Line 533... Line 516...
533
			protected void onModificationValeur() {
516
			protected void onModificationValeur() {
534
				especeModifiee = true;	
517
				especeModifiee = true;	
535
				// Pour éviter qu'un mauvais nn ne soit gardé lors d'une modification
518
				// Pour éviter qu'un mauvais nn ne soit gardé lors d'une modification
536
				// vers un nom ne faisant pas partie du référentiel
519
				// vers un nom ne faisant pas partie du référentiel
537
				numeroNom = null;
520
				numeroNom = null;
538
				String cle = espece.getValue();
-
 
539
				if(referentielNom.containsKey(cle)) {
521
				if(referentielNom.containsKey(espece.getText())) {
540
					numeroNom = referentielNom.get(cle).getNumeroNom();
522
					numeroNom = referentielNom.get(espece.getText()).getNumeroNom();
541
				}
523
				}
542
				verifierPresenceTaxonSaisi();
524
				verifierPresenceTaxonSaisi();
543
			}
525
			}
Line 544... Line 526...
544
 
526
 
Line 551... Line 533...
551
			protected String preTraiterUrlRequete(String urlRequete, String valeur) {
533
			protected String preTraiterUrlRequete(String urlRequete, String valeur) {
552
				return ListeReferentielNomAsynchroneDAO.formaterUrlAutoCompletionReferentielNom(urlRequete, referentielTaxo, valeur);
534
				return ListeReferentielNomAsynchroneDAO.formaterUrlAutoCompletionReferentielNom(urlRequete, referentielTaxo, valeur);
553
			}
535
			}
Line 554... Line 536...
554
			
536
			
555
			@Override
537
			@Override
556
			protected String preTraiterValeurAvantAffichage(String cle) {
538
			protected String preTraiterValeurAvantAffichage(String valeur) {
557
				ReferentielNom nomValeur = referentielNom.get(cle);
539
				ReferentielNom nomValeur = referentielNom.get(valeur);
558
				String valeurAffichee = nomValeur.getNom();
540
				String valeurAffichee = nomValeur.getNom();
559
				// Pour afficher les noms retenus en gras
541
				// Pour afficher les noms retenus en gras
560
				if (nomValeur.estRetenu()) {
542
				if (nomValeur.estRetenu()) {
561
					valeurAffichee = "<span class=\"nomRetenu\">"+nomValeur.getNom().trim()+"</span>";
543
					valeurAffichee = "<span class=\"nomRetenu\">"+nomValeur.getNom().trim()+"</span>";
Line 779... Line 761...
779
		ajouterToolTipsBoutons();
761
		ajouterToolTipsBoutons();
780
		saisieTabindex();
762
		saisieTabindex();
781
	}
763
	}
Line 782... Line 764...
782
	
764
	
783
	protected void surSelectionEspece() {
-
 
784
		//String cle = espece.getText();
-
 
785
		String cle = espece.getValue();
765
	protected void surSelectionEspece() {
786
		ReferentielNom nom = referentielNom.get(cle);
-
 
787
		// Bricolage immonde : sans ça, la combobox affiche la clef au lieu d'afficher
-
 
788
		// la valeur - WTF?? - pas trouvé moyen de faire mieux (attention aux effets
-
 
789
		// de bord dégueus)
-
 
790
		espece.setText(nom.getNom());
-
 
791
		// retour à la vie normale
766
		ReferentielNom nom = referentielNom.get(espece.getText());
792
		numeroNom = nom.getNumeroNom();
767
		numeroNom = nom.getNumeroNom();
793
		selectionEspece = true;
768
		selectionEspece = true;
794
		observationMediateur.obtenirImageInformationExternes(referentielTaxo, numeroNom);
769
		observationMediateur.obtenirImageInformationExternes(referentielTaxo, numeroNom);