@Override public WebItemTargetBean deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { final WebItemTargetBeanBuilder builder = WebItemTargetBean.newWebItemTargetBean(); final JsonObject webItemTargetJson = json.getAsJsonObject(); final WebItemTargetType type = context.<WebItemTargetType>deserialize(webItemTargetJson.get("type"), WebItemTargetType.class); builder.withType(type); Class<? extends WebItemTargetOptions> optionsType = getTargetOptionsClass(type); if (optionsType != null) { builder.withOptions(context.<WebItemTargetOptions>deserialize(webItemTargetJson.get("options"), optionsType)); } return builder.build(); }
@Override public WebItemTargetBean deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { final WebItemTargetBeanBuilder builder = WebItemTargetBean.newWebItemTargetBean(); final JsonObject webItemTargetJson = json.getAsJsonObject(); final WebItemTargetType type = context.<WebItemTargetType>deserialize(webItemTargetJson.get("type"), WebItemTargetType.class); builder.withType(type); Class<? extends WebItemTargetOptions> optionsType = getTargetOptionsClass(type); if (optionsType != null) { builder.withOptions(context.<WebItemTargetOptions>deserialize(webItemTargetJson.get("options"), optionsType)); } return builder.build(); }
private static String createWebitemTargetCommonDialogExample() { WebItemTargetBean bean = newWebItemTargetBean() .withType(WebItemTargetType.dialogModule) .withOptions(newDialogModuleOptions("dialog-module-key")) .build(); return gson.toJson(JsonExamplesUtils.createJsonObject("target", bean)); }
private static String createWebitemTargetCommonDialogExample() { WebItemTargetBean bean = newWebItemTargetBean() .withType(WebItemTargetType.dialogModule) .withOptions(newDialogModuleOptions("dialog-module-key")) .build(); return gson.toJson(JsonExamplesUtils.createJsonObject("target", bean)); }
private static String createWebitemTargetDialogOptionsExample() { WebItemTargetBean bean = newWebItemTargetBean() .withType(WebItemTargetType.dialog) .withOptions(newDialogOptions() .withHeight("100px") .withWidth("200px") .build() ) .build(); return gson.toJson(JsonExamplesUtils.createJsonObject("target", bean)); }
private static String createWebitemTargetDialogOptionsExample() { WebItemTargetBean bean = newWebItemTargetBean() .withType(WebItemTargetType.dialog) .withOptions(newDialogOptions() .withHeight("100px") .withWidth("200px") .build() ) .build(); return gson.toJson(JsonExamplesUtils.createJsonObject("target", bean)); }
private static String createWebitemTargetInlineDialogOptionsExample() { WebItemTargetBean bean = newWebItemTargetBean() .withType(WebItemTargetType.inlineDialog) .withOptions(newInlineDialogOptions() .withOffsetX("30px") .withOffsetY("20px") .withOnHover(true) .build() ) .build(); return gson.toJson(JsonExamplesUtils.createJsonObject("target", bean)); }
private static String createWebitemTargetInlineDialogOptionsExample() { WebItemTargetBean bean = newWebItemTargetBean() .withType(WebItemTargetType.inlineDialog) .withOptions(newInlineDialogOptions() .withOffsetX("30px") .withOffsetY("20px") .withOnHover(true) .build() ) .build(); return gson.toJson(JsonExamplesUtils.createJsonObject("target", bean)); }
private static String createContentBylineItemExample() { final ContentBylineItemModuleBean bean = newContentBylineItem() .withKey("byline-item") .withName(i18nProperty("Item Text")) .withIcon(ICON_BEAN) .withTooltip(i18nProperty("Item Tooltip")) .withUrl("/my-byline-item") .withTarget(newWebItemTargetBean() .withType(WebItemTargetType.inlineDialog) .build()) .build(); return JsonExamplesUtils.createModuleArrayAsString("contentBylineItems", bean); }