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


Java AjaxRequestTarget.add方法代码示例

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


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

示例1: selectRevision

import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
private void selectRevision(AjaxRequestTarget target, String revision) {
	try {
		if (projectModel.getObject().getRevCommit(revision, false) != null) {
			onSelect(target, revision);
		} else {
			feedbackMessage = "Can not find commit of revision " + revision + "";
			target.add(feedback);
		}
	} catch (Exception e) {
		// revision selector might be closed in onSelect handler
		if (findPage() != null) {
			feedbackMessage = Throwables.getRootCause(e).getMessage();
			target.add(feedback);
		} else {
			Throwables.propagate(e);
		}
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:19,代码来源:RevisionSelector.java

示例2: newBlobContent

import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
private void newBlobContent(@Nullable AjaxRequestTarget target) {
	PrioritizedComponentRenderer mostPrioritizedRenderer = null;
	for (BlobRendererContribution contribution: GitPlex.getExtensions(BlobRendererContribution.class)) {
		PrioritizedComponentRenderer renderer = contribution.getRenderer(this);
		if (renderer != null) {
			if (mostPrioritizedRenderer == null || mostPrioritizedRenderer.getPriority() > renderer.getPriority())
				mostPrioritizedRenderer = renderer;
		}
	}
	Component blobContent = Preconditions.checkNotNull(mostPrioritizedRenderer).render(BLOB_CONTENT_ID);
	if (target != null) {
		replace(blobContent);
		target.add(blobContent);
	} else {
		add(blobContent);
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:18,代码来源:ProjectBlobPage.java

示例3: onSelectTab

import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
private void onSelectTab(AjaxRequestTarget target) {
	refs = findRefs();
	revField.setModel(Model.of(""));
	revInput = null;
	target.add(revField);
	newItemsView(target);
	String script = String.format("gitplex.server.revisionSelector.bindInputKeys('%s');", getMarkupId(true));
	target.appendJavaScript(script);
	target.focusComponent(revField);
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:11,代码来源:RevisionSelector.java

示例4: FloatingPanel

import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
public FloatingPanel(AjaxRequestTarget target, AlignTarget alignTarget, AlignPlacement placement) {
	super(((BasePage)target.getPage()).getRootComponents().newChildId());
	
	BasePage page = (BasePage) target.getPage(); 
	page.getRootComponents().add(this);
	target.prependJavaScript(String.format("$('body').append(\"<div id='%s'></div>\");", getMarkupId()));
	target.add(this);

	this.alignTarget = alignTarget;
	this.placement = placement;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:12,代码来源:FloatingPanel.java

示例5: ModalPanel

import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
public ModalPanel(AjaxRequestTarget target, Size size) {
	super(((BasePage)target.getPage()).getRootComponents().newChildId());
	
	this.size = size;
	
	BasePage page = (BasePage) target.getPage(); 
	page.getRootComponents().add(this);
	target.prependJavaScript(String.format("$('body').append(\"<div id='%s'></div>\");", getMarkupId()));
	target.add(this);
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:11,代码来源:ModalPanel.java

示例6: onStatusChanged

import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
private void onStatusChanged(AjaxRequestTarget target, Fragment fragment, CodeCommentStatusChange statusChange) {
	WebMarkupContainer activityContainer = newActivityContainer(activitiesView.newChildId(), statusChange);
	activitiesView.add(activityContainer);

	String script = String.format("$('#%s .add-reply').before('<div id=\"%s\"></div>');", 
			CodeCommentPanel.this.getMarkupId(), activityContainer.getMarkupId());
	target.prependJavaScript(script);
	target.add(activityContainer);

	WebMarkupContainer addReplyContainer = newAddReplyContainer();
	fragment.replaceWith(addReplyContainer);
	target.add(addReplyContainer);
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:14,代码来源:CodeCommentPanel.java

示例7: onReplyAdded

import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
private void onReplyAdded(AjaxRequestTarget target, Fragment fragment, @Nullable CodeCommentReply reply) {
	if (reply != null) {
		WebMarkupContainer activityContainer = newActivityContainer(activitiesView.newChildId(), reply);
		activitiesView.add(activityContainer);

		String script = String.format("$('#%s .add-reply').before('<div id=\"%s\"></div>');", 
				CodeCommentPanel.this.getMarkupId(), activityContainer.getMarkupId());
		target.prependJavaScript(script);
		target.add(activityContainer);
	}
	
	WebMarkupContainer addReplyContainer = newAddReplyContainer();
	fragment.replaceWith(addReplyContainer);
	target.add(addReplyContainer);
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:16,代码来源:CodeCommentPanel.java

示例8: newContent

import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
@Override
protected Component newContent(String id, FloatingPanel dropdown) {
	return new ProjectSelector(id, projectsModel, currentProjectId) {

		@Override
		protected void onSelect(AjaxRequestTarget target, Project project) {
			dropdown.close();
			target.add(ProjectPicker.this);
			ProjectPicker.this.onSelect(target, project);
		}

	};
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:14,代码来源:ProjectPicker.java

示例9: replaceItem

import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
private Component replaceItem(AjaxRequestTarget target, int index) {
	Component item = commitsView.get(index);
	Component newItem = newCommitItem(item.getId(), index);
	item.replaceWith(newItem);
	target.add(newItem);
	return newItem;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:9,代码来源:ProjectCommitsPage.java

示例10: updateCommits

import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
private void updateCommits(AjaxRequestTarget target) {
	state.page = 1;

	target.add(feedback);
	body.replace(commitsView = newCommitsView());
	target.add(body);
	target.add(foot);
	target.appendJavaScript(renderCommitGraph());
	pushState(target);
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:11,代码来源:ProjectCommitsPage.java

示例11: onPopState

import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
@Override
protected void onPopState(AjaxRequestTarget target, Serializable data) {
	super.onPopState(target, data);
	
	state = (State) data;

	target.add(queryForm);
	
	body.replace(commitsView = newCommitsView());
	target.add(body);
	target.add(foot);
	
	target.appendJavaScript(renderCommitGraph());
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:15,代码来源:ProjectCommitsPage.java

示例12: newBlobNavigator

import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
private void newBlobNavigator(@Nullable AjaxRequestTarget target) {
	Component blobNavigator = new BlobNavigator(BLOB_NAVIGATOR_ID, this);
	if (target != null) {
		replace(blobNavigator);
		target.add(blobNavigator);
	} else {
		add(blobNavigator);
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:10,代码来源:ProjectBlobPage.java

示例13: onPopState

import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
@Override
protected void onPopState(AjaxRequestTarget target, Serializable data) {
	super.onPopState(target, data);
	
	state = (State) data;
	GitPlex.getInstance(WebSocketManager.class).onRegionChange(this);
	
	newTabPanel(target);
	target.add(tabbable);
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:11,代码来源:RevisionComparePage.java

示例14: newSearchResult

import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
private void newSearchResult(@Nullable AjaxRequestTarget target, @Nullable List<QueryHit> hits) {
	Component content;
	if (hits != null) {
		content = new SearchResultPanel("content", this, hits) {
			
			@Override
			protected void onClose(AjaxRequestTarget target) {
				newSearchResult(target, null);
				resizeWindow(target);
			}
			
		};
		if (target != null) {
			target.appendJavaScript(""
					+ "$('#project-blob>.search-result').show(); "
					+ "$('#project-blob .search-result>.body').focus();");
		}
	} else {
		content = new WebMarkupContainer("content").setOutputMarkupId(true);
		if (target != null) 
			target.appendJavaScript("$('#project-blob>.search-result').hide();");
		else 
			searchResult.add(AttributeAppender.replace("style", "display: none;"));
	}
	if (target != null) {
		searchResult.replace(content);
		target.add(content);
	} else {
		searchResult.add(content);
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:32,代码来源:ProjectBlobPage.java

示例15: onSelectTab

import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
private void onSelectTab(AjaxRequestTarget target) {
	WebResponse response = (WebResponse) RequestCycle.get().getResponse();
	Cookie cookie = new Cookie(COOKIE_SEARCH_TYPE, option.getClass().getName());
	cookie.setMaxAge(Integer.MAX_VALUE);
	response.addCookie(cookie);
	SearchOptionEditor editor = newSearchOptionEditor(option);
	form.replace(editor);
	target.add(editor);
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:10,代码来源:AdvancedSearchPanel.java


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