Subversion Repositories eFlore/Archives.cel-v1

Rev

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

Rev Author Line No. Line
2 ddelon 1
/*
2
 * Copyright 2006 Google Inc.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5
 * use this file except in compliance with the License. You may obtain a copy of
6
 * the License at
7
 *
8
 * http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
 * License for the specific language governing permissions and limitations under
14
 * the License.
15
 */
16
package org.tela_botanica.client;
17
 
18
import com.google.gwt.user.client.ui.Composite;
11 ddelon 19
import com.google.gwt.user.client.ui.DockPanel;
2 ddelon 20
import com.google.gwt.user.client.ui.HTML;
21
import com.google.gwt.user.client.ui.HorizontalPanel;
11 ddelon 22
import com.google.gwt.user.client.ui.VerticalPanel;
2 ddelon 23
 
24
/**
25
 * Composite permet de wrapper des Widget pour creer un nouveau Widget cf methode initWidget()
26
 */
27
 
28
public class TopPanel extends Composite {
11 ddelon 29
 
30
  private NameAssistant nameAssistant = null;
31
  private LocationAssistant locationAssistant = null;
2 ddelon 32
 
11 ddelon 33
  public TopPanel(final Mediator mediator) {
2 ddelon 34
 
11 ddelon 35
 
36
   VerticalPanel outer = new VerticalPanel();
37
 
38
   VerticalPanel inner = new VerticalPanel();
39
 
2 ddelon 40
 
11 ddelon 41
	nameAssistant = new NameAssistant(mediator);
42
	locationAssistant = new LocationAssistant(mediator);
43
 
44
	DockPanel namePanel = new DockPanel();
45
	DockPanel locationPanel = new DockPanel();
46
 
47
     HTML labelNameAssistant = new HTML("Nom: ");
48
     namePanel.add(labelNameAssistant,DockPanel.WEST);
49
     namePanel.add (nameAssistant,DockPanel.CENTER);
50
 
51
	 nameAssistant.setWidth("100%");
52
	 namePanel.setCellWidth(labelNameAssistant,"7%");
53
	 namePanel.setCellWidth(nameAssistant,"93%");
54
	 namePanel.setWidth("50%");
2 ddelon 55
 
11 ddelon 56
 
57
     HTML labelLocationAssistant= new HTML("Lieu: ");
58
     locationPanel.add(labelLocationAssistant,DockPanel.WEST);
59
     locationPanel.add (locationAssistant,DockPanel.CENTER);
60
 
61
	 locationAssistant.setWidth("100%");
62
	 locationPanel.setCellWidth(locationAssistant,"7%");
63
	 locationPanel.setCellWidth(locationAssistant,"93%");
64
	 locationPanel.setWidth("50%");
65
 
66
	 inner.add(namePanel);
67
	 inner.add(locationPanel);
68
 
69
	 inner.setCellWidth(namePanel,"50%");
70
	 inner.setCellWidth(locationPanel,"50%");
2 ddelon 71
 
11 ddelon 72
 
73
 
74
	outer.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
75
 
76
	 outer.add(new HTML("<b>Carnet en ligne</b>"));
77
 
78
	 outer.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
79
 
80
	 outer.add(inner);
81
 
82
	 inner.setWidth("100%");
83
 
84
 
2 ddelon 85
    initWidget(outer);
86
  }
87
 
88
}