Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 442 Rev 448
Line 35... Line 35...
35
 
35
 
Line 36... Line 36...
36
public class StructureListeVue extends ContentPanel implements Rafraichissable {
36
public class StructureListeVue extends ContentPanel implements Rafraichissable {
37
	
37
	
38
	private Mediateur mediateur = null ;
-
 
-
 
38
	private Mediateur mediateur = null ;
39
	private Constantes i18nC = null ;
39
	private Constantes i18nC = null ;
40
	private Rafraichissable structureListePanneauVue = null ;
40
 
41
	private Table table = null;
41
	private Table table = null;
-
 
42
	private ListStore<Structure> store = null;
42
	private ListStore<Structure> store = null;
43
	private TableBinder<Structure> binder = null;
43
	private TableBinder<Structure> binder = null;
44
 
44
	private TextToolItem modifier;
45
	private TextToolItem modifier;
Line 45... Line 46...
45
	private TextToolItem supprimer;
46
	private TextToolItem supprimer;
46
	private TextToolItem ajouter;
47
	private TextToolItem ajouter;
47
 
48
 
Line 48... Line 49...
48
	public StructureListeVue(Mediateur mediateurCourant) {
49
	public StructureListeVue(Mediateur mediateurCourant) {
49
		mediateur = mediateurCourant;
-
 
Line 50... Line 50...
50
		i18nC = mediateur.i18nC;
50
		mediateur = mediateurCourant;
51
		
51
		i18nC = mediateur.i18nC;
52
		Utilisateur utilisateur = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
52
		
53
		structureListePanneauVue = this;
53
		Utilisateur utilisateur = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
Line 73... Line 73...
73
		
73
		
74
		supprimer = new TextToolItem(i18nC.supprimer());
74
		supprimer = new TextToolItem(i18nC.supprimer());
75
		supprimer.setIconStyle(ComposantClass.ICONE_SUPPRIMER);
75
		supprimer.setIconStyle(ComposantClass.ICONE_SUPPRIMER);
76
		supprimer.addSelectionListener(new SelectionListener<ComponentEvent>() {
76
		supprimer.addSelectionListener(new SelectionListener<ComponentEvent>() {
77
			public void componentSelected(ComponentEvent ce) {
77
			public void componentSelected(ComponentEvent ce) {
78
				mediateur.clicSupprimerStructure(structureListePanneauVue, binder.getSelection());
78
				clicSupprimerStructure(binder.getSelection());
79
			}
79
			}
80
		});
80
		});
81
		if (!utilisateur.isIdentifie()) {
81
		if (!utilisateur.isIdentifie()) {
82
			supprimer.disable();
82
			supprimer.disable();
83
		}
83
		}
Line 84... Line 84...
84
		toolBar.add(supprimer);
84
		toolBar.add(supprimer);
Line 85... Line 85...
85
 
85
 
86
		setTopComponent(toolBar);
-
 
87
 
86
		setTopComponent(toolBar);
88
		List<TableColumn> columns = new ArrayList<TableColumn>();
87
 
Line 89... Line 88...
89
		// ATTENTION : les noms des colonnes doivent correspondrent aux noms variables de la classe utilisée dans la liste
88
		List<TableColumn> columns = new ArrayList<TableColumn>();
90
		columns.add(new TableColumn("ville", i18nC.ville(), .3f));
89
		columns.add(new TableColumn("ville", i18nC.ville(), .3f));
91
		columns.add(new TableColumn("nom", i18nC.nom(), .7f));
90
		columns.add(new TableColumn("nom", i18nC.nom(), .7f));
92
		
91
		
93
		TableColumnModel cm = new TableColumnModel(columns);
92
		TableColumnModel cm = new TableColumnModel(columns);
94
		table = new Table(cm);
93
		table = new Table(cm);
Line 95... Line -...
95
		table.setSelectionMode(SelectionMode.MULTI);
-
 
96
		table.setBorders(false);
94
		table.setSelectionMode(SelectionMode.MULTI);
97
		table.setStripeRows(true);
95
		table.setBorders(false);
Line 98... Line 96...
98
		add(table);
96
		table.setStripeRows(true);
99
		
97
		add(table);
Line 115... Line 113...
115
	private void clicListe(Structure structure) {
113
	private void clicListe(Structure structure) {
116
		if (store.getCount() > 0) {
114
		if (store.getCount() > 0) {
117
			mediateur.clicListeStructure(structure);
115
			mediateur.clicListeStructure(structure);
118
		}
116
		}
119
	}
117
	}
-
 
118
	
-
 
119
	private void clicSupprimerStructure(List<Structure> structuresASupprimer) {
-
 
120
		if (store.getCount() > 0) {
-
 
121
			mediateur.clicSupprimerStructure(this, structuresASupprimer);
-
 
122
		}
-
 
123
	}
Line 120... Line 124...
120
 
124
 
121
	public void rafraichir(Object nouvelleDonnees) {
125
	public void rafraichir(Object nouvelleDonnees) {
122
		if (nouvelleDonnees instanceof StructureListe) {
126
		if (nouvelleDonnees instanceof StructureListe) {
123
			StructureListe structures = (StructureListe) nouvelleDonnees;
127
			StructureListe structures = (StructureListe) nouvelleDonnees;