本文整理汇总了Java中org.apache.wicket.markup.html.basic.Label.setEscapeModelStrings方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setEscapeModelStrings方法的具体用法?Java Label.setEscapeModelStrings怎么用?Java Label.setEscapeModelStrings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.markup.html.basic.Label
的用法示例。
在下文中一共展示了Label.setEscapeModelStrings方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
public void initLayout(final String messageKey){
WebMarkupContainer content = new WebMarkupContainer(ID_CONTENT);
add(content);
Label helpLabel = new Label(ID_HELP, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return getString(messageKey);
}
});
helpLabel.setEscapeModelStrings(false);
content.add(helpLabel);
AjaxLink ok = new AjaxLink(ID_BUTTON_OK) {
@Override
public void onClick(AjaxRequestTarget target) {
closePerformed(target);
}
};
content.add(ok);
}
示例2: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
public void initLayout(WebMarkupContainer content){
Label helpLabel = new Label(ID_HELP, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return getString(determineHelpKey());
}
});
helpLabel.setEscapeModelStrings(false);
content.add(helpLabel);
AjaxLink ok = new AjaxLink(ID_BUTTON_OK) {
@Override
public void onClick(AjaxRequestTarget target) {
closePerformed(target);
}
};
content.add(ok);
}
示例3: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private void initLayout() {
Label titleLabel = new Label(ID_TITLE, new PropertyModel<>(getModel(), InformationType.F_TITLE.getLocalPart()));
titleLabel.add(new VisibleBehaviour(() -> getModelObject().getTitle() != null));
add(titleLabel);
ListView<InformationPartType> list = new ListView<InformationPartType>(ID_PARTS,
new PropertyModel<>(getModel(), InformationType.F_PART.getLocalPart())) {
@Override
protected void populateItem(ListItem<InformationPartType> item) {
InformationPartType part = item.getModelObject();
Label label = new Label(ID_PART, part.getText());
if (Boolean.TRUE.equals(part.isHasMarkup())) {
label.setEscapeModelStrings(false);
}
item.add(label);
}
};
add(list);
}
示例4: createValueLabel
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private Component createValueLabel(String id, final IModel<String> facetNameModel, final IModel<String> valueModel) {
final String fieldName = facetNameModel.getObject();
if (FacetConstants.FIELD_LANGUAGE_CODE.equals(facetNameModel.getObject())) {
return new LanguageInfoLink(id, valueModel, facetNameModel);
} else if (SMART_LINK_FIELDS.contains(fieldName)) {
// create label that generates links
return new SmartLinkFieldValueLabel(id, new HandleLinkModel(valueModel), facetNameModel);
} else {
// add a label for the facet value
final Label fieldLabel = new FieldValueLabel(id, valueModel, facetNameModel);
// some selected fields may have HTML that needs to be preserved...
fieldLabel.setEscapeModelStrings(!UNESCAPED_VALUE_FIELDS.contains(fieldName));
return fieldLabel;
}
}