当前位置: 首页>>代码示例>>Java>>正文


Java IModel.setObject方法代码示例

本文整理汇总了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);
            }
        };
    }
 
开发者ID:NHS-digital-website,项目名称:hippo,代码行数:23,代码来源:BlankStaticDropdownSelectionFieldValidator.java

示例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());
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:46,代码来源:RevisionDiffPanel.java


注:本文中的org.apache.wicket.model.IModel.setObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。