本文整理汇总了Java中elemental.json.JsonObject.getString方法的典型用法代码示例。如果您正苦于以下问题:Java JsonObject.getString方法的具体用法?Java JsonObject.getString怎么用?Java JsonObject.getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类elemental.json.JsonObject
的用法示例。
在下文中一共展示了JsonObject.getString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateSuggestions
import elemental.json.JsonObject; //导入方法依赖的package包/类
private void updateSuggestions(int start, int end) {
for (int i = start; i < end; ++i) {
JsonObject row = getDataSource().getRow(i);
if (row == null) {
getDataSource().ensureAvailability(start, end);
}
if (row != null) {
String key = getRowKey(row);
String caption = row.getString(DataCommunicatorConstants.NAME);
String style = row.getString(ComboBoxMultiselectConstants.STYLE);
String untranslatedIconUri = row.getString(ComboBoxMultiselectConstants.ICON);
ComboBoxMultiselectSuggestion suggestion = getWidget().new ComboBoxMultiselectSuggestion(key, caption,
style, untranslatedIconUri);
getWidget().currentSuggestions.add(suggestion);
} else {
// there is not enough options to fill the page
return;
}
}
}
示例2: showSuggestions
import elemental.json.JsonObject; //导入方法依赖的package包/类
protected void showSuggestions(JsonArray suggestions) {
this.suggestions.clear();
for (int i = 0; i < suggestions.length(); i++) {
JsonObject jsonSuggestion = suggestions.getObject(i);
Suggestion suggestion = new Suggestion(
jsonSuggestion.getString(SUGGESTION_ID),
jsonSuggestion.getString(SUGGESTION_CAPTION),
jsonSuggestion.getString(SUGGESTION_STYLE_NAME)
);
this.suggestions.add(suggestion);
}
showSuggestions();
}
示例3: addItems
import elemental.json.JsonObject; //导入方法依赖的package包/类
protected void addItems(JsonArray items, HasWidgets container) {
for (int i = 0; i < items.length(); i++) {
JsonObject itemJson = items.getObject(i);
Icon icon = null;
String iconId = itemJson.getString("icon");
if (menuItemIconSupplier != null && iconId != null) {
icon = menuItemIconSupplier.apply(iconId);
}
boolean captionAsHtml = false;
if (itemJson.hasKey("captionAsHtml")) {
captionAsHtml = itemJson.getBoolean("captionAsHtml");
}
MenuItemWidget menuItemWidget = new MenuItemWidget(this,
itemJson.getString("id"),
icon,
itemJson.getString("styleName"),
itemJson.getString("caption"),
captionAsHtml);
menuItemWidget.setDescription(itemJson.getString("description"));
menuItemWidget.setCubaId(itemJson.getString("cubaId"));
menuItemWidget.setBadgeText(itemJson.getString("badgeText"));
container.add(menuItemWidget);
JsonArray childrenItemsJson = itemJson.getArray("children");
if (childrenItemsJson != null) {
MenuContainerWidget menuContainerWidget = new MenuContainerWidget(this, menuItemWidget);
addItems(childrenItemsJson, menuContainerWidget);
container.add(menuContainerWidget);
menuItemWidget.setSubMenu(menuContainerWidget);
if (itemJson.hasKey("expanded")
&& itemJson.getBoolean("expanded")) {
menuContainerWidget.setExpanded(true);
}
}
}
}