1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
| package project.client;
import project.client.ProjectService;
import project.client.ProjectServiceAsync;
import com.google.appengine.labs.repackaged.org.json.JSONArray;
import com.google.appengine.labs.repackaged.org.json.JSONObject;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JsonUtils;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONValue;
public class Project implements EntryPoint {
private VerticalPanel vPanel = new VerticalPanel();
//tableau contenant mes éléments pour l'affichage
private FlexTable taskContainer = new FlexTable();
@Override
public void onModuleLoad() {
// TODO Auto-generated method stub
taskContainer.setCellSpacing(0);
taskContainer.setCellPadding(0);
taskContainer.setWidth("100%");
taskContainer.setText(0, 0, "Titre");
taskContainer.setText(0, 1, "Description");
taskContainer.setStyleName("flextable");
RootPanel.get().add(vPanel);
RootPanel.get().add(taskContainer);
final ProjectServiceAsync getService = GWT.create(ProjectService.class);
getService.connection( new AsyncCallback<String>()
{
public void onFailure(Throwable caught)
{
System.out.println("error");
}
public void onSuccess(String result)
{
String[] ligne_base = result.split(";");
for(int i = 0 ;i < ligne_base.length - 1;i++){
taskContainer.setText(i+1,i%2,ligne_base[i]);
}
}
});
}
} |