本文整理汇总了Java中pt.ist.fenixWebFramework.renderers.utils.RenderUtils.getFormattedProperties方法的典型用法代码示例。如果您正苦于以下问题:Java RenderUtils.getFormattedProperties方法的具体用法?Java RenderUtils.getFormattedProperties怎么用?Java RenderUtils.getFormattedProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pt.ist.fenixWebFramework.renderers.utils.RenderUtils
的用法示例。
在下文中一共展示了RenderUtils.getFormattedProperties方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createComponent
import pt.ist.fenixWebFramework.renderers.utils.RenderUtils; //导入方法依赖的package包/类
@Override
public HtmlComponent createComponent(Object object, Class type) {
HtmlImage image = new HtmlImage();
String link = RenderUtils.getFormattedProperties(getImageFormat(), getTargetObject(object));
if (isModuleRelative()) {
link = RenderUtils.getModuleRelativePath("") + link;
} else if (isContextRelative()) {
link = RenderUtils.getContextRelativePath("") + link;
}
if (link.contains(".do")) {
String checksum =
GenericChecksumRewriter.calculateChecksum(link, getContext().getViewState().getRequest()
.getSession(false));
link = link + (link.contains("?") ? '&' : '?') + GenericChecksumRewriter.CHECKSUM_ATTRIBUTE_NAME + "=" + checksum;
}
image.setSource(link);
return image;
}
示例2: getLinkText
import pt.ist.fenixWebFramework.renderers.utils.RenderUtils; //导入方法依赖的package包/类
public String getLinkText(TableLink tableLink, Object object) {
String text = tableLink.getText();
if (text != null) {
return text;
}
String key = tableLink.getKey();
String bundle = tableLink.getBundle();
if (key == null) {
return tableLink.getName();
}
text = RenderUtils.getResourceString(bundle, key);
if (text == null) {
text = tableLink.getName();
}
return getCounter() != null ? text + RenderUtils.getFormattedProperties(getCounter(), object) : text;
}
示例3: getFormatedArgs
import pt.ist.fenixWebFramework.renderers.utils.RenderUtils; //导入方法依赖的package包/类
protected String getFormatedArgs() {
Object object = ((MetaSlot) getInputContext().getMetaObject()).getMetaObject().getObject();
if (getProvider() == null) {
return RenderUtils.getFormattedProperties(getArgs(), object);
} else {
return String.format("provider=%s,%s", getProvider(), RenderUtils.getFormattedProperties(getArgs(), object));
}
}
示例4: getIncludedEnumValues
import pt.ist.fenixWebFramework.renderers.utils.RenderUtils; //导入方法依赖的package包/类
private Collection<Object> getIncludedEnumValues(Class type, final Object object) {
final String valuesString = getIncludedValues();
if (valuesString == null || valuesString.length() == 0) {
Object[] constants = type.getEnumConstants();
if (constants == null) {
constants = type.getDeclaringClass().getEnumConstants();
}
return Arrays.asList(constants);
} else {
String formatedValues = object == null ? valuesString : RenderUtils.getFormattedProperties(valuesString, object);
return getEnumValues(type, formatedValues);
}
}
示例5: getExcludedEnumValues
import pt.ist.fenixWebFramework.renderers.utils.RenderUtils; //导入方法依赖的package包/类
private Collection<Object> getExcludedEnumValues(Class type, final Object object) {
final String valuesString = getExcludedValues();
if (valuesString == null || valuesString.length() == 0) {
return Collections.emptyList();
} else {
String formatedValues = object == null ? valuesString : RenderUtils.getFormattedProperties(valuesString, object);
return getEnumValues(type, formatedValues);
}
}
示例6: createComponent
import pt.ist.fenixWebFramework.renderers.utils.RenderUtils; //导入方法依赖的package包/类
@Override
public HtmlComponent createComponent(Object object, Class type) {
Object usedObject = getTargetObject(object);
if (usedObject == null) {
return new HtmlText();
}
String formatedObject = RenderUtils.getFormattedProperties(getFormat(), usedObject);
return getEscaped() != null ? new HtmlText(formatedObject, getEscaped()) : new HtmlText(formatedObject);
}
示例7: getTitle
import pt.ist.fenixWebFramework.renderers.utils.RenderUtils; //导入方法依赖的package包/类
public String getTitle() {
String label = null;
String key = getDescription();
if (key != null) {
label = RenderUtils.getResourceString(bundle, key);
}
if (label != null) {
return label;
}
String labelFormat = getDescriptionFormat();
final Object object = getMetaObject().getObject();
if (object != null && labelFormat != null) {
return RenderUtils.getFormattedProperties(labelFormat, object);
}
Class type;
if (getMetaObject().getSchema() != null) {
type = getMetaObject().getSchema().getType();
} else {
type = getMetaObject().getType();
}
return RenderUtils.getSlotLabel(type, getName(), getBundle(), getDescription());
}
示例8: createComponent
import pt.ist.fenixWebFramework.renderers.utils.RenderUtils; //导入方法依赖的package包/类
@Override
public HtmlComponent createComponent(Object object, Class type) {
if (object == null) {
return new HtmlText();
}
TreeSet<ConditionalFormat> orderedFormats = new TreeSet<ConditionalFormat>(ConditionalFormat.COMPARATOR_BY_ORDER);
orderedFormats.addAll(conditionalFormats.values());
for (ConditionalFormat format : orderedFormats) {
Object usedObject = getTargetObject(object, format);
Boolean useFormatIfResult = null;
Boolean useFormatIfNotResult = null;
try {
if (format.getUseFormatIf() != null) {
useFormatIfResult =
(Boolean) RendererPropertyUtils.getProperty(usedObject, format.getUseFormatIf(), false);
}
if (format.getUseFormatIfNot() != null) {
useFormatIfNotResult =
(Boolean) RendererPropertyUtils.getProperty(usedObject, format.getUseFormatIfNot(), false);
}
} catch (ClassCastException e) {
e.printStackTrace();
}
if ((useFormatIfResult == null && useFormatIfNotResult == null)
|| ((useFormatIfResult == null || useFormatIfResult) && (useFormatIfNotResult == null || !useFormatIfNotResult))) {
String formatedObject = RenderUtils.getFormattedProperties(format.getFormat(), usedObject);
return new HtmlText(formatedObject, format.isEscaped());
}
}
// If no format condition is true
return new HtmlText(RenderUtils.getFormattedProperties(null, object));
}
示例9: getObjectLabel
import pt.ist.fenixWebFramework.renderers.utils.RenderUtils; //导入方法依赖的package包/类
protected String getObjectLabel(Object object) {
if (getFormat() != null) {
return RenderUtils.getFormattedProperties(getFormat(), object);
}
return String.valueOf(object);
}