本文整理汇总了Java中org.apache.wicket.markup.html.panel.Fragment类的典型用法代码示例。如果您正苦于以下问题:Java Fragment类的具体用法?Java Fragment怎么用?Java Fragment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Fragment类属于org.apache.wicket.markup.html.panel包,在下文中一共展示了Fragment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newAddReplyContainer
import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
private WebMarkupContainer newAddReplyContainer() {
WebMarkupContainer addReplyContainer = new Fragment("addReply", "addReplyFrag", this) {
@Override
protected void onConfigure() {
super.onConfigure();
setVisible(SecurityUtils.getUser() != null);
}
};
addReplyContainer.setOutputMarkupId(true);
addReplyContainer.add(new AjaxLink<Void>("reply") {
@Override
public void onClick(AjaxRequestTarget target) {
onAddReply(target, false, null);
}
});
return addReplyContainer;
}
示例2: newAcceptedFrag
import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
private Fragment newAcceptedFrag() {
Fragment fragment = new Fragment("status", "mergedFrag", this);
fragment.add(new BranchLink("sourceBranch", getPullRequest().getSource(), null));
fragment.add(new BranchLink("targetBranch", getPullRequest().getTarget(), null));
fragment.add(new Link<Void>("swapBranches") {
@Override
public void onClick() {
setResponsePage(
NewRequestPage.class,
paramsOf(getProject(), getPullRequest().getSource(), getPullRequest().getTarget()));
}
});
return fragment;
}
示例3: newSinceChangesRow
import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
private Component newSinceChangesRow(String id, Date sinceDate) {
WebMarkupContainer row = new WebMarkupContainer(id);
row.setOutputMarkupId(true);
row.add(AttributeAppender.append("class", " non-discussion"));
WebMarkupContainer avatarColumn = new WebMarkupContainer("avatar");
avatarColumn.add(new WebMarkupContainer("avatar"));
row.add(avatarColumn);
WebMarkupContainer contentColumn = new Fragment("content", "sinceChangesRowContentFrag", this);
contentColumn.add(new SinceChangesLink("sinceChanges", requestModel, sinceDate));
row.add(contentColumn);
row.add(AttributeAppender.append("class", "since-changes"));
return row;
}
示例4: newAdditionalActions
import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
@Override
public WebMarkupContainer newAdditionalActions(String id) {
WebMarkupContainer actions = new Fragment(id, "actionsFrag", this);
if (!symbols.isEmpty()) {
actions.add(new CheckBox("outline", Model.of(isOutlineVisibleInitially())).add(new OnChangeAjaxBehavior() {
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
attributes.setMethod(Method.POST);
}
@Override
protected void onUpdate(AjaxRequestTarget target) {
toggleOutline(target);
}
}));
} else {
actions.add(new WebMarkupContainer("outline").setVisible(false));
}
return actions;
}
示例5: UserModalPage
import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
public UserModalPage(
final PageReference callerPageRef,
final ModalWindow window,
final UserTO userTO,
final Mode mode,
final boolean resetPassword) {
super();
this.callerPageRef = callerPageRef;
this.window = window;
this.userTO = userTO;
this.mode = mode;
this.resetPassword = resetPassword;
fragment = new Fragment("userModalFrag", "userModalEditFrag", this);
fragment.setOutputMarkupId(true);
add(fragment);
}
示例6: FieldPanel
import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
public FieldPanel(
final String id,
final String name,
final IModel<T> model,
final boolean active) {
super(id, model);
this.id = id;
this.name = name;
this.active = active;
final Fragment fragment =
new Fragment("required", "notRequiredFragment", this);
add(fragment);
setOutputMarkupId(true);
}
示例7: resolveResource
import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
protected String resolveResource(String src) {
// if it's an absolute path, return it:
if (src.startsWith("/") || src.startsWith("http://") || src.startsWith("https://"))
return (src);
// use the parent container class to resolve the resource reference
Component parent = getParent();
if (parent instanceof Fragment) {
// must check for fragment, otherwise we end up in Wicket namespace
parent = parent.getParent();
}
if (parent != null) {
ResourceReference resRef = new ResourceReference(parent.getClass(), src, false);
return (urlFor(resRef).toString());
}
return (src);
}
示例8: addDataView
import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
private void addDataView(String id, final String className, IDataProvider<ArtifactBean> dataProvider) {
// Data view
final DataView<ArtifactBean> artifactDataView = new ArtifactBeanDataView("dataView", dataProvider);
dataViews.add(artifactDataView);
// Fragment
Fragment fragment = new Fragment(id, "dataViewFragment", this) {
private static final long serialVersionUID = 1L;
@Override
protected void onConfigure() {
super.onConfigure();
setVisible(artifactDataView.getDataProvider().size() != 0);
}
};
fragment.add(new Label("title", new ResourceModel("artifact.follow.pom." + id)),
artifactDataView);
add(fragment);
}
示例9: onStatusChanged
import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的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);
}
示例10: onReplyAdded
import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的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);
}
示例11: newFragment
import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
private Fragment newFragment(String message, boolean warning) {
Fragment fragment = new Fragment(CONTENT_ID, "noDiffFrag", this);
fragment.add(new BlobDiffTitle("title", change));
if (warning)
fragment.add(new WebMarkupContainer("icon").add(AttributeAppender.append("class", "fa fa-warning")));
else
fragment.add(new WebMarkupContainer("icon").add(AttributeAppender.append("class", "fa fa-info-circle")));
fragment.add(new Label("message", message));
return fragment;
}
示例12: onInitialize
import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
String title = exception.getClass().getSimpleName();
String suffixToRemove = "Exception";
if (title.endsWith(suffixToRemove))
title = title.substring(0, title.length()-suffixToRemove.length());
title = WordUtils.capitalizeFully(WordUtils.uncamel(title));
WebMarkupContainer container = new WebMarkupContainer("error");
container.setOutputMarkupId(true);
add(container);
container.add(new Label("title", title));
container.add(new Label("description", exception.getMessage()));
container.add(new ViewStateAwarePageLink<Void>("dashboard", ProjectListPage.class));
container.add(new AjaxLink<Void>("showDetail") {
@Override
public void onClick(AjaxRequestTarget target) {
Fragment fragment = new Fragment("detail", "detailFrag", ExpectedExceptionPage.this);
fragment.add(new MultilineLabel("body", Strings.toString(exception)));
container.replace(fragment);
target.add(container);
setVisible(false);
}
});
container.add(new WebMarkupContainer("detail"));
}
示例13: RoleSummaryPanel
import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
public RoleSummaryPanel(final String id,
final ModalWindow window, final PageReference callerPageRef) {
super(id);
this.callerPageRef = callerPageRef;
this.window = window;
fragment = new Fragment("rolePanel",
this.selectedNode == null
? "fakerootFrag" : (this.selectedNode.getId() != 0
? "roleViewPanel" : "rootPanel"), this);
if (this.selectedNode != null) {
if (this.selectedNode.getId() != 0) {
roleTabPanel =
new RoleTabPanel("nodeViewPanel",
selectedNode, window, callerPageRef);
roleTabPanel.setOutputMarkupId(true);
fragment.add(roleTabPanel);
} else {
actionLink =
new TreeActionLinkPanel("actionLink",
this.selectedNode.getId(),
new CompoundPropertyModel(this.selectedNode),
window, callerPageRef);
fragment.add(actionLink);
}
}
add(fragment);
}
示例14: onEvent
import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
@Override
public void onEvent(final IEvent<?> event) {
super.onEvent(event);
if (event.getPayload() instanceof TreeNodeClickUpdate) {
final TreeNodeClickUpdate update =
(TreeNodeClickUpdate) event.getPayload();
this.selectedNode =
restClient.readRole(update.getSelectedNodeId());
fragment = new Fragment("rolePanel", (update.getSelectedNodeId()
!= 0
? "roleViewPanel" : "rootPanel"), this);
if (update.getSelectedNodeId() != 0) {
roleTabPanel =
new RoleTabPanel("nodeViewPanel",
this.selectedNode, window, callerPageRef);
roleTabPanel.setOutputMarkupId(true);
fragment.addOrReplace(roleTabPanel);
} else {
actionLink =
new TreeActionLinkPanel("actionLink",
update.getSelectedNodeId(),
new CompoundPropertyModel(this.selectedNode),
window, callerPageRef);
actionLink.setOutputMarkupId(true);
fragment.addOrReplace(actionLink);
}
replace(fragment);
update.getTarget().add(this);
}
}
示例15: ActionLinksPanel
import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
public ActionLinksPanel(final String componentId, final IModel<?> model) {
super(componentId, model);
super.add(new Fragment("panelClaim", "emptyFragment", this));
super.add(new Fragment("panelCreate", "emptyFragment", this));
super.add(new Fragment("panelEdit", "emptyFragment", this));
super.add(new Fragment("panelTemplate", "emptyFragment", this));
super.add(new Fragment("panelSearch", "emptyFragment", this));
super.add(new Fragment("panelDelete", "emptyFragment", this));
super.add(new Fragment("panelExecute", "emptyFragment", this));
super.add(new Fragment("panelDryRun", "emptyFragment", this));
super.add(new Fragment("panelExport", "emptyFragment", this));
}