14,9 → 14,12 |
import org.tela_botanica.client.modeles.objets.Observation; |
|
import com.google.gwt.dom.client.Element; |
import com.google.gwt.http.client.Response; |
import com.google.gwt.json.client.JSONArray; |
import com.google.gwt.json.client.JSONObject; |
import com.google.gwt.json.client.JSONParser; |
import com.google.gwt.json.client.JSONString; |
import com.google.gwt.json.client.JSONValue; |
import com.google.gwt.user.client.DOM; |
import com.google.gwt.user.client.ui.RootPanel; |
|
438,4 → 441,28 |
public static void curseurParDefaut() { |
RootPanel.getBodyElement().getStyle().setProperty("cursor", "default"); |
} |
|
public static Map<String, String> parserRetourReferentielPerso(Response response) { |
final Map<String, String> referentielData = new HashMap<String, String>(); |
final JSONValue responseValue = JSONParser.parse(response.getText()); |
|
JSONArray reponse = null; |
|
// si c'est un tableau |
if ((reponse = responseValue.isArray()) != null) { |
|
JSONString elementsRef; |
final int taillemax = reponse.size(); |
|
for (int i = 0; i < taillemax; i++) { |
if ((elementsRef = reponse.get(i).isString()) != null) { |
|
String valeur = elementsRef.stringValue(); |
referentielData.put(i+"", valeur); |
|
} |
} |
} |
return referentielData; |
} |
} |