Rev 2 | 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.VerticalPanel;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Widget;
import org.tela_botanica.client.TaxonList;
import org.tela_botanica.client.NameAssistant;
import java.util.Vector;
/**
* Composite permet de wrapper des Widgett pour creer un nouveau Widget cf methode initWidget()
*/
public class CenterPanel extends Composite {
private Vector complements=new Vector();
private TaxonList taxonList = new TaxonList(complements);
private NameAssistant nameAssistant = new NameAssistant(taxonList,complements);
public CenterPanel() {
VerticalPanel outer = new VerticalPanel();
VerticalPanel inner = new VerticalPanel();
inner.add(nameAssistant);
inner.add(new Button("Suppression",
new ClickListener() {
public void onClick(Widget sender) {
taxonList.deleteElement();
}
}
)
);
nameAssistant.setWidth("50%");
outer.add(inner);
inner.setWidth("100%");
outer.add(taxonList);
taxonList.setWidth("100%");
initWidget(outer);
}
}