本文整理匯總了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));
}