本文整理汇总了Java中org.apache.wicket.Page.getString方法的典型用法代码示例。如果您正苦于以下问题:Java Page.getString方法的具体用法?Java Page.getString怎么用?Java Page.getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.Page
的用法示例。
在下文中一共展示了Page.getString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initContexts
import org.apache.wicket.Page; //导入方法依赖的package包/类
private void initContexts(WebMarkupContainer operationContent, final IModel<OpResult> model, Page parentPage) {
Label contextsLabel = new Label("contextsLabel", parentPage.getString("FeedbackAlertMessageDetails.contexts"));
contextsLabel.setOutputMarkupId(true);
contextsLabel.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return CollectionUtils.isNotEmpty(model.getObject().getContexts());
}
});
operationContent.add(contextsLabel);
ListView<Context> contexts = new ListView<Context>("contexts", createContextsModel(model)) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<Context> item) {
item.add(new Label("contextName", new PropertyModel<Object>(item.getModel(), "name")));
item.add(new Label("contextValue", new PropertyModel<Object>(item.getModel(), "value")));
}
};
contexts.setOutputMarkupId(true);
contexts.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return CollectionUtils.isNotEmpty(model.getObject().getContexts());
}
});
operationContent.add(contexts);
}
示例2: initError
import org.apache.wicket.Page; //导入方法依赖的package包/类
private void initError(WebMarkupContainer operationPanel, final IModel<OpResult> model, Page parentPage) {
Label errorLabel = new Label("errorLabel", parentPage.getString("FeedbackAlertMessageDetails.error"));
errorLabel.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
// return true;
return StringUtils.isNotBlank(model.getObject().getExceptionsStackTrace());
}
});
errorLabel.setOutputMarkupId(true);
operationPanel.add(errorLabel);
Label errorMessage = new Label("errorMessage", new PropertyModel<String>(model, "exceptionMessage"));
errorMessage.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
// return true;
return StringUtils.isNotBlank(model.getObject().getExceptionsStackTrace());
}
});
errorMessage.setOutputMarkupId(true);
operationPanel.add(errorMessage);
final Label errorStackTrace = new Label(ID_ERROR_STACK_TRACE,
new PropertyModel<String>(model, "exceptionsStackTrace"));
errorStackTrace.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
// return true;
return model.getObject().isShowError();
}
});
errorStackTrace.setOutputMarkupId(true);
operationPanel.add(errorStackTrace);
AjaxLink errorStackTraceLink = new AjaxLink("errorStackTraceLink") {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
OpResult result = OperationResultPanel.this.getModelObject();
result.setShowError(!model.getObject().isShowError());
result.setAlreadyShown(false); // hack to be able to expand/collapse OpResult after rendered.
// model.getObject().setShowError(!model.getObject().isShowError());
target.add(OperationResultPanel.this);
}
};
errorStackTraceLink.setOutputMarkupId(true);
errorStackTraceLink.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return StringUtils.isNotBlank(model.getObject().getExceptionsStackTrace());
}
});
operationPanel.add(errorStackTraceLink);
}