Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 2724 Rev 2734
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 96... Line 97...
96
	
97
	
97
	private String codeLocalite = null;
98
	private String codeLocalite = null;
Line 98... Line 99...
98
	private String pays = null;
99
	private String pays = null;
Line 338... Line 339...
338
				verifierPresenceTaxonSaisi();
339
				verifierPresenceTaxonSaisi();
339
			}
340
			}
Line 340... Line 341...
340
			
341
			
341
			@Override
342
			@Override
342
			protected void onModificationValeur() {
343
			protected void onModificationValeur() {
343
				localiteModifiee = true;	
344
				localiteModifiee = true;
344
				verifierPresenceTaxonSaisi();
345
				verifierPresenceTaxonSaisi();
Line 345... Line 346...
345
			}
346
			}
346
 
347
 
347
			@Override
348
			@Override
348
			public void onValidationSaisie() {
349
			public void onValidationSaisie() {
349
				validerSaisie(Champs.LOCALITE);
350
				validerSaisie(Champs.LOCALITE);
Line -... Line 351...
-
 
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 350... Line 366...
350
			}
366
			}
351
		};
367
		});
352
 
368
		effacerLocalite.setTooltip("Supprimer la localisation de l'observation (localité, coordonnées, altitude)");
Line 361... Line 377...
361
		tip2.applyTo(basculerverscarto.getElement());
377
		tip2.applyTo(basculerverscarto.getElement());
Line 362... Line 378...
362
 
378
 
363
		//Sur une meme ligne, ajout de plusieurs champs
379
		//Sur une meme ligne, ajout de plusieurs champs
Line 364... Line 380...
364
		htmllocalitePanel = new MultiFieldPanel();
380
		htmllocalitePanel = new MultiFieldPanel();
365
 
381
 
-
 
382
		//int largeurlocalite = Window.getClientWidth()/5;
366
		int largeurlocalite = Window.getClientWidth()/4;
383
		htmllocalitePanel.addToRow(localite, 280);
Line 367... Line 384...
367
		htmllocalitePanel.addToRow(localite, largeurlocalite);
384
		htmllocalitePanel.addToRow(effacerLocalite, 150);
368
		htmllocalitePanel.addToRow(basculerverscarto, 160);
385
		htmllocalitePanel.addToRow(basculerverscarto, 130);
Line 369... Line 386...
369
 
386
 
Line 516... Line 533...
516
			protected void onModificationValeur() {
533
			protected void onModificationValeur() {
517
				especeModifiee = true;	
534
				especeModifiee = true;	
518
				// Pour éviter qu'un mauvais nn ne soit gardé lors d'une modification
535
				// Pour éviter qu'un mauvais nn ne soit gardé lors d'une modification
519
				// vers un nom ne faisant pas partie du référentiel
536
				// vers un nom ne faisant pas partie du référentiel
520
				numeroNom = null;
537
				numeroNom = null;
-
 
538
				String cle = espece.getValue();
521
				if(referentielNom.containsKey(espece.getText())) {
539
				if(referentielNom.containsKey(cle)) {
522
					numeroNom = referentielNom.get(espece.getText()).getNumeroNom();
540
					numeroNom = referentielNom.get(cle).getNumeroNom();
523
				}
541
				}
524
				verifierPresenceTaxonSaisi();
542
				verifierPresenceTaxonSaisi();
525
			}
543
			}
Line 526... Line 544...
526
 
544
 
Line 533... Line 551...
533
			protected String preTraiterUrlRequete(String urlRequete, String valeur) {
551
			protected String preTraiterUrlRequete(String urlRequete, String valeur) {
534
				return ListeReferentielNomAsynchroneDAO.formaterUrlAutoCompletionReferentielNom(urlRequete, referentielTaxo, valeur);
552
				return ListeReferentielNomAsynchroneDAO.formaterUrlAutoCompletionReferentielNom(urlRequete, referentielTaxo, valeur);
535
			}
553
			}
Line 536... Line 554...
536
			
554
			
537
			@Override
555
			@Override
538
			protected String preTraiterValeurAvantAffichage(String valeur) {
556
			protected String preTraiterValeurAvantAffichage(String cle) {
539
				ReferentielNom nomValeur = referentielNom.get(valeur);
557
				ReferentielNom nomValeur = referentielNom.get(cle);
540
				String valeurAffichee = nomValeur.getNom();
558
				String valeurAffichee = nomValeur.getNom();
541
				// Pour afficher les noms retenus en gras
559
				// Pour afficher les noms retenus en gras
542
				if (nomValeur.estRetenu()) {
560
				if (nomValeur.estRetenu()) {
543
					valeurAffichee = "<span class=\"nomRetenu\">"+nomValeur.getNom().trim()+"</span>";
561
					valeurAffichee = "<span class=\"nomRetenu\">"+nomValeur.getNom().trim()+"</span>";
Line 761... Line 779...
761
		ajouterToolTipsBoutons();
779
		ajouterToolTipsBoutons();
762
		saisieTabindex();
780
		saisieTabindex();
763
	}
781
	}
Line 764... Line 782...
764
	
782
	
-
 
783
	protected void surSelectionEspece() {
-
 
784
		//String cle = espece.getText();
765
	protected void surSelectionEspece() {
785
		String cle = espece.getValue();
-
 
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());
766
		ReferentielNom nom = referentielNom.get(espece.getText());
791
		// retour à la vie normale
767
		numeroNom = nom.getNumeroNom();
792
		numeroNom = nom.getNumeroNom();
768
		selectionEspece = true;
793
		selectionEspece = true;
769
		observationMediateur.obtenirImageInformationExternes(referentielTaxo, numeroNom);
794
		observationMediateur.obtenirImageInformationExternes(referentielTaxo, numeroNom);