本文整理汇总了Java中org.apache.wicket.Component.add方法的典型用法代码示例。如果您正苦于以下问题:Java Component.add方法的具体用法?Java Component.add怎么用?Java Component.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.Component
的用法示例。
在下文中一共展示了Component.add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: markLastVisibleChild
import org.apache.wicket.Component; //导入方法依赖的package包/类
public static void markLastVisibleChild(WebMarkupContainer container) {
Component lastVisible = null;
for (Component child: container) {
for (Behavior behavior: child.getBehaviors()) {
if (behavior instanceof LastVisibleAppender) {
child.remove(behavior);
}
}
child.configure();
if (child.isVisible())
lastVisible = child;
}
if (lastVisible != null)
lastVisible.add(new LastVisibleAppender("class", "last-visible").setSeparator(" "));
}
示例2: CollapseBehavior
import org.apache.wicket.Component; //导入方法依赖的package包/类
public CollapseBehavior(Component target) {
this.target = target;
target.add(AttributeAppender.append("class", "collapse"));
target.setOutputMarkupId(true);
}
示例3: onInitialize
import org.apache.wicket.Component; //导入方法依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
PageParameters params = RequestChangesPage.paramsOf(getComment());
add(new BookmarkablePageLink<Void>("outdatedContext", RequestChangesPage.class, params) {
@Override
public void onEvent(IEvent<?> event) {
super.onEvent(event);
if (event.getPayload() instanceof PageDataChanged) {
PageDataChanged pageDataChanged = (PageDataChanged) event.getPayload();
pageDataChanged.getHandler().add(this);
}
}
@Override
protected void onConfigure() {
super.onConfigure();
CodeComment comment = getComment();
if (getPage() instanceof ProjectBlobPage) {
setVisible(comment.isCodeChanged());
} else if (getPage() instanceof RequestChangesPage) {
RequestChangesPage page = (RequestChangesPage) getPage();
if (page.getState().newCommit.equals(comment.getCommentPos().getCommit())) {
setVisible(comment.isCodeChanged());
} else {
setVisible(!comment.getRequest().getHeadCommitHash().equals(page.getState().newCommit));
}
}
}
}.setOutputMarkupPlaceholderTag(true));
add(newCommentContainer());
activitiesView = new RepeatingView("activities");
List<CodeCommentActivity> activities = new ArrayList<>();
for (CodeCommentReply reply: getComment().getReplies()) {
activities.add(reply);
}
for (CodeCommentStatusChange statusChange: getComment().getStatusChanges()) {
activities.add(statusChange);
}
activities.sort((o1, o2)->o1.getDate().compareTo(o2.getDate()));
for (CodeCommentActivity activity: activities) {
Component activityContainer = newActivityContainer(activitiesView.newChildId(), activity);
if (!getComment().isVisitedAfter(activity.getDate()))
activityContainer.add(AttributeAppender.append("class", "new"));
activitiesView.add(activityContainer);
}
add(activitiesView);
add(newAddReplyContainer());
setOutputMarkupId(true);
}
示例4: addCommitClass
import org.apache.wicket.Component; //导入方法依赖的package包/类
private void addCommitClass(Component item, int commitIndex) {
item.add(AttributeAppender.append("class", " commit-item-" + commitIndex));
}