Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1217 Rev 1249
Line 190... Line 190...
190
 
190
 
191
	private Button creerBoutonAjouter() {
191
	private Button creerBoutonAjouter() {
192
		Button bouton = new Button(i18nC.ajouter());
192
		Button bouton = new Button(i18nC.ajouter());
193
		bouton.setIcon(Images.ICONES.vcardAjouter());
193
		bouton.setIcon(Images.ICONES.vcardAjouter());
194
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
-
 
195
			@Override  
194
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
196
			public void componentSelected(ButtonEvent ce) {  
195
			public void componentSelected(ButtonEvent ce) {  
197
				fenetreFormulaire = creerFenetreModaleAvecFormulairePersonne(Formulaire.MODE_AJOUTER);
196
				fenetreFormulaire = creerFenetreModaleAvecFormulairePersonne(Formulaire.MODE_AJOUTER);
198
				fenetreFormulaire.show();
197
				fenetreFormulaire.show();
199
			}  
198
			}  
Line 203... Line 202...
203
	
202
	
204
	private Button creerBoutonModifier() {
203
	private Button creerBoutonModifier() {
205
		Button bouton = new Button(i18nC.modifier());
204
		Button bouton = new Button(i18nC.modifier());
206
		bouton.setIcon(Images.ICONES.vcardModifier());
205
		bouton.setIcon(Images.ICONES.vcardModifier());
207
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
-
 
208
			@Override  
206
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
209
			public void componentSelected(ButtonEvent ce) {  
207
			public void componentSelected(ButtonEvent ce) {  
Line 210... Line 208...
210
				PublicationAPersonne publicationSaisieSelectionnee = grille.getSelectionModel().getSelectedItem();
208
				PublicationAPersonne publicationSaisieSelectionnee = grille.getSelectionModel().getSelectedItem();
211
				
209
				
Line 249... Line 247...
249
		return formulairePublication;
247
		return formulairePublication;
250
	}
248
	}
Line 251... Line 249...
251
	
249
	
252
	private SelectionListener<ButtonEvent> creerEcouteurValidationFormulairePublication(final FenetreForm fenetre, final PublicationForm formulaire) {
250
	private SelectionListener<ButtonEvent> creerEcouteurValidationFormulairePublication(final FenetreForm fenetre, final PublicationForm formulaire) {
253
		SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
-
 
254
			@Override
251
		SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
255
			public void componentSelected(ButtonEvent ce) {
252
			public void componentSelected(ButtonEvent ce) {
256
				String code = ((Button) ce.getComponent()).getData("code");
253
				String code = ((Button) ce.getComponent()).getData("code");
257
				if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
254
				if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
258
					if (formulaire.soumettreFormulaire()) {
255
					if (formulaire.soumettreFormulaire()) {
Line 275... Line 272...
275
	
272
	
276
	private Button creerBoutonSupprimer() {
273
	private Button creerBoutonSupprimer() {
277
		Button bouton = new Button(i18nC.supprimer());
274
		Button bouton = new Button(i18nC.supprimer());
278
		bouton.setIcon(Images.ICONES.vcardSupprimer());
275
		bouton.setIcon(Images.ICONES.vcardSupprimer());
279
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
-
 
280
			@Override
276
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
281
			public void componentSelected(ButtonEvent ce) {
277
			public void componentSelected(ButtonEvent ce) {
282
				PublicationAPersonne publicationSaisieSelectionnee = grille.getSelectionModel().getSelectedItem();
278
				PublicationAPersonne publicationSaisieSelectionnee = grille.getSelectionModel().getSelectedItem();
283
				if (publicationSaisieSelectionnee == null) {
279
				if (publicationSaisieSelectionnee == null) {
284
					InfoLogger.display(i18nC.informationTitreGenerique(), i18nC.selectionnerPublication());
280
					InfoLogger.display(i18nC.informationTitreGenerique(), i18nC.selectionnerPublication());
Line 292... Line 288...
292
	
288
	
293
	private Button creerBoutonRafraichir() {
289
	private Button creerBoutonRafraichir() {
294
		Button bouton = new Button(i18nC.rafraichir());
290
		Button bouton = new Button(i18nC.rafraichir());
295
		bouton.setIcon(Images.ICONES.rafraichir());
291
		bouton.setIcon(Images.ICONES.rafraichir());
296
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
-
 
297
			@Override
292
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
298
			public void componentSelected(ButtonEvent ce) {
293
			public void componentSelected(ButtonEvent ce) {
299
				actualiserGrille();
294
				actualiserGrille();
300
			}   
295
			}   
301
		});
296
		});
Line 332... Line 327...
332
					}
327
					}
333
				}
328
				}
334
			}
329
			}
335
		});
330
		});
336
		comboBox.addListener(Events.Select, new Listener<BaseEvent>() {
331
		comboBox.addListener(Events.Select, new Listener<BaseEvent>() {
337
			@Override
-
 
338
			public void handleEvent(BaseEvent be) {
332
			public void handleEvent(BaseEvent be) {
339
				if (publicationsSaisiesComboBox.getValue() instanceof Publication) {
333
				if (publicationsSaisiesComboBox.getValue() instanceof Publication) {
340
					Publication publicationSaisieSelectionne = publicationsSaisiesComboBox.getValue();
334
					Publication publicationSaisieSelectionne = publicationsSaisiesComboBox.getValue();
341
					ajouterDansGrille(publicationSaisieSelectionne);
335
					ajouterDansGrille(publicationSaisieSelectionne);
342
					publicationsSaisiesComboBox.setValue(null);
336
					publicationsSaisiesComboBox.setValue(null);
Line 456... Line 450...
456
		typeRelationCombo.setEditable(false);
450
		typeRelationCombo.setEditable(false);
457
		typeRelationCombo.addStyleName(ComposantClass.OBLIGATOIRE);
451
		typeRelationCombo.addStyleName(ComposantClass.OBLIGATOIRE);
458
		typeRelationCombo.addListener(Events.Select, Formulaire.creerEcouteurChampObligatoire());
452
		typeRelationCombo.addListener(Events.Select, Formulaire.creerEcouteurChampObligatoire());
Line 459... Line 453...
459
		
453
		
460
		CellEditor editeurRelation = new CellEditor(typeRelationCombo) {  
-
 
461
			@Override  
454
		CellEditor editeurRelation = new CellEditor(typeRelationCombo) {  
462
			public Object preProcessValue(Object valeur) {  
455
			public Object preProcessValue(Object valeur) {  
463
				Valeur retour = null;
456
				Valeur retour = null;
464
				if (valeur != null ) {
457
				if (valeur != null ) {
465
					if (typeRelationCombo.getStore().findModel("nom", valeur.toString()) != null) {
458
					if (typeRelationCombo.getStore().findModel("nom", valeur.toString()) != null) {
Line 471... Line 464...
471
					}
464
					}
472
				}
465
				}
473
				return retour;
466
				return retour;
474
			}  
467
			}  
Line 475... Line -...
475
 
-
 
476
			@Override  
468
 
477
			public Object postProcessValue(Object valeur) {  
469
			public Object postProcessValue(Object valeur) {  
478
				String retour = null;
470
				String retour = null;
479
				if (valeur != null ) {
471
				if (valeur != null ) {
480
					if (valeur instanceof Valeur) {
472
					if (valeur instanceof Valeur) {
Line 485... Line 477...
485
				return retour;  
477
				return retour;  
486
			}  
478
			}  
487
		};
479
		};
Line 488... Line 480...
488
		
480
		
489
		GridCellRenderer<PublicationAPersonne> relationRendu = new GridCellRenderer<PublicationAPersonne>() {
-
 
490
			@Override
481
		GridCellRenderer<PublicationAPersonne> relationRendu = new GridCellRenderer<PublicationAPersonne>() {
491
			public String render(PublicationAPersonne modele, String property, ColumnData config, int rowIndex, int colIndex, ListStore<PublicationAPersonne> store, Grid<PublicationAPersonne> grille) {
482
			public String render(PublicationAPersonne modele, String property, ColumnData config, int rowIndex, int colIndex, ListStore<PublicationAPersonne> store, Grid<PublicationAPersonne> grille) {
492
				// Gestion du texte afficher dans la cellule
483
				// Gestion du texte afficher dans la cellule
493
				String role = modele.get("_role_");
484
				String role = modele.get("_role_");
494
				String roleNom = "";
485
				String roleNom = "";
Line 538... Line 529...
538
		return grillePublications;
529
		return grillePublications;
539
	}
530
	}
Line 540... Line 531...
540
	
531
	
541
	private ColumnConfig creerColonneEditeur() {
532
	private ColumnConfig creerColonneEditeur() {
542
		GridCellRenderer<PublicationAPersonne> editeurRendu = new GridCellRenderer<PublicationAPersonne>() {
-
 
543
			@Override
533
		GridCellRenderer<PublicationAPersonne> editeurRendu = new GridCellRenderer<PublicationAPersonne>() {
544
			public String render(PublicationAPersonne model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<PublicationAPersonne> store, Grid<PublicationAPersonne> grid) {
534
			public String render(PublicationAPersonne model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<PublicationAPersonne> store, Grid<PublicationAPersonne> grid) {
545
				String editeur = model.getPublicationLiee().getNomEditeur();
535
				String editeur = model.getPublicationLiee().getNomEditeur();
546
				model.set("_editeur_", editeur);
536
				model.set("_editeur_", editeur);
547
				return editeur;
537
				return editeur;
Line 552... Line 542...
552
		return editeurColonne;
542
		return editeurColonne;
553
	}
543
	}
Line 554... Line 544...
554
	
544
	
555
	private ColumnConfig creerColonneAnneePublication() {
545
	private ColumnConfig creerColonneAnneePublication() {
556
		GridCellRenderer<PublicationAPersonne> datePublicationRendu = new GridCellRenderer<PublicationAPersonne>() {
-
 
557
			@Override
546
		GridCellRenderer<PublicationAPersonne> datePublicationRendu = new GridCellRenderer<PublicationAPersonne>() {
558
			public String render(PublicationAPersonne model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<PublicationAPersonne> store, Grid<PublicationAPersonne> grid) {
547
			public String render(PublicationAPersonne model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<PublicationAPersonne> store, Grid<PublicationAPersonne> grid) {
559
				String annee = model.getPublicationLiee().getAnneeParution();
548
				String annee = model.getPublicationLiee().getAnneeParution();
560
				model.set("_annee_", annee);
549
				model.set("_annee_", annee);
561
				return annee;
550
				return annee;