本文整理汇总了Java中com.haulmont.cuba.core.global.View.getName方法的典型用法代码示例。如果您正苦于以下问题:Java View.getName方法的具体用法?Java View.getName怎么用?Java View.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.haulmont.cuba.core.global.View
的用法示例。
在下文中一共展示了View.getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createJsonArrayOfViewProperties
import com.haulmont.cuba.core.global.View; //导入方法依赖的package包/类
protected JsonArray createJsonArrayOfViewProperties(View view) {
JsonArray propertiesArray = new JsonArray();
for (ViewProperty viewProperty : view.getProperties()) {
View nestedView = viewProperty.getView();
if (nestedView == null) {
//add simple property as string primitive
propertiesArray.add(viewProperty.getName());
} else {
JsonObject propertyObject = new JsonObject();
propertyObject.addProperty("name", viewProperty.getName());
String nestedViewName = nestedView.getName();
if (compactFormat) {
if (StringUtils.isNotEmpty(nestedViewName)) {
View processedView = findProcessedView(processedViews, nestedView.getEntityClass(), nestedViewName);
if (processedView == null) {
processedViews.add(nestedView);
propertyObject.add("view", createJsonObjectForNestedView(nestedView));
} else {
//if we already processed this view, just add its name as a string
propertyObject.addProperty("view", nestedViewName);
}
} else {
propertyObject.add("view", createJsonObjectForNestedView(nestedView));
}
} else {
propertyObject.add("view", createJsonObjectForNestedView(nestedView));
}
if (includeFetchMode && viewProperty.getFetchMode() != null && viewProperty.getFetchMode() != FetchMode.AUTO) {
propertyObject.addProperty("fetch", viewProperty.getFetchMode().name());
}
propertiesArray.add(propertyObject);
}
}
return propertiesArray;
}
示例2: createJsonObjectForNestedView
import com.haulmont.cuba.core.global.View; //导入方法依赖的package包/类
protected JsonObject createJsonObjectForNestedView(View nestedView) {
JsonObject viewObject = new JsonObject();
String nestedViewName = nestedView.getName();
if (StringUtils.isNotEmpty(nestedViewName)) {
viewObject.addProperty("name", nestedViewName);
}
JsonArray nestedViewProperties = createJsonArrayOfViewProperties(nestedView);
viewObject.add("properties", nestedViewProperties);
return viewObject;
}
示例3: dumpHtml
import com.haulmont.cuba.core.global.View; //导入方法依赖的package包/类
protected void dumpHtml(View view, StringBuilder content) {
content.append("<br/>").append("\n");
String metaClassName = metadata.getSession().getClass(view.getEntityClass()).getName();
String viewHtmlId = metaClassName + "__" + view.getName();
content.append("+ <a href=\"#").append(viewHtmlId).append("\"><span id=\"").append(viewHtmlId).append("\">")
.append(metaClassName).append("/").append(view.getName())
.append("</span></a>");
for (ViewProperty viewProperty : view.getProperties()) {
dumpHtml(viewProperty, content, " ");
}
content.append("<br/>").append("\n");
}