本文整理汇总了Java中com.gitblit.wicket.panels.RefsPanel类的典型用法代码示例。如果您正苦于以下问题:Java RefsPanel类的具体用法?Java RefsPanel怎么用?Java RefsPanel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RefsPanel类属于com.gitblit.wicket.panels包,在下文中一共展示了RefsPanel类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addRefs
import com.gitblit.wicket.panels.RefsPanel; //导入依赖的package包/类
protected void addRefs(Repository r, RevCommit c) {
add(new RefsPanel("refsPanel", repositoryName, JGitUtils.getAllRefs(r, getRepositoryModel().showRemoteBranches).get(c.getId())));
}
示例2: TagPage
import com.gitblit.wicket.panels.RefsPanel; //导入依赖的package包/类
public TagPage(PageParameters params) {
super(params);
Repository r = getRepository();
// Find tag in repository
List<RefModel> tags = JGitUtils.getTags(r, true, -1);
RefModel tagRef = null;
for (RefModel tag : tags) {
if (tag.getName().equals(objectId) || tag.getObjectId().getName().equals(objectId)) {
tagRef = tag;
break;
}
}
// Failed to find tag!
if (tagRef == null) {
error(MessageFormat.format(getString("gb.couldNotFindTag"), objectId), true);
}
// Display tag.
Class<? extends WebPage> linkClass;
PageParameters linkParameters = newCommitParameter(tagRef.getReferencedObjectId().getName());
String typeKey;
switch (tagRef.getReferencedObjectType()) {
case Constants.OBJ_BLOB:
typeKey = "gb.blob";
linkClass = BlobPage.class;
break;
case Constants.OBJ_TREE:
typeKey = "gb.tree";
linkClass = TreePage.class;
break;
case Constants.OBJ_COMMIT:
default:
typeKey = "gb.commit";
linkClass = CommitPage.class;
break;
}
add(new GravatarImage("taggerAvatar", tagRef.getAuthorIdent()));
add(new RefsPanel("tagName", repositoryName, Arrays.asList(tagRef)));
add(new Label("tagId", tagRef.getObjectId().getName()));
add(new LinkPanel("taggedObject", "list", tagRef.getReferencedObjectId().getName(),
linkClass, linkParameters));
add(new Label("taggedObjectType", getString(typeKey)));
add(createPersonPanel("tagger", tagRef.getAuthorIdent(), com.gitblit.Constants.SearchType.AUTHOR));
Date when = new Date(0);
if (tagRef.getAuthorIdent() != null) {
when = tagRef.getAuthorIdent().getWhen();
}
add(WicketUtils.createTimestampLabel("tagDate", when, getTimeZone(), getTimeUtils()));
addFullText("fullMessage", tagRef.getFullMessage(), true);
}
示例3: addRefs
import com.gitblit.wicket.panels.RefsPanel; //导入依赖的package包/类
protected void addRefs(Repository r, RevCommit c) {
add(new RefsPanel("refsPanel", repositoryName, c, JGitUtils.getAllRefs(r, getRepositoryModel().showRemoteBranches)));
}
示例4: TagPage
import com.gitblit.wicket.panels.RefsPanel; //导入依赖的package包/类
public TagPage(PageParameters params) {
super(params);
Repository r = getRepository();
// Find tag in repository
List<RefModel> tags = JGitUtils.getTags(r, true, -1);
RefModel tagRef = null;
for (RefModel tag : tags) {
if (tag.getName().equals(objectId) || tag.getObjectId().getName().equals(objectId)) {
tagRef = tag;
break;
}
}
// Failed to find tag!
if (tagRef == null) {
error(MessageFormat.format(getString("gb.couldNotFindTag"), objectId), true);
}
// Display tag.
Class<? extends RepositoryPage> linkClass;
PageParameters linkParameters = newCommitParameter(tagRef.getReferencedObjectId().getName());
String typeKey;
switch (tagRef.getReferencedObjectType()) {
case Constants.OBJ_BLOB:
typeKey = "gb.blob";
linkClass = BlobPage.class;
break;
case Constants.OBJ_TREE:
typeKey = "gb.tree";
linkClass = TreePage.class;
break;
case Constants.OBJ_COMMIT:
default:
typeKey = "gb.commit";
linkClass = CommitPage.class;
break;
}
add(new LinkPanel("commit", "title", tagRef.displayName, linkClass, linkParameters));
add(new GravatarImage("taggerAvatar", tagRef.getAuthorIdent()));
add(new RefsPanel("tagName", repositoryName, Arrays.asList(tagRef)));
add(new Label("tagId", tagRef.getObjectId().getName()));
add(new LinkPanel("taggedObject", "list", tagRef.getReferencedObjectId().getName(),
linkClass, linkParameters));
add(new Label("taggedObjectType", getString(typeKey)));
add(createPersonPanel("tagger", tagRef.getAuthorIdent(), com.gitblit.Constants.SearchType.AUTHOR));
Date when = new Date(0);
if (tagRef.getAuthorIdent() != null) {
when = tagRef.getAuthorIdent().getWhen();
}
add(WicketUtils.createTimestampLabel("tagDate", when, getTimeZone(), getTimeUtils()));
addFullText("fullMessage", tagRef.getFullMessage(), true);
}