當前位置: 首頁>>代碼示例>>Java>>正文


Java PageParameters.getIndexedCount方法代碼示例

本文整理匯總了Java中org.apache.wicket.request.mapper.parameter.PageParameters.getIndexedCount方法的典型用法代碼示例。如果您正苦於以下問題:Java PageParameters.getIndexedCount方法的具體用法?Java PageParameters.getIndexedCount怎麽用?Java PageParameters.getIndexedCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.wicket.request.mapper.parameter.PageParameters的用法示例。


在下文中一共展示了PageParameters.getIndexedCount方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: State

import org.apache.wicket.request.mapper.parameter.PageParameters; //導入方法依賴的package包/類
public State(PageParameters params) {
	List<String> revisionSegments = new ArrayList<>();
	String segment = params.get(PARAM_REVISION).toString();
	if (segment.length() != 0)
		revisionSegments.add(segment);
	for (int i=0; i<params.getIndexedCount(); i++) {
		segment = params.get(i).toString();
		if (segment.length() != 0)
			revisionSegments.add(segment);
	}
	
	revision = Joiner.on("/").join(revisionSegments);
	compareWith = params.get(PARAM_COMPARE_WITH).toString();
	whitespaceOption = WhitespaceOption.ofNullableName(params.get(PARAM_WHITESPACE_OPTION).toString());
	pathFilter = params.get(PARAM_PATH_FILTER).toString();
	blameFile = params.get(PARAM_BLAME_FILE).toString();
	commentId = params.get(PARAM_COMMENT).toOptionalLong();
	mark = MarkPos.fromString(params.get(PARAM_MARK).toString());
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:20,代碼來源:CommitDetailPage.java

示例2: ProjectBlobPage

import org.apache.wicket.request.mapper.parameter.PageParameters; //導入方法依賴的package包/類
public ProjectBlobPage(PageParameters params) {
	super(params);
	
	if (getProject().getDefaultBranch() == null) 
		throw new RestartResponseException(NoBranchesPage.class, paramsOf(getProject()));
	
	List<String> revisionAndPathSegments = new ArrayList<>();
	String segment = params.get(PARAM_REVISION).toString();
	if (segment != null && segment.length() != 0)
		revisionAndPathSegments.add(segment);
	segment = params.get(PARAM_PATH).toString();
	if (segment != null && segment.length() != 0)
		revisionAndPathSegments.add(segment);
	
	for (int i=0; i<params.getIndexedCount(); i++) {
		segment = params.get(i).toString();
		if (segment.length() != 0)
			revisionAndPathSegments.add(segment);
	}

	BlobIdent blobIdent = new BlobIdent(getProject(), revisionAndPathSegments); 
	state = new State(blobIdent);

	String modeStr = params.get(PARAM_MODE).toString();
	if (modeStr != null)
		state.mode = Mode.valueOf(modeStr.toUpperCase());

	resolvedRevision = getProject().getObjectId(state.blobIdent.revision);
	
	state.mark = TextRange.of(params.get(PARAM_MARK).toString());
	
	state.requestId = params.get(PARAM_REQUEST).toOptionalLong();
	
	state.commentId = params.get(PARAM_COMMENT).toOptionalLong();
	
	state.query = params.get(PARAM_QUERY).toString();
	
	if (state.mode == Mode.ADD || state.mode == Mode.EDIT || state.mode == Mode.DELETE) {
		if (!isOnBranch()) 
			throw new IllegalArgumentException("Files can only be edited on branch");
		
		String path = state.blobIdent.path;
		if (path != null && state.blobIdent.isTree())
			path += "/";
		if (!SecurityUtils.canModify(getProject(), state.blobIdent.revision, path))
			unauthorized();
	}

	WebRequest request = (WebRequest) RequestCycle.get().getRequest();
	String accept = request.getHeader("Accept");
	if (accept != null && !accept.startsWith("text/html") && state.blobIdent.isFile()) {
		RequestCycle.get().scheduleRequestHandlerAfterCurrent(
				new ResourceReferenceRequestHandler(new RawBlobResourceReference(), getPageParameters()));
	}
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:56,代碼來源:ProjectBlobPage.java


注:本文中的org.apache.wicket.request.mapper.parameter.PageParameters.getIndexedCount方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。