Subversion Repositories eFlore/Archives.cel-v1

Rev

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

Rev Author Line No. Line
2 ddelon 1
package org.tela_botanica.client;
2
 
3
import com.google.gwt.user.client.ui.Composite;
8 ddelon 4
import com.google.gwt.user.client.ui.DockPanel;
5
import com.google.gwt.user.client.ui.HTML;
2 ddelon 6
import com.google.gwt.user.client.ui.VerticalPanel;
7
 
8
 
9
import org.tela_botanica.client.TaxonList;
10
import org.tela_botanica.client.NameAssistant;
11
 
12
/**
13
 * Composite permet de wrapper des Widgett pour creer un nouveau Widget cf methode initWidget()
14
 */
15
 
16
public class CenterPanel extends Composite {
17
 
10 ddelon 18
 
19
  private TaxonList taxonList = null;
20
  private NameAssistant nameAssistant = null;
21
  private LocationAssistant locationAssistant = null;
2 ddelon 22
 
4 ddelon 23
 
10 ddelon 24
  public CenterPanel(Mediator mediator) {
25
 
26
 
27
	taxonList = new TaxonList(mediator);
28
 
29
	nameAssistant = new NameAssistant(taxonList);
30
	locationAssistant = new LocationAssistant(taxonList);
31
 
2 ddelon 32
 
10 ddelon 33
	taxonList.setNameProvider(nameAssistant);
34
	taxonList.setLocationProvider(locationAssistant);
35
 
2 ddelon 36
    VerticalPanel outer = new VerticalPanel();
8 ddelon 37
    DockPanel inner = new DockPanel();
10 ddelon 38
 
39
    DockPanel namePanel = new DockPanel();
40
    DockPanel locationPanel = new DockPanel();
2 ddelon 41
 
8 ddelon 42
 
10 ddelon 43
     namePanel.add(new HTML("Nom: "),DockPanel.WEST);
44
     namePanel.add (nameAssistant,DockPanel.CENTER);
8 ddelon 45
 
10 ddelon 46
	 nameAssistant.setWidth("100%");
47
	 namePanel.setCellWidth(nameAssistant,"100%");
48
	 namePanel.setWidth("100%");
49
 
50
     locationPanel.add(new HTML("Lieu: "),DockPanel.WEST);
51
     locationPanel.add (locationAssistant,DockPanel.CENTER);
52
 
53
	 locationAssistant.setWidth("100%");
54
	 locationPanel.setCellWidth(locationAssistant,"100%");
55
	 locationPanel.setWidth("100%");
56
 
57
	 inner.add(namePanel,DockPanel.WEST);
58
	 inner.add(locationPanel,DockPanel.CENTER);
59
 
60
	 inner.setCellWidth(namePanel,"50%");
61
	 inner.setCellWidth(locationPanel,"50%");
62
 
63
 
8 ddelon 64
	 outer.add(inner);
65
	 outer.add(taxonList);
10 ddelon 66
	 inner.setWidth("100%");
8 ddelon 67
	 taxonList.setWidth("100%");
2 ddelon 68
 
8 ddelon 69
     initWidget(outer);
2 ddelon 70
  }
4 ddelon 71
 
10 ddelon 72
 
73
 
2 ddelon 74
}
8 ddelon 75