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


Java IRequestParameters类代码示例

本文整理汇总了Java中org.apache.wicket.request.IRequestParameters的典型用法代码示例。如果您正苦于以下问题:Java IRequestParameters类的具体用法?Java IRequestParameters怎么用?Java IRequestParameters使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IRequestParameters类属于org.apache.wicket.request包,在下文中一共展示了IRequestParameters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: respond

import org.apache.wicket.request.IRequestParameters; //导入依赖的package包/类
@Override
protected void respond(AjaxRequestTarget target) {
	IRequestParameters params = RequestCycle.get().getRequest().getPostParameters();
	
	String tooltipId = params.getParameterValue("tooltip").toString();
	String commitHash = params.getParameterValue("commit").toString();
	RevCommit commit = getProject().getRevCommit(commitHash);
	String authoring;
	if (commit.getAuthorIdent() != null) {
		authoring = commit.getAuthorIdent().getName();
		if (commit.getCommitterIdent() != null)
			authoring += " " + DateUtils.formatAge(commit.getCommitterIdent().getWhen());
		authoring = "'" + JavaScriptEscape.escapeJavaScript(authoring) + "'";
	} else {
		authoring = "undefined";
	}
	String message = JavaScriptEscape.escapeJavaScript(commit.getFullMessage());
	String script = String.format("gitplex.server.blameMessage.show('%s', %s, '%s');", tooltipId, authoring, message); 
	target.appendJavaScript(script);
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:21,代码来源:BlameMessageBehavior.java

示例2: mergeSpan

import org.apache.wicket.request.IRequestParameters; //导入依赖的package包/类
private void mergeSpan(IRequestParameters aRequest,
        UserAnnotationSegment aCurationUserSegment, JCas aJcas)
        throws AnnotationException, UIMAException, ClassNotFoundException, IOException
{
    Integer address = aRequest.getParameterValue("id").toInteger();
    String spanType = removePrefix(aRequest.getParameterValue("type").toString());

    String username = aCurationUserSegment.getUsername();

    SourceDocument sourceDocument = aCurationUserSegment.getAnnotatorState().getDocument();

    AnnotationDocument clickedAnnotationDocument = null;
    List<AnnotationDocument> annotationDocuments = documentService
            .listAnnotationDocuments(sourceDocument);
    for (AnnotationDocument annotationDocument : annotationDocuments) {
        if (annotationDocument.getUser().equals(username)) {
            clickedAnnotationDocument = annotationDocument;
            break;
        }
    }

    createSpan(spanType, aCurationUserSegment.getAnnotatorState(), aJcas,
            clickedAnnotationDocument, address);
}
 
开发者ID:webanno,项目名称:webanno,代码行数:25,代码来源:SuggestionViewPanel.java

示例3: actionDoAction

import org.apache.wicket.request.IRequestParameters; //导入依赖的package包/类
private Object actionDoAction(AjaxRequestTarget aTarget, IRequestParameters request, JCas jCas,
        VID paramId)
    throws IOException
{
    StringValue layerParam = request.getParameterValue(PARAM_SPAN_TYPE);
    if (!layerParam.isEmpty()) {
        long layerId = Long.parseLong(layerParam.beforeFirst('_'));
        AnnotationLayer layer = annotationService.getLayer(layerId);
        if (!StringUtils.isEmpty(layer.getOnClickJavascriptAction())) {
            // parse the action
            List<AnnotationFeature> features = annotationService.listAnnotationFeature(layer);
            AnnotationFS anno = WebAnnoCasUtil.selectByAddr(jCas, paramId.getId());
            Map<String, Object> functionParams = OnClickActionParser.parse(layer, features,
                    getModelObject().getDocument(), anno);
            // define anonymous function, fill the body and immediately execute
            String js = String.format("(function ($PARAM){ %s })(%s)",
                    layer.getOnClickJavascriptAction(), JSONUtil.toJsonString(functionParams));
            aTarget.appendJavaScript(js);
        }
    }
    
    return null;
}
 
开发者ID:webanno,项目名称:webanno,代码行数:24,代码来源:BratAnnotationEditor.java

示例4: actionArc

import org.apache.wicket.request.IRequestParameters; //导入依赖的package包/类
private ArcAnnotationResponse actionArc(AjaxRequestTarget aTarget, IRequestParameters request,
        JCas jCas, VID paramId)
    throws IOException, AnnotationException
{
    AnnotationFS originFs = selectByAddr(jCas,
            request.getParameterValue(PARAM_ORIGIN_SPAN_ID).toInt());
    AnnotationFS targetFs = selectByAddr(jCas,
            request.getParameterValue(PARAM_TARGET_SPAN_ID).toInt());

    AnnotatorState state = getModelObject();
    Selection selection = state.getSelection();
    selection.selectArc(paramId, originFs, targetFs);

    if (selection.getAnnotation().isNotSet()) {
        // Create new annotation
        state.getAction().setAnnotate(true);
        getActionHandler().actionCreateOrUpdate(aTarget, jCas);
    }
    else {
        state.getAction().setAnnotate(false);
        getActionHandler().actionSelect(aTarget, jCas);
    }

    return new ArcAnnotationResponse();
}
 
开发者ID:webanno,项目名称:webanno,代码行数:26,代码来源:BratAnnotationEditor.java

示例5: getOffsetsFromRequest

import org.apache.wicket.request.IRequestParameters; //导入依赖的package包/类
/**
 * Extract offset information from the current request. These are either offsets of an existing
 * selected annotations or offsets contained in the request for the creation of a new
 * annotation.
 */
private Offsets getOffsetsFromRequest(IRequestParameters request, JCas jCas, VID aVid)
    throws  IOException
{
    if (aVid.isNotSet() || aVid.isSynthetic()) {
        // Create new span annotation - in this case we get the offset information from the
        // request
        String offsets = request.getParameterValue(PARAM_OFFSETS).toString();
        OffsetsList offsetLists = JSONUtil.getJsonConverter().getObjectMapper()
                .readValue(offsets, OffsetsList.class);

        int annotationBegin = getModelObject().getWindowBeginOffset()
                + offsetLists.get(0).getBegin();
        int annotationEnd = getModelObject().getWindowBeginOffset()
                + offsetLists.get(offsetLists.size() - 1).getEnd();
        return new Offsets(annotationBegin, annotationEnd);
    }
    else {
        // Edit existing span annotation - in this case we look up the offsets in the CAS
        // Let's not trust the client in this case.
        AnnotationFS fs = WebAnnoCasUtil.selectByAddr(jCas, aVid.getId());
        return new Offsets(fs.getBegin(), fs.getEnd());
    }
}
 
开发者ID:webanno,项目名称:webanno,代码行数:29,代码来源:BratAnnotationEditor.java

示例6: createUrlFragmentBehavior

import org.apache.wicket.request.IRequestParameters; //导入依赖的package包/类
private UrlParametersReceivingBehavior createUrlFragmentBehavior()
{
    return new UrlParametersReceivingBehavior()
    {
        private static final long serialVersionUID = -3860933016636718816L;

        @Override
        protected void onParameterArrival(IRequestParameters aRequestParameters,
                AjaxRequestTarget aTarget)
        {
            aTarget.addChildren(getPage(), IFeedback.class);

            StringValue project = aRequestParameters.getParameterValue(PAGE_PARAM_PROJECT_ID);
            StringValue document = aRequestParameters.getParameterValue(PAGE_PARAM_DOCUMENT_ID);
            StringValue focus = aRequestParameters.getParameterValue(PAGE_PARAM_FOCUS);

            handleParameters(aTarget, project, document, focus, false);
        }
    };
}
 
开发者ID:webanno,项目名称:webanno,代码行数:21,代码来源:AnnotationPage.java

示例7: respond

import org.apache.wicket.request.IRequestParameters; //导入依赖的package包/类
@Override
protected void respond(AjaxRequestTarget target) {
	IRequestParameters params = RequestCycle.get().getRequest().getPostParameters();
	int page = params.getParameterValue("page").toInt();
	target.prependJavaScript(String.format("$('#%s .loading-indicator').remove();", 
			getComponent().getMarkupId()));
	
	appendPage(target, page);

	target.appendJavaScript(String.format("gitplex.infiniteScroll.check('%s');", 
			getComponent().getMarkupId()));
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:13,代码来源:InfiniteScrollBehavior.java

示例8: getMark

import org.apache.wicket.request.IRequestParameters; //导入依赖的package包/类
private MarkPos getMark(IRequestParameters params, String leftSideParam, 
		String beginLineParam, String beginCharParam, 
		String endLineParam, String endCharParam) {
	boolean leftSide = params.getParameterValue(leftSideParam).toBoolean();
	int beginLine = params.getParameterValue(beginLineParam).toInt();
	int beginChar = params.getParameterValue(beginCharParam).toInt();
	int endLine = params.getParameterValue(endLineParam).toInt();
	int endChar = params.getParameterValue(endCharParam).toInt();
	String commit = leftSide?getOldCommit().name():getNewCommit().name();
	return new MarkPos(commit, change.getPath(), new TextRange(beginLine, beginChar, endLine, endChar));
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:12,代码来源:TextDiffPanel.java

示例9: getMark

import org.apache.wicket.request.IRequestParameters; //导入依赖的package包/类
private TextRange getMark(IRequestParameters params, String beginLineParam, String beginCharParam, 
		String endLineParam, String endCharParam) {
	int beginLine = params.getParameterValue(beginLineParam).toInt();
	int beginChar = params.getParameterValue(beginCharParam).toInt();
	int endLine = params.getParameterValue(endLineParam).toInt();
	int endChar = params.getParameterValue(endCharParam).toInt();
	TextRange mark = new TextRange();
	mark.beginLine = beginLine;
	mark.beginChar = beginChar;
	mark.endLine = endLine;
	mark.endChar = endChar;
	return mark;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:14,代码来源:SourceViewPanel.java

示例10: logUnknownMode

import org.apache.wicket.request.IRequestParameters; //导入依赖的package包/类
/**
 * Override to perform custom logging on Unknown mode error.
 * 
 * @param exception
 */
protected void logUnknownMode(Exception exception) {
	IRequestParameters req = RequestCycle.get().getRequest().getRequestParameters();
	if (!req.getParameterValue(PARAMETERS_MODE).isEmpty()) {
		LOGGER.error("Error reading mode ; {}", req.getParameterValue(PARAMETERS_MODE).toString(), exception); 
	} else {
		LOGGER.error("Error reading mode ; empty parameter.", exception);
	}
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:14,代码来源:FileUploadBehavior.java

示例11: logReadFileListParameterError

import org.apache.wicket.request.IRequestParameters; //导入依赖的package包/类
/**
 * Override to perform custom logging on file list decoding error.
 * 
 * @param exception
 */
protected void logReadFileListParameterError(Exception exception) {
	IRequestParameters req = RequestCycle.get().getRequest().getRequestParameters();
	if (!req.getParameterValue(PARAMETERS_FILE_LIST).isEmpty()) {
		LOGGER.error("Error reading {} parameter ; {}", PARAMETERS_FILE_LIST, req.getParameterValue(PARAMETERS_FILE_LIST).toString(), exception); 
	} else {
		LOGGER.error("Error reading {} parameter ; empty parameter.", PARAMETERS_FILE_LIST, exception);
	}
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:14,代码来源:FileUploadBehavior.java

示例12: respond

import org.apache.wicket.request.IRequestParameters; //导入依赖的package包/类
/**
 * wicket callback - performs method dispatching based on {@link FileUploadBehavior#PARAMETERS_MODE} parameter.
 * 
 * @param target
 */
@Override
protected void respond(AjaxRequestTarget target) {
	IRequestParameters req = RequestCycle.get().getRequest().getRequestParameters();
	FileUploadMode mode;
	try {
		mode = req.getParameterValue(PARAMETERS_MODE).toEnum(FileUploadMode.class);
	} catch (Exception e) {
		// null or unknown value
		logUnknownMode(e);
		return;
	}
	
	switch (mode) {
	case CHANGE:
		respondChange(target);
		break;
	case UPLOAD_DONE:
		respondUploadDone(target);
		break;
	case UPLOAD_FAILS:
		respondUploadFails(target);
		break;
	default:
		throw new IllegalStateException();
	}
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:32,代码来源:FileUploadBehavior.java

示例13: respondUploadDone

import org.apache.wicket.request.IRequestParameters; //导入依赖的package包/类
/**
 * change wicket callback.
 * 
 * @param target
 */
protected void respondUploadDone(AjaxRequestTarget target) {
	IRequestParameters req = RequestCycle.get().getRequest().getRequestParameters();
	try {
		List<FileApiFile> successfileList = readSuccessFileApiFiles(req);
		List<FileApiFile> errorfileList = readErrorFileApiFiles(req);
		onFileUploadDone(target, successfileList, errorfileList);
	} catch (Exception e) {
		logReadFileListParameterError(e);
		onError(FileUploadMode.UPLOAD_DONE, target, e);
		return;
	}
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:18,代码来源:FileUploadBehavior.java

示例14: respondUploadFails

import org.apache.wicket.request.IRequestParameters; //导入依赖的package包/类
/**
 * change wicket callback.
 * 
 * @param target
 */
protected void respondUploadFails(AjaxRequestTarget target) {
	IRequestParameters req = RequestCycle.get().getRequest().getRequestParameters();
	try {
		String errorMessage = req.getParameterValue(PARAMETERS_UPLOAD_FAILS_ERROR_MESSAGE).toString("");
		FileUploadFailType failType = FileUploadFailType.fromName(req.getParameterValue(PARAMETERS_FAIL_TYPE).toString(""));
		onFileUploadFails(target, failType, errorMessage);
	} catch (Exception e) {
		logReadFileListParameterError(e);
		onError(FileUploadMode.UPLOAD_FAILS, target, e);
		return;
	}
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:18,代码来源:FileUploadBehavior.java

示例15: respondChange

import org.apache.wicket.request.IRequestParameters; //导入依赖的package包/类
/**
 * change wicket callback.
 * 
 * @param target
 * @return to upload file list (upload will be processed by objectUrl comparison)
 */
protected void respondChange(AjaxRequestTarget target) {
	IRequestParameters req = RequestCycle.get().getRequest().getRequestParameters();
	try {
		List<FileApiFile> fileList = readFileApiFiles(req);
		List<FileApiFile> acceptedFiles = onFileChange(target, fileList);
		target.prependJavaScript("window." + req.getParameterValue(PARAMETERS_DATA_VARIABLE_NAME).toString() + " = JSON.parse(" + JsUtils.doubleQuotes(writeFileApiFiles(acceptedFiles), true) + "); if (console) { console.log(window." + req.getParameterValue(PARAMETERS_DATA_VARIABLE_NAME).toString() + "); }");
	} catch (Exception e) {
		logReadFileListParameterError(e);
		onError(FileUploadMode.CHANGE, target, e);
		return;
	}
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:19,代码来源:FileUploadBehavior.java


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