当前位置: 首页>>代码示例>>Java>>正文


Java TagsPanel类代码示例

本文整理汇总了Java中com.gitblit.wicket.panels.TagsPanel的典型用法代码示例。如果您正苦于以下问题:Java TagsPanel类的具体用法?Java TagsPanel怎么用?Java TagsPanel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TagsPanel类属于com.gitblit.wicket.panels包,在下文中一共展示了TagsPanel类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: OverviewPage

import com.gitblit.wicket.panels.TagsPanel; //导入依赖的package包/类
public OverviewPage(PageParameters params) {
	super(params);

	int numberRefs = GitBlit.getInteger(Keys.web.summaryRefsCount, 5);

	Repository r = getRepository();
	final RepositoryModel model = getRepositoryModel();
	UserModel user = GitBlitWebSession.get().getUser();
	if (user == null) {
		user = UserModel.ANONYMOUS;
	}

	List<Metric> metrics = null;
	Metric metricsTotal = null;
	if (!model.skipSummaryMetrics && GitBlit.getBoolean(Keys.web.generateActivityGraph, true)) {
		metrics = GitBlit.self().getRepositoryDefaultMetrics(model, r);
		metricsTotal = metrics.remove(0);
	}

	addSyndicationDiscoveryLink();

	// repository description
	add(new Label("repositoryDescription", getRepositoryModel().description));
	
	// owner links
	final List<String> owners = new ArrayList<String>(getRepositoryModel().owners);
	ListDataProvider<String> ownersDp = new ListDataProvider<String>(owners);
	DataView<String> ownersView = new DataView<String>("repositoryOwners", ownersDp) {
		private static final long serialVersionUID = 1L;
		int counter = 0;
		public void populateItem(final Item<String> item) {
			UserModel ownerModel = GitBlit.self().getUserModel(item.getModelObject());
			if (ownerModel != null) {
				item.add(new LinkPanel("owner", null, ownerModel.getDisplayName(), UserPage.class,
						WicketUtils.newUsernameParameter(ownerModel.username)).setRenderBodyOnly(true));
			} else {
				item.add(new Label("owner").setVisible(false));
			}
			counter++;
			item.add(new Label("comma", ",").setVisible(counter < owners.size()));
			item.setRenderBodyOnly(true);
		}
	};
	ownersView.setRenderBodyOnly(true);
	add(ownersView);
	
	add(WicketUtils.createTimestampLabel("repositoryLastChange",
			JGitUtils.getLastChange(r), getTimeZone(), getTimeUtils()));
	add(new Label("repositorySize", model.size));
	
	if (metricsTotal == null) {
		add(new Label("branchStats", ""));
	} else {
		add(new Label("branchStats",
				MessageFormat.format(getString("gb.branchStats"), metricsTotal.count,
						metricsTotal.tag, getTimeUtils().duration(metricsTotal.duration))));
	}
	add(new BookmarkablePageLink<Void>("metrics", MetricsPage.class,
			WicketUtils.newRepositoryParameter(repositoryName)));

	add(new RepositoryUrlPanel("repositoryUrlPanel", false, user, model));

	int pushCount = GitBlit.getInteger(Keys.web.overviewPushCount, 5);
	PushesPanel pushes = new PushesPanel("pushesPanel", getRepositoryModel(), r, pushCount, 0, false);
	add(pushes);
	add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs).hideIfEmpty());
	add(new BranchesPanel("branchesPanel", getRepositoryModel(), r, numberRefs, false).hideIfEmpty());

	// Display an activity line graph
	insertActivityGraph(metrics);
}
 
开发者ID:warpfork,项目名称:gitblit,代码行数:72,代码来源:OverviewPage.java

示例2: TagsPage

import com.gitblit.wicket.panels.TagsPanel; //导入依赖的package包/类
public TagsPage(PageParameters params) {
	super(params);

	add(new TagsPanel("tagsPanel", repositoryName, getRepository(), -1));

}
 
开发者ID:warpfork,项目名称:gitblit,代码行数:7,代码来源:TagsPage.java


注:本文中的com.gitblit.wicket.panels.TagsPanel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。