當前位置: 首頁>>代碼示例>>Java>>正文


Java Component.add方法代碼示例

本文整理匯總了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(" "));
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:16,代碼來源:WicketUtils.java

示例2: CollapseBehavior

import org.apache.wicket.Component; //導入方法依賴的package包/類
public CollapseBehavior(Component target) {
	this.target = target;
	target.add(AttributeAppender.append("class", "collapse"));
	target.setOutputMarkupId(true);
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:6,代碼來源:CollapseBehavior.java

示例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);
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:62,代碼來源:CodeCommentPanel.java

示例4: addCommitClass

import org.apache.wicket.Component; //導入方法依賴的package包/類
private void addCommitClass(Component item, int commitIndex) {
	item.add(AttributeAppender.append("class", " commit-item-" + commitIndex));
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:4,代碼來源:ProjectCommitsPage.java


注:本文中的org.apache.wicket.Component.add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。