Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1292 Rev 1329
Line 1... Line 1...
1
package org.tela_botanica.client.composants;
1
package org.tela_botanica.client.composants;
Line 2... Line 2...
2
 
2
 
-
 
3
import java.util.List;
Line 3... Line 4...
3
import java.util.List;
4
import java.util.Map;
4
 
5
 
5
import org.tela_botanica.client.composants.pagination.ChargeurListe;
6
import org.tela_botanica.client.composants.pagination.ChargeurListe;
6
import org.tela_botanica.client.composants.pagination.Proxy;
7
import org.tela_botanica.client.composants.pagination.Proxy;
Line 10... Line 11...
10
 
11
 
11
import com.extjs.gxt.ui.client.event.BaseEvent;
12
import com.extjs.gxt.ui.client.event.BaseEvent;
12
import com.extjs.gxt.ui.client.event.Events;
13
import com.extjs.gxt.ui.client.event.Events;
13
import com.extjs.gxt.ui.client.event.Listener;
14
import com.extjs.gxt.ui.client.event.Listener;
-
 
15
import com.extjs.gxt.ui.client.store.ListStore;
-
 
16
import com.extjs.gxt.ui.client.util.Size;
14
import com.extjs.gxt.ui.client.store.ListStore;
17
import com.extjs.gxt.ui.client.util.Util;
15
import com.extjs.gxt.ui.client.widget.LayoutContainer;
18
import com.extjs.gxt.ui.client.widget.LayoutContainer;
16
import com.extjs.gxt.ui.client.widget.VerticalPanel;
19
import com.extjs.gxt.ui.client.widget.VerticalPanel;
-
 
20
import com.extjs.gxt.ui.client.widget.form.ComboBox;
-
 
21
import com.extjs.gxt.ui.client.widget.layout.FormData;
Line -... Line 22...
-
 
22
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
17
import com.extjs.gxt.ui.client.widget.form.ComboBox;
23
 
18
 
24
import com.extjs.gxt.ui.client.data.BaseModelData;
19
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
25
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
20
import com.extjs.gxt.ui.client.data.LoadEvent;
26
import com.extjs.gxt.ui.client.data.LoadEvent;
21
import com.extjs.gxt.ui.client.data.Loader;
27
import com.extjs.gxt.ui.client.data.Loader;
Line 30... Line 36...
30
	//-------------//
36
	//-------------//
Line 31... Line 37...
31
	
37
	
32
	private ListStore<ModelData> store = null;
38
	private ListStore<ModelData> store = null;
Line 33... Line -...
33
	private ComboBox<ModelData> combo = null;
-
 
34
 
-
 
35
	private String recherche = "";
39
	private ComboBox<ModelData> combo = null;
36
 
40
 
37
	private Proxy<?> proxy = null;
41
	private Proxy<?> proxy = null;
Line 38... Line 42...
38
	private TransformateurJSONaModelData<PagingLoadResult<ModelData>> reader = null;
42
	private TransformateurJSONaModelData<PagingLoadResult<ModelData>> reader = null;
39
	private ChargeurListe<PagingLoadResult<ModelData>> loader = null;
43
	private ChargeurListe<PagingLoadResult<ModelData>> loader = null;
40
	
44
	
Line -... Line 45...
-
 
45
	private int start = 0;
41
	private int start = 0;
46
	private int limit = 10;
42
	private int limit = 10;
47
	private int largeur = 200;
43
	private int largeur = 200;
48
 
44
 
-
 
-
 
49
	private LayoutContainer lc = null;
Line 45... Line 50...
45
	private BasePagingLoadConfig plc = null;
50
	private BasePagingLoadConfig plc = null;
46
	private ModelType modeltype = null;
51
	private ModelType modeltype = null;
47
	private String displayName = "";
52
	private String displayName = "";
Line 106... Line 111...
106
				loader.load(plc, recherche);
111
				loader.load(plc, recherche);
107
			}
112
			}
Line 108... Line 113...
108
			  
113
			  
Line 109... Line 114...
109
		});
114
		});
110
		
115
		
Line 111... Line 116...
111
		VerticalPanel vp = new VerticalPanel();  
116
		lc = new LayoutContainer();
112
		vp.add(combo);  
117
		lc.add(combo);
Line 113... Line 118...
113
		
118
		
114
		add(vp);  
119
		add(lc);  
Line 121... Line 126...
121
	public ComboBox<ModelData> getCombo()
126
	public ComboBox<ModelData> getCombo()
122
	{
127
	{
123
		return this.combo;
128
		return this.combo;
124
	}
129
	}
Line 125... Line 130...
125
	
130
	
126
	public Valeur getValeur()
131
	public ModelData getValeur()
127
	{
132
	{
-
 
133
		if (!Util.isEmptyString(combo.getRawValue())) return combo.getSelection().get(0);
128
		return new Valeur(combo.getSelection().get(0));
134
		else return null;
Line 129... Line 135...
129
	}
135
	}
130
	
136
	
131
	public ListStore<?> getStore()
137
	public ListStore<?> getStore()
Line 137... Line 143...
137
	{
143
	{
138
		this.largeur = largeur;
144
		this.largeur = largeur;
139
		this.combo.setWidth(largeur);
145
		this.combo.setWidth(largeur);
140
	}
146
	}
Line -... Line 147...
-
 
147
	
-
 
148
	public void setWidth(int tailleLabel, int largeurTotale)
-
 
149
	{
-
 
150
		this.largeur = largeurTotale;
-
 
151
		// FIXME - problème avec la largeur de la combobox
-
 
152
		this.combo.setWidth(largeurTotale - tailleLabel);
-
 
153
		
-
 
154
		FormLayout fl = new FormLayout();
-
 
155
		fl.setLabelWidth(tailleLabel);
-
 
156
		this.lc.setSize(largeurTotale, 0);
-
 
157
		this.lc.setLayout(fl);
Line 141... Line 158...
141
	
158
	}
142
	
159
	
143
	/*-----------------------------
160
	/*-----------------------------
Line 157... Line 174...
157
	
174
	
158
	/*----------------
175
	/*----------------
159
	  Méthode privées 
176
	  Méthode privées 
Line 160... Line -...
160
	-----------------*/
-
 
161
 
177
	-----------------*/