本文整理汇总了Java中elemental.json.JsonObject.getObject方法的典型用法代码示例。如果您正苦于以下问题:Java JsonObject.getObject方法的具体用法?Java JsonObject.getObject怎么用?Java JsonObject.getObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类elemental.json.JsonObject
的用法示例。
在下文中一共展示了JsonObject.getObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateData
import elemental.json.JsonObject; //导入方法依赖的package包/类
@Override
public void generateData(Object itemId, Item item, JsonObject jsonRow) {
JsonObject jsonData = jsonRow.getObject("d");
for (String key : jsonData.keys()) {
if (getColumn(key).getRenderer() == this) {
// 2: VERY IMPORTANT get the component from the connector tracker !!!
// if you use a GeneratedPropertyContainer and call get Value you will
// get a different component
if (jsonData.get(key) != Json.createNull()) {
Component current = lookupComponent(jsonData, key);
trackComponent(itemId, current);
}
}
}
}
示例2: render
import elemental.json.JsonObject; //导入方法依赖的package包/类
@Override
public void render(RendererCellReference cell, Object data, Widget widget) {
JsonObject row = (JsonObject) cell.getRow();
int depth = 0;
boolean leaf = false;
boolean collapsed = false;
if (row.hasKey(GridState.JSONKEY_ROWDESCRIPTION)) {
JsonObject rowDescription = row.getObject(GridState.JSONKEY_ROWDESCRIPTION);
depth = (int) rowDescription.getNumber("depth");
leaf = rowDescription.getBoolean("leaf");
collapsed = rowDescription.getBoolean("collapsed");
}
HierarchyItem cellWidget = (HierarchyItem) widget;
cellWidget.setDepth(depth);
if (leaf) {
cellWidget.setExpanderState(ExpanderState.LEAF);
} else if (collapsed) {
cellWidget.setExpanderState(ExpanderState.COLLAPSED);
} else {
cellWidget.setExpanderState(ExpanderState.EXPANDED);
}
// inner cell
if (innerRenderer instanceof WidgetRenderer) {
((WidgetRenderer) innerRenderer).render(cell, data, ((HierarchyItem) widget).content);
} else {
innerRenderer.render(new HierarchyRendererCellReferenceWrapper(cell,
((HierarchyItem) widget).content.getElement()), data);
}
}