本文整理汇总了Java中org.apache.wicket.model.IModel.setObject方法的典型用法代码示例。如果您正苦于以下问题:Java IModel.setObject方法的具体用法?Java IModel.setObject怎么用?Java IModel.setObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.model.IModel
的用法示例。
在下文中一共展示了IModel.setObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getViolationMessage
import org.apache.wicket.model.IModel; //导入方法依赖的package包/类
private IModel<String> getViolationMessage() {
final IModel<String> violationMessageTemplate = getViolationMessageTemplate();
return new IModel<String>() {
@Override
public void detach() {
violationMessageTemplate.detach();
}
@Override
public String getObject() {
return resolvePlaceholders(violationMessageTemplate.getObject());
}
@Override
public void setObject(final String object) {
violationMessageTemplate.setObject(object);
}
};
}
示例2: RevisionDiffPanel
import org.apache.wicket.model.IModel; //导入方法依赖的package包/类
public RevisionDiffPanel(String id, IModel<Project> projectModel, IModel<PullRequest> requestModel,
String oldRev, String newRev, IModel<String> pathFilterModel, IModel<WhitespaceOption> whitespaceOptionModel,
@Nullable IModel<String> blameModel, @Nullable MarkSupport markSupport) {
super(id);
this.projectModel = projectModel;
this.requestModel = requestModel;
this.oldRev = oldRev;
this.newRev = newRev;
this.pathFilterModel = pathFilterModel;
this.blameModel = new IModel<String>() {
@Override
public void detach() {
blameModel.detach();
}
@Override
public String getObject() {
return blameModel.getObject();
}
@Override
public void setObject(String object) {
AjaxRequestTarget target = RequestCycle.get().find(AjaxRequestTarget.class);
String prevBlameFile = blameModel.getObject();
blameModel.setObject(object);
if (prevBlameFile != null && object != null && !prevBlameFile.equals(object)) {
SourceAware sourceAware = getSourceAware(prevBlameFile);
sourceAware.onUnblame(target);
}
target.appendJavaScript("gitplex.server.revisionDiff.reposition();");
}
};
this.whitespaceOptionModel = whitespaceOptionModel;
this.markSupport = markSupport;
WebRequest request = (WebRequest) RequestCycle.get().getRequest();
Cookie cookie = request.getCookie(COOKIE_VIEW_MODE);
if (cookie == null)
diffMode = DiffViewMode.UNIFIED;
else
diffMode = DiffViewMode.valueOf(cookie.getValue());
}