PdfViewerImpl extends AbstractComponentImpl implements PdfViewer { @Override public String getViewerConfigJson() { JsonObjectBuilder jsonObjectBuilder = Json.createObjectBuilder(); jsonObjectBuilder.add(FIELD_EMBED_MODE, type); if (StringUtils.equals(type, FULL_WINDOW)) { jsonObjectBuilder.add(PN_DEFAULT_VIEW_MODE, defaultViewMode); jsonObjectBuilder.add(PN_SHOW_ANNOTATION_TOOLS, showAnnotationTools); jsonObjectBuilder.add(PN_SHOW_LEFT_HAND_PANEL, showLeftHandPanel); } if (StringUtils.equals(type, SIZED_CONTAINER)) { jsonObjectBuilder.add(PN_SHOW_FULL_SCREEN, showFullScreen); } if (StringUtils.equals(type, FULL_WINDOW) || StringUtils.equals(type, SIZED_CONTAINER)) { jsonObjectBuilder.add(PN_SHOW_PAGE_CONTROLS, showPageControls); jsonObjectBuilder.add(PN_DOCK_PAGE_CONTROLS, dockPageControls); } jsonObjectBuilder.add(PN_SHOW_DOWNLOAD_PDF, showDownloadPdf); jsonObjectBuilder.add(PN_SHOW_PRINT_PDF, showPrintPdf); return jsonObjectBuilder.build().toString(); }  @Override String getClientId(); @Override String getReportSuiteId(); @Override @Nullable String getDocumentPath(); @Override String getDocumentFileName(); @Override @Nullable String getType(); @Override @Nullable String getDefaultViewMode(); @Override boolean isBorderless(); @Override boolean isShowAnnotationTools(); @Override boolean isShowFullScreen(); @Override boolean isShowLeftHandPanel(); @Override boolean isShowDownloadPdf(); @Override boolean isShowPrintPdf(); @Override boolean isShowPageControls(); @Override boolean isDockPageControls(); @Override String getViewerConfigJson(); @Override String getContainerClass(); @NotNull @Override String getExportedType();  }
@Test void testGetViewerConfigJson() { PdfViewer dcv = getDcvUnderTest(PATH_DCV_1); String json = "{\"embedMode\":\"FULL_WINDOW\",\"defaultViewMode\":\"FIT_PAGE\",\"showAnnotationTools\":true,\"showLeftHandPanel\":true,\"showPageControls\":true,\"dockPageControls\":true,\"showDownloadPDF\":true,\"showPrintPDF\":true}"; assertEquals(json, dcv.getViewerConfigJson()); }