本文整理汇总了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);
}
示例2: TagsPage
import com.gitblit.wicket.panels.TagsPanel; //导入依赖的package包/类
public TagsPage(PageParameters params) {
super(params);
add(new TagsPanel("tagsPanel", repositoryName, getRepository(), -1));
}