Subversion Repositories eFlore/Applications.coel

Rev

Rev 1415 | Rev 1513 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package org.tela_botanica.client.composants;

import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.form.LabelField;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.HBoxLayout;
import com.extjs.gxt.ui.client.widget.layout.LayoutData;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
import com.extjs.gxt.ui.client.widget.layout.HBoxLayout.HBoxLayoutAlign;
import com.google.gwt.user.client.ui.Widget;

public class ConteneurMultiChamps extends LayoutContainer {

        private LayoutContainer conteneurDesChamps = null;

        public ConteneurMultiChamps(String label) {
                setLayout(new RowLayout());
                
                LabelField etiquette = new LabelField(label+":");
                add(etiquette);

                ContentPanel panneauGeneral = new ContentPanel(new FitLayout());
                panneauGeneral.setHeaderVisible(false);
                panneauGeneral.setHeight(25);
                
                HBoxLayout dispositionDesChamps = new HBoxLayout();  
                dispositionDesChamps.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
                
                conteneurDesChamps = new LayoutContainer();
                conteneurDesChamps.setLayout(dispositionDesChamps);             
                panneauGeneral.add(conteneurDesChamps);
                
                add(panneauGeneral);
        }
        
        public void ajouterChamp(Widget widget) {
                ajouterChamp(widget, null);
        }
        
        public void ajouterChamp(Widget widget, LayoutData dispositionDesDonnees) {
                if (dispositionDesDonnees != null) {
                        conteneurDesChamps.add(widget, dispositionDesDonnees);
                } else {
                        conteneurDesChamps.add(widget);
                }
                layout();
        }
}