本文整理匯總了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));
}
示例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));
}
示例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;
}
示例4: newCommitParameter
import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
protected PageParameters newCommitParameter() {
return WicketUtils.newObjectParameter(repositoryName, objectId);
}