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


Java RefsPanel类代码示例

本文整理汇总了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())));
}
 
开发者ID:tomaswolf,项目名称:gerrit-gitblit-plugin,代码行数:4,代码来源:RepositoryPage.java

示例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);
}
 
开发者ID:warpfork,项目名称:gitblit,代码行数:57,代码来源:TagPage.java

示例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)));
}
 
开发者ID:warpfork,项目名称:gitblit,代码行数:4,代码来源:RepositoryPage.java

示例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);
}
 
开发者ID:BullShark,项目名称:IRCBlit,代码行数:58,代码来源:TagPage.java


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