当前位置: 首页>>代码示例>>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;未经允许,请勿转载。