Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 69 Rev 133
Line 6... Line 6...
6
 
6
 
7
import org.tela_botanica.client.ComposantClass;
7
import org.tela_botanica.client.ComposantClass;
8
import org.tela_botanica.client.Mediateur;
8
import org.tela_botanica.client.Mediateur;
9
import org.tela_botanica.client.RegistreId;
9
import org.tela_botanica.client.RegistreId;
-
 
10
import org.tela_botanica.client.interfaces.Rafraichissable;
10
import org.tela_botanica.client.interfaces.Rafraichissable;
11
import org.tela_botanica.client.modeles.Information;
11
import org.tela_botanica.client.modeles.Structure;
12
import org.tela_botanica.client.modeles.Structure;
Line 12... Line 13...
12
import org.tela_botanica.client.modeles.StructureListe;
13
import org.tela_botanica.client.modeles.StructureListe;
13
 
14
 
Line 18... Line 19...
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;
-
 
24
import com.extjs.gxt.ui.client.widget.Info;
23
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
25
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
24
import com.extjs.gxt.ui.client.widget.table.Table;
26
import com.extjs.gxt.ui.client.widget.table.Table;
25
import com.extjs.gxt.ui.client.widget.table.TableColumn;
27
import com.extjs.gxt.ui.client.widget.table.TableColumn;
26
import com.extjs.gxt.ui.client.widget.table.TableColumnModel;
28
import com.extjs.gxt.ui.client.widget.table.TableColumnModel;
27
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
29
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
28
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
30
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
-
 
31
import com.google.gwt.core.client.GWT;
29
import com.google.gwt.user.client.Window;
32
import com.google.gwt.user.client.Window;
Line 30... Line 33...
30
 
33
 
Line -... Line 34...
-
 
34
public class StructureListePanneauVue extends ContentPanel implements Rafraichissable {
31
public class StructureListePanneauVue extends ContentPanel implements Rafraichissable {
35
	
32
	
36
	private Rafraichissable structureListePanneauVue = null ;
33
	private Mediateur coelMediateur = null ;
37
	private Mediateur coelMediateur = null ;
34
	private Table table = null;
38
	private Table table = null;
Line 35... Line 39...
35
	private ListStore<Structure> store = null;
39
	private ListStore<Structure> store = null;
36
	private TableBinder<Structure> binder = null;
40
	private TableBinder<Structure> binder = null;
-
 
41
 
Line 37... Line 42...
37
 
42
	public StructureListePanneauVue() {
38
	public StructureListePanneauVue() {
43
		coelMediateur = Registry.get(RegistreId.MEDIATEUR);
39
		coelMediateur = Registry.get(RegistreId.MEDIATEUR);
44
		structureListePanneauVue = this;
40
		
45
		
41
		ToolBar toolBar = new ToolBar();
46
		ToolBar toolBar = new ToolBar();
42
		TextToolItem ajouter = new TextToolItem("Ajouter");
47
		TextToolItem ajouter = new TextToolItem("Ajouter");
43
		ajouter.setIconStyle(ComposantClass.ICONE_AJOUTER);
48
		ajouter.setIconStyle(ComposantClass.ICONE_AJOUTER);
44
		ajouter.addSelectionListener(new SelectionListener<ComponentEvent>() {  
49
		ajouter.addSelectionListener(new SelectionListener<ComponentEvent>() {  
45
			public void componentSelected(ComponentEvent ce) {  
50
			public void componentSelected(ComponentEvent ce) {  
Line 46... Line 51...
46
				coelMediateur.clicAjouterStructure();
51
				coelMediateur.clicAjouterStructure();
47
			}  
52
			}
48
		});
53
		});
Line 49... Line 54...
49
		toolBar.add(ajouter);
54
		toolBar.add(ajouter);
50
 
55
 
-
 
56
		TextToolItem modifier = new TextToolItem("Modifier");
-
 
57
		modifier.setIconStyle(ComposantClass.ICONE_MODIFIER);
-
 
58
		toolBar.add(modifier);
-
 
59
		
-
 
60
		TextToolItem supprimer = new TextToolItem("Supprimer");
51
		TextToolItem modifier = new TextToolItem("Modifier");
61
		supprimer.setIconStyle(ComposantClass.ICONE_SUPPRIMER);
Line 52... Line 62...
52
		modifier.setIconStyle(ComposantClass.ICONE_MODIFIER);
62
		supprimer.addSelectionListener(new SelectionListener<ComponentEvent>() {
Line 53... Line 63...
53
		toolBar.add(modifier);
63
			public void componentSelected(ComponentEvent ce) {
Line 112... Line 122...
112
			
122
			
113
			// Test pour savoir si la liste contient des éléments
123
			// Test pour savoir si la liste contient des éléments
114
			if (listeInstitutions.size() > 0) {
124
			if (listeInstitutions.size() > 0) {
115
				binder.setSelection((Structure) listeInstitutions.get(0));
125
				binder.setSelection((Structure) listeInstitutions.get(0));
-
 
126
			}
-
 
127
		} else if (nouvelleDonnees instanceof Information) {
-
 
128
			Information info = (Information) nouvelleDonnees;
-
 
129
			if (info.getType().equals("suppression_structure")) {
-
 
130
				GWT.log(info.getMessages().toString(), null);
-
 
131
				Info.display("Suppression Structure", info.toString());
116
			}
132
			}
Line 117... Line 133...
117
		}
133
		}
118
		
134