Search in sources :

Example 1 with JSONNumber

use of com.google.gwt.json.client.JSONNumber in project gwtphonegap by dankurka.

the class ContactBrowserImpl method serializeContact.

public JSONObject serializeContact() {
    JSONObject root = new JSONObject();
    // simple values
    root.put(FIELD_ID, getAsJSONString(this.getId()));
    root.put(CONTACT_DISPLAY_NAME, getAsJSONString(this.getDisplayName()));
    root.put(CONTACT_NICK_NAME, getAsJSONString(this.getNickName()));
    if (this.getBirthDay() != null) {
        double value = this.getBirthDay().getTime();
        root.put(CONTACT_BIRTHDAY, new JSONNumber(value));
    }
    root.put(CONTACT_PHONE_NUMBERS, toJSONArray(this.getPhoneNumbers()));
    root.put(CONTACT_EMAILS, toJSONArray(this.getEmails()));
    root.put(CONTACT_IMS, toJSONArray(this.getIms()));
    root.put(CONTACT_PHOTOS, toJSONArray(this.getPhotos()));
    root.put(CONTACT_CATEGORIES, toJSONArray(this.getCategories()));
    root.put(CONTACT_URLS, toJSONArray(this.getUrls()));
    root.put(CONTACT_NAME, createContact(this.getName()));
    root.put(CONTACT_ADDRESSES, createAddresses(this.getContactAddresses()));
    root.put(CONTACT_ORGANISATION, createOrganisation(this.getOrganisations()));
    return root;
}
Also used : JSONObject(com.google.gwt.json.client.JSONObject) JSONNumber(com.google.gwt.json.client.JSONNumber)

Example 2 with JSONNumber

use of com.google.gwt.json.client.JSONNumber in project rstudio by rstudio.

the class RemoteServer method tutorialQuizResponse.

@Override
public void tutorialQuizResponse(int slideIndex, int answer, boolean correct, ServerRequestCallback<Void> requestCallback) {
    JSONArray params = new JSONArray();
    params.set(0, new JSONNumber(slideIndex));
    params.set(1, new JSONNumber(answer));
    params.set(2, JSONBoolean.getInstance(correct));
    sendRequest(RPC_SCOPE, TUTORIAL_QUIZ_RESPONSE, params, requestCallback);
}
Also used : JSONArray(com.google.gwt.json.client.JSONArray) JSONNumber(com.google.gwt.json.client.JSONNumber)

Example 3 with JSONNumber

use of com.google.gwt.json.client.JSONNumber in project rstudio by rstudio.

the class RemoteServer method printCppCompletions.

public void printCppCompletions(String docId, String docPath, String docContents, boolean docDirty, int line, int column, ServerRequestCallback<Void> requestCallback) {
    JSONArray params = new JSONArray();
    params.set(0, new JSONString(docId));
    params.set(1, new JSONString(docPath));
    params.set(2, new JSONString(docContents));
    params.set(3, JSONBoolean.getInstance(docDirty));
    params.set(4, new JSONNumber(line));
    params.set(5, new JSONNumber(column));
    sendRequest(RPC_SCOPE, "print_cpp_completions", params, requestCallback);
}
Also used : JSONArray(com.google.gwt.json.client.JSONArray) JSONNumber(com.google.gwt.json.client.JSONNumber) JSONString(com.google.gwt.json.client.JSONString)

Example 4 with JSONNumber

use of com.google.gwt.json.client.JSONNumber in project rstudio by rstudio.

the class RemoteServer method previewDataImport.

@Override
public void previewDataImport(DataImportOptions dataImportOptions, int maxCols, int maxFactors, ServerRequestCallback<DataImportPreviewResponse> requestCallback) {
    JSONArray params = new JSONArray();
    params.set(0, new JSONObject(dataImportOptions));
    params.set(1, new JSONNumber(maxCols));
    params.set(2, new JSONNumber(maxFactors));
    sendRequest(RPC_SCOPE, PREVIEW_DATA_IMPORT, params, requestCallback);
}
Also used : JSONObject(com.google.gwt.json.client.JSONObject) JSONArray(com.google.gwt.json.client.JSONArray) JSONNumber(com.google.gwt.json.client.JSONNumber)

Example 5 with JSONNumber

use of com.google.gwt.json.client.JSONNumber in project rstudio by rstudio.

the class RemoteServer method replayNotebookChunkPlots.

@Override
public void replayNotebookChunkPlots(String docId, String chunkId, int pixelWidth, int pixelHeight, ServerRequestCallback<String> requestCallback) {
    JSONArray params = new JSONArray();
    params.set(0, new JSONString(docId));
    params.set(1, new JSONString(chunkId));
    params.set(2, new JSONNumber(pixelWidth));
    params.set(3, new JSONNumber(pixelHeight));
    sendRequest(RPC_SCOPE, "replay_notebook_chunk_plots", params, requestCallback);
}
Also used : JSONArray(com.google.gwt.json.client.JSONArray) JSONNumber(com.google.gwt.json.client.JSONNumber) JSONString(com.google.gwt.json.client.JSONString)

Aggregations

JSONNumber (com.google.gwt.json.client.JSONNumber)163 JSONObject (com.google.gwt.json.client.JSONObject)109 JSONString (com.google.gwt.json.client.JSONString)72 JSONArray (com.google.gwt.json.client.JSONArray)68 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)19 JsonCallbackEvents (cz.metacentrum.perun.webgui.json.JsonCallbackEvents)18 JsonPostClient (cz.metacentrum.perun.webgui.json.JsonPostClient)18 PerunError (cz.metacentrum.perun.webgui.model.PerunError)17 HashMap (java.util.HashMap)4 Map (java.util.Map)4 JSONValue (com.google.gwt.json.client.JSONValue)3 ArrayList (java.util.ArrayList)3 Token (org.rstudio.core.client.Invalidation.Token)3 ServerError (org.rstudio.studio.client.server.ServerError)3 Breakpoint (org.rstudio.studio.client.common.debugging.model.Breakpoint)2 DiffResult (org.rstudio.studio.client.common.vcs.DiffResult)2 StatusAndPath (org.rstudio.studio.client.common.vcs.StatusAndPath)2 Point (org.rstudio.studio.client.workbench.views.plots.model.Point)2 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1