當前位置: 首頁>>代碼示例>>Java>>正文


Java WicketUtils.newObjectParameter方法代碼示例

本文整理匯總了Java中com.gitblit.wicket.WicketUtils.newObjectParameter方法的典型用法代碼示例。如果您正苦於以下問題:Java WicketUtils.newObjectParameter方法的具體用法?Java WicketUtils.newObjectParameter怎麽用?Java WicketUtils.newObjectParameter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.gitblit.wicket.WicketUtils的用法示例。


在下文中一共展示了WicketUtils.newObjectParameter方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: GravatarImage

import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
public GravatarImage(String id, PersonIdent person, int width, boolean linked) {
	super(id);

	String email = person.getEmailAddress() == null ? person.getName().toLowerCase() : person.getEmailAddress().toLowerCase();
	String hash = StringUtils.getMD5(email);
	Link<Void> link = new BookmarkablePageLink<Void>("link", GravatarProfilePage.class,
			WicketUtils.newObjectParameter(hash));
	link.add(new SimpleAttributeModifier("target", "_blank"));
	String url = ActivityUtils.getGravatarThumbnailUrl(email, width);
	ExternalImage image = new ExternalImage("image", url);
	WicketUtils.setCssClass(image, "gravatar");
	link.add(image);
	if (linked) {
		WicketUtils.setHtmlTooltip(link,
			MessageFormat.format("View Gravatar profile for {0}", person.getName()));
	} else {
		WicketUtils.setHtmlTooltip(link, person.getName());
	}
	add(link.setEnabled(linked));
	setVisible(GitBlit.getBoolean(Keys.web.allowGravatar, true));
}
 
開發者ID:BullShark,項目名稱:IRCBlit,代碼行數:22,代碼來源:GravatarImage.java

示例2: GravatarImage

import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
public GravatarImage(String id, String username, String emailaddress, String cssClass, int width, boolean linked, boolean identicon) {
	super(id);

	String email = emailaddress == null ? username.toLowerCase() : emailaddress.toLowerCase();
	String hash = StringUtils.getMD5(email);
	Link<Void> link = new BookmarkablePageLink<Void>("link", GravatarProfilePage.class,
			WicketUtils.newObjectParameter(hash));
	link.add(new SimpleAttributeModifier("target", "_blank"));
	String url;
	if (identicon) {
		url = ActivityUtils.getGravatarIdenticonUrl(email, width);
	} else {
		url = ActivityUtils.getGravatarThumbnailUrl(email, width);
	}
	ExternalImage image = new ExternalImage("image", url);
	if (cssClass != null) {
		WicketUtils.setCssClass(image, cssClass);
	}
	link.add(image);
	if (linked) {
		WicketUtils.setHtmlTooltip(link,
			MessageFormat.format("View Gravatar profile for {0}", username));
	} else {
		WicketUtils.setHtmlTooltip(link, username);
	}
	add(link.setEnabled(linked));
	setVisible(GitBlit.getBoolean(Keys.web.allowGravatar, true));
}
 
開發者ID:warpfork,項目名稱:gitblit,代碼行數:29,代碼來源:GravatarImage.java

示例3: registerNavLinks

import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
private List<NavLink> registerNavLinks() {
	Repository r = getRepository();
	RepositoryModel model = getRepositoryModel();

	PageParameters params = null;
	PageParameters objectParams = null;
	if (!StringUtils.isEmpty(repositoryName)) {
		params = WicketUtils.newRepositoryParameter(getRepositoryName());
		objectParams = params;

		// preserve the objectid iff the objectid directly (or indirectly) refers to a ref
		if (isCommitPage() && !StringUtils.isEmpty(objectId)) {
			RevCommit commit = JGitUtils.getCommit(r, objectId);
			if (commit != null) {
				String bestId = getBestCommitId(commit);
				if (!commit.getName().equals(bestId)) {
					objectParams = WicketUtils.newObjectParameter(getRepositoryName(), bestId);
				}
			}
		}
	}
	List<NavLink> navLinks = new ArrayList<NavLink>();


	// standard links
	if (RefLogUtils.getRefLogBranch(r) == null) {
		navLinks.add(new PageNavLink("gb.summary", SummaryPage.class, params));
	} else {
		navLinks.add(new PageNavLink("gb.summary", SummaryPage.class, params));
		//			pages.put("overview", new PageRegistration("gb.overview", OverviewPage.class, params));
		navLinks.add(new PageNavLink("gb.reflog", ReflogPage.class, params));
	}

	if (!model.hasCommits) {
		return navLinks;
	}

	navLinks.add(new PageNavLink("gb.commits", LogPage.class, objectParams));
	navLinks.add(new PageNavLink("gb.tree", TreePage.class, objectParams));
	if (app().tickets().isReady() && (app().tickets().isAcceptingNewTickets(model) || app().tickets().hasTickets(model))) {
		PageParameters tParams = WicketUtils.newOpenTicketsParameter(getRepositoryName());
		navLinks.add(new PageNavLink("gb.tickets", TicketsPage.class, tParams));
	}
	navLinks.add(new PageNavLink("gb.docs", DocsPage.class, objectParams, true));
	if (app().settings().getBoolean(Keys.web.allowForking, true)) {
		navLinks.add(new PageNavLink("gb.forks", ForksPage.class, params, true));
	}
	navLinks.add(new PageNavLink("gb.compare", ComparePage.class, params, true));

	// conditional links
	// per-repository extra navlinks
	if (JGitUtils.getPagesBranch(r) != null) {
		ExternalNavLink pagesLink = new ExternalNavLink("gb.pages", PagesServlet.asLink(
				getRequest().getRelativePathPrefixToContextRoot(), getRepositoryName(), null), true);
		navLinks.add(pagesLink);
	}

	UserModel user = UserModel.ANONYMOUS;
	if (GitBlitWebSession.get().isLoggedIn()) {
		user = GitBlitWebSession.get().getUser();
	}

	// add repository nav link extensions
	List<RepositoryNavLinkExtension> extensions = app().plugins().getExtensions(RepositoryNavLinkExtension.class);
	for (RepositoryNavLinkExtension ext : extensions) {
		navLinks.addAll(ext.getNavLinks(user, model));
	}

	return navLinks;
}
 
開發者ID:tomaswolf,項目名稱:gerrit-gitblit-plugin,代碼行數:71,代碼來源:RepositoryPage.java

示例4: newCommitParameter

import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
protected PageParameters newCommitParameter() {
	return WicketUtils.newObjectParameter(repositoryName, objectId);
}
 
開發者ID:tomaswolf,項目名稱:gerrit-gitblit-plugin,代碼行數:4,代碼來源:RepositoryPage.java


注:本文中的com.gitblit.wicket.WicketUtils.newObjectParameter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。