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