| 2 |
ddelon |
1 |
package org.tela_botanica.client;
|
|
|
2 |
|
|
|
3 |
import com.google.gwt.user.client.ui.Composite;
|
|
|
4 |
import com.google.gwt.user.client.ui.VerticalPanel;
|
|
|
5 |
import com.google.gwt.user.client.ui.Button;
|
|
|
6 |
import com.google.gwt.user.client.ui.ClickListener;
|
|
|
7 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
8 |
|
|
|
9 |
|
|
|
10 |
import org.tela_botanica.client.TaxonList;
|
|
|
11 |
import org.tela_botanica.client.NameAssistant;
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
/**
|
|
|
15 |
* Composite permet de wrapper des Widgett pour creer un nouveau Widget cf methode initWidget()
|
|
|
16 |
*/
|
|
|
17 |
|
|
|
18 |
public class CenterPanel extends Composite {
|
|
|
19 |
|
|
|
20 |
private TaxonList taxonList = new TaxonList();
|
|
|
21 |
private NameAssistant nameAssistant = new NameAssistant(taxonList);
|
|
|
22 |
|
|
|
23 |
|
|
|
24 |
public CenterPanel() {
|
|
|
25 |
|
|
|
26 |
VerticalPanel outer = new VerticalPanel();
|
|
|
27 |
VerticalPanel inner = new VerticalPanel();
|
|
|
28 |
|
|
|
29 |
inner.add(nameAssistant);
|
|
|
30 |
inner.add(new Button("Suppression",
|
|
|
31 |
new ClickListener() {
|
|
|
32 |
public void onClick(Widget sender) {
|
|
|
33 |
taxonList.deleteElement();
|
|
|
34 |
}
|
|
|
35 |
}
|
|
|
36 |
)
|
|
|
37 |
);
|
|
|
38 |
|
|
|
39 |
|
|
|
40 |
nameAssistant.setWidth("50%");
|
|
|
41 |
|
|
|
42 |
outer.add(inner);
|
|
|
43 |
inner.setWidth("100%");
|
|
|
44 |
outer.add(taxonList);
|
|
|
45 |
taxonList.setWidth("100%");
|
|
|
46 |
|
|
|
47 |
initWidget(outer);
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
}
|