本文整理匯總了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);
}