當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。