Subversion Repositories eFlore/Archives.cel-v1

Rev

Rev 8 | Blame | Last modification | View Log | RSS feed

package org.tela_botanica.client;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.VerticalPanel;


import org.tela_botanica.client.TaxonList;
import org.tela_botanica.client.NameAssistant;

/**
 * Composite permet de wrapper des Widgett pour creer un nouveau Widget cf methode initWidget()
 */

public class CenterPanel extends Composite {

        
  private TaxonList taxonList = null;
  private NameAssistant nameAssistant = null;
  private LocationAssistant locationAssistant = null;


  public CenterPanel(Mediator mediator) {

        
        taxonList = new TaxonList(mediator);
        
        nameAssistant = new NameAssistant(taxonList);
        locationAssistant = new LocationAssistant(taxonList);

          
        taxonList.setNameProvider(nameAssistant);
        taxonList.setLocationProvider(locationAssistant);
          
    VerticalPanel outer = new VerticalPanel();
    DockPanel inner = new DockPanel();
   
    DockPanel namePanel = new DockPanel();
    DockPanel locationPanel = new DockPanel();
    

     namePanel.add(new HTML("Nom: "),DockPanel.WEST);
     namePanel.add (nameAssistant,DockPanel.CENTER);
         
         nameAssistant.setWidth("100%");
         namePanel.setCellWidth(nameAssistant,"100%");
         namePanel.setWidth("100%");
         
     locationPanel.add(new HTML("Lieu: "),DockPanel.WEST);
     locationPanel.add (locationAssistant,DockPanel.CENTER);
         
         locationAssistant.setWidth("100%");
         locationPanel.setCellWidth(locationAssistant,"100%");
         locationPanel.setWidth("100%");
         
         inner.add(namePanel,DockPanel.WEST);
         inner.add(locationPanel,DockPanel.CENTER);
         
         inner.setCellWidth(namePanel,"50%");
         inner.setCellWidth(locationPanel,"50%");

         
         outer.add(inner);
         outer.add(taxonList);
         inner.setWidth("100%");
         taxonList.setWidth("100%");

     initWidget(outer);
  }
  
  
  
}