Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1239 Rev 1246
Line 188... Line 188...
188
 
188
 
189
	private Button creerBoutonAjouter() {
189
	private Button creerBoutonAjouter() {
190
		Button bouton = new Button(i18nC.ajouter());
190
		Button bouton = new Button(i18nC.ajouter());
191
		bouton.setIcon(Images.ICONES.vcardAjouter());
191
		bouton.setIcon(Images.ICONES.vcardAjouter());
192
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
-
 
193
			@Override  
192
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
194
			public void componentSelected(ButtonEvent ce) {  
193
			public void componentSelected(ButtonEvent ce) {  
195
				fenetreFormulaire = creerFenetreModaleAvecFormulairePersonne(Formulaire.MODE_AJOUTER);
194
				fenetreFormulaire = creerFenetreModaleAvecFormulairePersonne(Formulaire.MODE_AJOUTER);
196
				fenetreFormulaire.show();
195
				fenetreFormulaire.show();
197
			}  
196
			}  
Line 201... Line 200...
201
	
200
	
202
	private Button creerBoutonModifier() {
201
	private Button creerBoutonModifier() {
203
		Button bouton = new Button(i18nC.modifier());
202
		Button bouton = new Button(i18nC.modifier());
204
		bouton.setIcon(Images.ICONES.vcardModifier());
203
		bouton.setIcon(Images.ICONES.vcardModifier());
205
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
-
 
206
			@Override  
204
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
207
			public void componentSelected(ButtonEvent ce) {  
205
			public void componentSelected(ButtonEvent ce) {  
Line 208... Line 206...
208
				PublicationAPersonne publicationSaisieSelectionnee = grille.getSelectionModel().getSelectedItem();
206
				PublicationAPersonne publicationSaisieSelectionnee = grille.getSelectionModel().getSelectedItem();
209
				
207
				
Line 247... Line 245...
247
		return formulairePublication;
245
		return formulairePublication;
248
	}
246
	}
Line 249... Line 247...
249
	
247
	
250
	private SelectionListener<ButtonEvent> creerEcouteurValidationFormulairePublication(final FenetreForm fenetre, final PublicationForm formulaire) {
248
	private SelectionListener<ButtonEvent> creerEcouteurValidationFormulairePublication(final FenetreForm fenetre, final PublicationForm formulaire) {
251
		SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
-
 
252
			@Override
249
		SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
253
			public void componentSelected(ButtonEvent ce) {
250
			public void componentSelected(ButtonEvent ce) {
254
				String code = ((Button) ce.getComponent()).getData("code");
251
				String code = ((Button) ce.getComponent()).getData("code");
255
				if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
252
				if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
256
					if (formulaire.soumettreFormulaire()) {
253
					if (formulaire.soumettreFormulaire()) {
Line 273... Line 270...
273
	
270
	
274
	private Button creerBoutonSupprimer() {
271
	private Button creerBoutonSupprimer() {
275
		Button bouton = new Button(i18nC.supprimer());
272
		Button bouton = new Button(i18nC.supprimer());
276
		bouton.setIcon(Images.ICONES.vcardSupprimer());
273
		bouton.setIcon(Images.ICONES.vcardSupprimer());
277
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
-
 
278
			@Override
274
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
279
			public void componentSelected(ButtonEvent ce) {
275
			public void componentSelected(ButtonEvent ce) {
280
				PublicationAPersonne publicationSaisieSelectionnee = grille.getSelectionModel().getSelectedItem();
276
				PublicationAPersonne publicationSaisieSelectionnee = grille.getSelectionModel().getSelectedItem();
281
				if (publicationSaisieSelectionnee == null) {
277
				if (publicationSaisieSelectionnee == null) {
282
					InfoLogger.display(i18nC.informationTitreGenerique(), i18nC.selectionnerPublication());
278
					InfoLogger.display(i18nC.informationTitreGenerique(), i18nC.selectionnerPublication());
Line 290... Line 286...
290
	
286
	
291
	private Button creerBoutonRafraichir() {
287
	private Button creerBoutonRafraichir() {
292
		Button bouton = new Button(i18nC.rafraichir());
288
		Button bouton = new Button(i18nC.rafraichir());
293
		bouton.setIcon(Images.ICONES.rafraichir());
289
		bouton.setIcon(Images.ICONES.rafraichir());
294
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
-
 
295
			@Override
290
		bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {  
296
			public void componentSelected(ButtonEvent ce) {
291
			public void componentSelected(ButtonEvent ce) {
297
				actualiserGrille();
292
				actualiserGrille();
298
			}   
293
			}   
299
		});
294
		});
Line 330... Line 325...
330
					}
325
					}
331
				}
326
				}
332
			}
327
			}
333
		});
328
		});
334
		comboBox.addListener(Events.Select, new Listener<BaseEvent>() {
329
		comboBox.addListener(Events.Select, new Listener<BaseEvent>() {
335
			@Override
-
 
336
			public void handleEvent(BaseEvent be) {
330
			public void handleEvent(BaseEvent be) {
337
				if (publicationsSaisiesComboBox.getValue() instanceof Publication) {
331
				if (publicationsSaisiesComboBox.getValue() instanceof Publication) {
338
					Publication publicationSaisieSelectionne = publicationsSaisiesComboBox.getValue();
332
					Publication publicationSaisieSelectionne = publicationsSaisiesComboBox.getValue();
339
					ajouterDansGrille(publicationSaisieSelectionne);
333
					ajouterDansGrille(publicationSaisieSelectionne);
340
					publicationsSaisiesComboBox.setValue(null);
334
					publicationsSaisiesComboBox.setValue(null);
Line 443... Line 437...
443
		typeRelationCombo.setEditable(false);
437
		typeRelationCombo.setEditable(false);
444
		typeRelationCombo.addStyleName(ComposantClass.OBLIGATOIRE);
438
		typeRelationCombo.addStyleName(ComposantClass.OBLIGATOIRE);
445
		typeRelationCombo.addListener(Events.Select, Formulaire.creerEcouteurChampObligatoire());
439
		typeRelationCombo.addListener(Events.Select, Formulaire.creerEcouteurChampObligatoire());
Line 446... Line 440...
446
		
440
		
447
		CellEditor editeurRelation = new CellEditor(typeRelationCombo) {  
-
 
448
			@Override  
441
		CellEditor editeurRelation = new CellEditor(typeRelationCombo) {  
449
			public Object preProcessValue(Object valeur) {  
442
			public Object preProcessValue(Object valeur) {  
450
				Valeur retour = null;
443
				Valeur retour = null;
451
				if (valeur != null ) {
444
				if (valeur != null ) {
452
					if (typeRelationCombo.getStore().findModel("nom", valeur.toString()) != null) {
445
					if (typeRelationCombo.getStore().findModel("nom", valeur.toString()) != null) {
Line 458... Line 451...
458
					}
451
					}
459
				}
452
				}
460
				return retour;
453
				return retour;
461
			}  
454
			}  
Line 462... Line -...
462
 
-
 
463
			@Override  
455
 
464
			public Object postProcessValue(Object valeur) {  
456
			public Object postProcessValue(Object valeur) {  
465
				String retour = null;
457
				String retour = null;
466
				if (valeur != null ) {
458
				if (valeur != null ) {
467
					if (valeur instanceof Valeur) {
459
					if (valeur instanceof Valeur) {
Line 472... Line 464...
472
				return retour;  
464
				return retour;  
473
			}  
465
			}  
474
		};
466
		};
Line 475... Line 467...
475
		
467
		
476
		GridCellRenderer<PublicationAPersonne> relationRendu = new GridCellRenderer<PublicationAPersonne>() {
-
 
477
			@Override
468
		GridCellRenderer<PublicationAPersonne> relationRendu = new GridCellRenderer<PublicationAPersonne>() {
478
			public String render(PublicationAPersonne modele, String property, ColumnData config, int rowIndex, int colIndex, ListStore<PublicationAPersonne> store, Grid<PublicationAPersonne> grille) {
469
			public String render(PublicationAPersonne modele, String property, ColumnData config, int rowIndex, int colIndex, ListStore<PublicationAPersonne> store, Grid<PublicationAPersonne> grille) {
479
				// Gestion du texte afficher dans la cellule
470
				// Gestion du texte afficher dans la cellule
480
				String role = modele.get("_role_");
471
				String role = modele.get("_role_");
481
				String roleNom = "";
472
				String roleNom = "";
Line 524... Line 515...
524
		return grillePublications;
515
		return grillePublications;
525
	}
516
	}
Line 526... Line 517...
526
	
517
	
527
	private ColumnConfig creerColonneEditeur() {
518
	private ColumnConfig creerColonneEditeur() {
528
		GridCellRenderer<PublicationAPersonne> editeurRendu = new GridCellRenderer<PublicationAPersonne>() {
-
 
529
			@Override
519
		GridCellRenderer<PublicationAPersonne> editeurRendu = new GridCellRenderer<PublicationAPersonne>() {
530
			public String render(PublicationAPersonne model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<PublicationAPersonne> store, Grid<PublicationAPersonne> grid) {
520
			public String render(PublicationAPersonne model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<PublicationAPersonne> store, Grid<PublicationAPersonne> grid) {
531
				String editeur = model.getPublicationLiee().getNomEditeur();
521
				String editeur = model.getPublicationLiee().getNomEditeur();
532
				model.set("_editeur_", editeur);
522
				model.set("_editeur_", editeur);
533
				return editeur;
523
				return editeur;
Line 538... Line 528...
538
		return editeurColonne;
528
		return editeurColonne;
539
	}
529
	}
Line 540... Line 530...
540
	
530
	
541
	private ColumnConfig creerColonneAnneePublication() {
531
	private ColumnConfig creerColonneAnneePublication() {
542
		GridCellRenderer<PublicationAPersonne> datePublicationRendu = new GridCellRenderer<PublicationAPersonne>() {
-
 
543
			@Override
532
		GridCellRenderer<PublicationAPersonne> datePublicationRendu = new GridCellRenderer<PublicationAPersonne>() {
544
			public String render(PublicationAPersonne model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<PublicationAPersonne> store, Grid<PublicationAPersonne> grid) {
533
			public String render(PublicationAPersonne model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<PublicationAPersonne> store, Grid<PublicationAPersonne> grid) {
545
				String annee = model.getPublicationLiee().getAnneeParution();
534
				String annee = model.getPublicationLiee().getAnneeParution();
546
				model.set("_annee_", annee);
535
				model.set("_annee_", annee);
547
				return annee;
536
				return annee;