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


Java IModel.detach方法代码示例

本文整理汇总了Java中org.apache.wicket.model.IModel.detach方法的典型用法代码示例。如果您正苦于以下问题:Java IModel.detach方法的具体用法?Java IModel.detach怎么用?Java IModel.detach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.wicket.model.IModel的用法示例。


在下文中一共展示了IModel.detach方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: wrapAsSelfUpdating

import org.apache.wicket.model.IModel; //导入方法依赖的package包/类
public IModel<T> wrapAsSelfUpdating(final IModel<T> model) {
	return new IModel<T>() {

		@Override
		public void detach() {
			model.detach();
		}

		@Override
		public T getObject() {
			return model.getObject();
		}

		@Override
		public void setObject(T object) {
			copyProperties(object, getObject());
		}
		
	};
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:21,代码来源:BeanContext.java

示例3: CommitListPanel

import org.apache.wicket.model.IModel; //导入方法依赖的package包/类
public CommitListPanel(String id, IModel<Project> projectModel, IModel<List<RevCommit>> commitsModel) {
	super(id);
	this.projectModel = projectModel;
	this.commitsModel = new LoadableDetachableModel<List<RevCommit>>() {

		@Override
		protected List<RevCommit> load() {
			List<RevCommit> commits = commitsModel.getObject();
			if (commits.size() > WebConstants.MAX_DISPLAY_COMMITS)
				commits = commits.subList(commits.size()-WebConstants.MAX_DISPLAY_COMMITS, commits.size());
			CommitGraphUtils.sort(commits, 0);
			return separateByDate(commits);
		}

		@Override
		protected void onDetach() {
			commitsModel.detach();
			super.onDetach();
		}
		
	};
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:23,代码来源:CommitListPanel.java

示例4: CommitMessageLabel

import org.apache.wicket.model.IModel; //导入方法依赖的package包/类
public CommitMessageLabel(String id, IModel<Project> projectModel, IModel<String> messageModel) {
	super(id, new LoadableDetachableModel<String>() {

		@Override
		protected String load() {
			String message = HtmlEscape.escapeHtml5(messageModel.getObject());
			for (CommitMessageTransformer transformer: GitPlex.getExtensions(CommitMessageTransformer.class)) {
				message = transformer.transform(projectModel.getObject(), message);
			}
			return message;
		}

		@Override
		protected void onDetach() {
			projectModel.detach();
			messageModel.detach();
			super.onDetach();
		}
		
	});
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:22,代码来源:CommitMessageLabel.java

示例5: 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.detach方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。