Subversion Repositories eFlore/Applications.coel

Rev

Rev 66 | 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.Style.LayoutRegion;
import com.extjs.gxt.ui.client.fx.FxConfig;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Dialog;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;

public class AideFenetre extends Dialog {

        public AideFenetre() {
                setBodyBorder(false);  
                setButtons(Dialog.OK);  
                setIconStyle("icon-app-side");  
                setHeading("COEL - Aide");  
                setWidth(400);  
                setHeight(225);  
                setHideOnButtonClick(true);  
                
                BorderLayout layout = new BorderLayout();  
                setLayout(layout);  
                
                // Panneau Ouest  
                ContentPanel panel = new ContentPanel();  
                panel.setHeading("Sommaire");
                BorderLayoutData data = new BorderLayoutData(LayoutRegion.WEST, 150, 100, 250);  
                data.setMargins(new Margins(0, 5, 0, 0));  
                data.setSplit(true);  
                data.setCollapsible(true);  
                data.setFloatable(true);
                add(panel, data);  
                
                // Panneau Central  
                panel = new ContentPanel();  
                data = new BorderLayoutData(LayoutRegion.CENTER);  
                add(panel, data);
        }
        
        /**
         * Sur une fermeture on fait un fadeOut.
         * 
         */
        protected void onButtonPressed(Button btn) {
                if (this.isHideOnButtonClick()) {
                        this.el().fadeOut(FxConfig.NONE);
                } else {
                        super.onButtonPressed(btn);
                }
        }
}