Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 278 Rev 287
Line 10... Line 10...
10
import org.tela_botanica.client.interfaces.Rafraichissable;
10
import org.tela_botanica.client.interfaces.Rafraichissable;
11
import org.tela_botanica.client.modeles.Personne;
11
import org.tela_botanica.client.modeles.Personne;
12
import org.tela_botanica.client.modeles.PersonneListe;
12
import org.tela_botanica.client.modeles.PersonneListe;
Line 13... Line 13...
13
 
13
 
-
 
14
import com.extjs.gxt.ui.client.Registry;
14
import com.extjs.gxt.ui.client.Registry;
15
import com.extjs.gxt.ui.client.Style.Scroll;
15
import com.extjs.gxt.ui.client.Style.SelectionMode;
16
import com.extjs.gxt.ui.client.Style.SelectionMode;
16
import com.extjs.gxt.ui.client.binder.TableBinder;
17
import com.extjs.gxt.ui.client.binder.TableBinder;
17
import com.extjs.gxt.ui.client.event.ComponentEvent;
18
import com.extjs.gxt.ui.client.event.ComponentEvent;
18
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
19
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
19
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
20
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
20
import com.extjs.gxt.ui.client.event.SelectionListener;
21
import com.extjs.gxt.ui.client.event.SelectionListener;
21
import com.extjs.gxt.ui.client.store.ListStore;
22
import com.extjs.gxt.ui.client.store.ListStore;
22
import com.extjs.gxt.ui.client.widget.ContentPanel;
23
import com.extjs.gxt.ui.client.widget.ContentPanel;
23
import com.extjs.gxt.ui.client.widget.LayoutContainer;
24
import com.extjs.gxt.ui.client.widget.LayoutContainer;
-
 
25
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
24
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
26
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
25
import com.extjs.gxt.ui.client.widget.table.Table;
27
import com.extjs.gxt.ui.client.widget.table.Table;
26
import com.extjs.gxt.ui.client.widget.table.TableColumn;
28
import com.extjs.gxt.ui.client.widget.table.TableColumn;
27
import com.extjs.gxt.ui.client.widget.table.TableColumnModel;
29
import com.extjs.gxt.ui.client.widget.table.TableColumnModel;
28
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
30
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
Line 33... Line 35...
33
	
35
	
34
	private Mediateur mediateur = null ;
36
	private Mediateur mediateur = null ;
35
	private Table table = null;
37
	private Table table = null;
36
	private ListStore<Personne> store = null;
38
	private ListStore<Personne> store = null;
-
 
39
	private TableBinder<Personne> binder = null;
Line 37... Line 40...
37
	private TableBinder<Personne> binder = null;
40
	private Personne personneSelectionnee = null;
38
	
41
	
Line 39... Line 42...
39
	public PanneauPersonneListe() {
42
	public PanneauPersonneListe() {
Line 56... Line 59...
56
		// TODO : ajouter btn mod & supp
59
		// TODO : ajouter btn mod & supp
57
		final TextToolItem modifier = new TextToolItem("Modifier");
60
		final TextToolItem modifier = new TextToolItem("Modifier");
58
		modifier.setIconStyle(ComposantClass.ICONE_MODIFIER);
61
		modifier.setIconStyle(ComposantClass.ICONE_MODIFIER);
59
		modifier.addSelectionListener(new SelectionListener<ComponentEvent>() {  
62
		modifier.addSelectionListener(new SelectionListener<ComponentEvent>() {  
60
			public void componentSelected(ComponentEvent ce) {  
63
			public void componentSelected(ComponentEvent ce) {  
61
				//coelMediateur.clicModifierStructure(structureSelection)();
64
				mediateur.clicModifierPersonne(personneSelectionnee);
62
			}  
65
			}  
63
		});
66
		});
64
		toolBar.add(modifier);
67
		toolBar.add(modifier);
Line 65... Line 68...
65
		
68
		
Line 78... Line 81...
78
		
81
		
Line 79... Line -...
79
		
-
 
80
 
-
 
81
		List<TableColumn> columns = new ArrayList<TableColumn>();
82
		
82
		
83
 
83
		//TODO : La liste déborde sur la droite, ce qui ajoute une scroll bar
84
		List<TableColumn> columns = new ArrayList<TableColumn>();
84
		
85
		
85
		// ATTENTION : les noms des colonnes doivent correspondrent aux noms variables de la classe utilisée dans la liste
86
		// ATTENTION : les noms des colonnes doivent correspondrent aux noms variables de la classe utilisée dans la liste
Line 92... Line 93...
92
		TableColumnModel cm = new TableColumnModel(columns);
93
		TableColumnModel cm = new TableColumnModel(columns);
Line 93... Line 94...
93
		
94
		
94
		table = new Table(cm);
95
		table = new Table(cm);
95
		table.setSelectionMode(SelectionMode.MULTI);
96
		table.setSelectionMode(SelectionMode.MULTI);
-
 
97
		table.setBorders(false);
96
		table.setBorders(false);
98
		
-
 
99
		
-
 
100
		table.setHorizontalScroll(true);
-
 
101
		
97
 
102
		
Line 98... Line 103...
98
		add(table);
103
		add(table);
Line 99... Line 104...
99
 
104
 
Line 104... Line 109...
104
		
109
		
105
		
110
		
106
		binder.addSelectionChangedListener(new SelectionChangedListener<Personne>() {
111
		binder.addSelectionChangedListener(new SelectionChangedListener<Personne>() {
-
 
112
		public void selectionChanged(SelectionChangedEvent<Personne> event) {
107
		public void selectionChanged(SelectionChangedEvent<Personne> event) {
113
				Personne p = (Personne) event.getSelectedItem();
108
				Personne p = (Personne) event.getSelectedItem();
114
				personneSelectionnee = p;
109
				clicListe(p);
115
				clicListe(p);
-
 
116
			}
110
			}
117
		});
111
		});
118
		
-
 
119
		
112
 
120
		setLayout(new FitLayout());
Line 113... Line 121...
113
		setLayout(new FitLayout());
121
		
114
	}
122
	}
115
 
123