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;
}
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);
}
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);
}
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);
}
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);
}
Aggregations