Subversion Repositories eFlore/Applications.coel

Rev

Rev 1865 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
859 jpm 1
package org.tela_botanica.client.composants;
2
 
3
import com.extjs.gxt.ui.client.widget.ContentPanel;
4
import com.extjs.gxt.ui.client.widget.LayoutContainer;
5
import com.extjs.gxt.ui.client.widget.form.LabelField;
6
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
7
import com.extjs.gxt.ui.client.widget.layout.HBoxLayout;
8
import com.extjs.gxt.ui.client.widget.layout.LayoutData;
9
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
10
import com.extjs.gxt.ui.client.widget.layout.HBoxLayout.HBoxLayoutAlign;
11
import com.google.gwt.user.client.ui.Widget;
12
 
13
public class ConteneurMultiChamps extends LayoutContainer {
14
 
15
	private LayoutContainer conteneurDesChamps = null;
16
 
17
	public ConteneurMultiChamps(String label) {
18
		setLayout(new RowLayout());
19
 
20
		LabelField etiquette = new LabelField(label+":");
21
		add(etiquette);
22
 
23
		ContentPanel panneauGeneral = new ContentPanel(new FitLayout());
24
		panneauGeneral.setHeaderVisible(false);
25
		panneauGeneral.setHeight(25);
26
 
27
		HBoxLayout dispositionDesChamps = new HBoxLayout();
28
		dispositionDesChamps.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
29
 
30
		conteneurDesChamps = new LayoutContainer();
31
		conteneurDesChamps.setLayout(dispositionDesChamps);
32
		panneauGeneral.add(conteneurDesChamps);
33
 
34
		add(panneauGeneral);
35
	}
36
 
37
	public void ajouterChamp(Widget widget) {
38
		ajouterChamp(widget, null);
39
	}
40
 
41
	public void ajouterChamp(Widget widget, LayoutData dispositionDesDonnees) {
42
		if (dispositionDesDonnees != null) {
43
			conteneurDesChamps.add(widget, dispositionDesDonnees);
44
		} else {
45
			conteneurDesChamps.add(widget);
46
		}
47
		layout();
48
	}
49
}