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