@Override public void generateJson(String prefix, PrintWriter pw, VWorkspace vWorkspace) { pw.println(prefix + "{"); String newPref = prefix + " "; pw.println(newPref + JSONUtil.json(GenericJsonKeys.updateType, getUpdateType())); pw.println(newPref + JSONUtil.jsonStartList(JsonKeys.commands)); commandHistory.generateFullHistoryJson(newPref + " ", pw, vWorkspace); pw.println(newPref + "]"); pw.println(prefix + "}"); }
public void generateWorksheetListJson(String prefix, PrintWriter pw) { pw.println(prefix + "{"); String newPref = prefix + " "; pw.println(newPref + JSONUtil.json(WorksheetListUpdate.JsonKeys.worksheetId, this.getWorksheetId())); pw.println(newPref + JSONUtil.json(WorksheetListUpdate.JsonKeys.isUpToDate, upToDate)); pw.println(newPref + JSONUtil.json(WorksheetListUpdate.JsonKeys.isCollapsed, collapsed)); pw.println(newPref + JSONUtil.json(WorksheetListUpdate.JsonKeys.encoding, worksheet.getEncoding())); pw.println(newPref + JSONUtil.jsonLast(WorksheetListUpdate.JsonKeys.title, worksheet.getTitle())); pw.println(prefix + "}"); } }
@Override public void generateJson(String prefix, PrintWriter pw, VWorkspace vWorkspace) { Collection<VWorksheet> vWorksheetList = vWorkspace.getViewFactory().getVWorksheets(); pw.println(prefix + "{"); String prefix1 = prefix + " "; pw.println(prefix1 + JSONUtil.json(GenericJsonKeys.updateType, getUpdateType())); generateWorksheetListJson(prefix, pw, vWorksheetList, prefix1); pw.println(prefix + "}"); }
protected void generateCommandJSONAttributes(String prefix, PrintWriter pw, VWorkspace vWorkspace, HistoryType historyType) { String newPref = prefix + " "; pw.println(newPref + JSONUtil.json(JsonKeys.commandId, getId())); pw.println(newPref + JSONUtil.json(JsonKeys.title, getTitle())); pw.println(newPref + JSONUtil.json(JsonKeys.description, getDescription())); pw.println(newPref + JSONUtil.json(JsonKeys.historyType, historyType.name())); pw.println(newPref + JSONUtil.jsonLast(JsonKeys.commandType, getCommandType() .name())); }
public void generateJson(String prefix, PrintWriter pw, VWorkspace vWorkspace) { pw.println(prefix + "{"); String newPref = prefix + " "; pw.println(newPref + JSONUtil.json(JsonKeys.workspaceId, vWorkspace.getWorkspace() .getId())); pw.println(newPref + JSONUtil.jsonStartList(JsonKeys.elements)); Iterator<AbstractUpdate> it = updates.iterator(); while (it.hasNext()) { AbstractUpdate update = it.next(); update.generateJson(newPref + " ", pw, vWorkspace); if (it.hasNext()) { pw.println(newPref + " ,"); } } pw.println(newPref + "]"); pw.println(prefix + "}"); }
@Override public void generateJson(String prefix, PrintWriter pw, VWorkspace vWorkspace) { pw.println(prefix + "{"); String newPref = prefix + " "; pw.println(newPref + JSONUtil.json(GenericJsonKeys.updateType, getUpdateType())); pw.println(newPref + JSONUtil.json(JsonKeys.worksheet, worksheetId)); pw.println(newPref + JSONUtil.json(JsonKeys.nodeId, nodeId)); pw.println(newPref + JSONUtil.json(JsonKeys.newStatus, newStatus.getCodedStatus())); pw.println(newPref + JSONUtil.json(JsonKeys.expandedValue, newValue.asString())); String displayValueString = newValue.asString(); int maxValueLength = vWorkspace.getPreferences().getIntViewPreferenceValue( ViewPreference.maxCharactersInCell); if(displayValueString.length() > maxValueLength) { displayValueString = JSONUtil.truncateCellValue( displayValueString,maxValueLength); } pw.println(newPref + JSONUtil.jsonLast(JsonKeys.displayValue, displayValueString)); pw.println(prefix + "}"); }