本文整理匯總了Java中com.gitblit.wicket.WicketUtils.setHtmlTooltip方法的典型用法代碼示例。如果您正苦於以下問題:Java WicketUtils.setHtmlTooltip方法的具體用法?Java WicketUtils.setHtmlTooltip怎麽用?Java WicketUtils.setHtmlTooltip使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.gitblit.wicket.WicketUtils
的用法示例。
在下文中一共展示了WicketUtils.setHtmlTooltip方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setChangeTypeTooltip
import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
protected void setChangeTypeTooltip(Component container, ChangeType type) {
switch (type) {
case ADD:
WicketUtils.setHtmlTooltip(container, getString("gb.addition"));
break;
case COPY:
case RENAME:
WicketUtils.setHtmlTooltip(container, getString("gb.rename"));
break;
case DELETE:
WicketUtils.setHtmlTooltip(container, getString("gb.deletion"));
break;
case MODIFY:
WicketUtils.setHtmlTooltip(container, getString("gb.modification"));
break;
}
}
示例2: setupPage
import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
protected void setupPage(String repositoryName, String pageName) {
String siteName = GitBlit.getString(Keys.web.siteName, Constants.NAME);
if (StringUtils.isEmpty(siteName)) {
siteName = Constants.NAME;
}
if (repositoryName != null && repositoryName.trim().length() > 0) {
add(new Label("title", repositoryName + " - " + siteName));
} else {
add(new Label("title", siteName));
}
ExternalLink rootLink = new ExternalLink("rootLink", urlFor(GitBlitWebApp.HOME_PAGE_CLASS, null).toString());
WicketUtils.setHtmlTooltip(rootLink, GitBlit.getString(Keys.web.siteName, Constants.NAME));
add(rootLink);
// Feedback panel for info, warning, and non-fatal error messages
add(new FeedbackPanel("feedback"));
add(new Label("gbVersion", "v" + Constants.getVersion()));
if (GitBlit.getBoolean(Keys.web.aggressiveHeapManagement, false)) {
System.gc();
}
}
示例3: 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));
}
示例4: setPersonSearchTooltip
import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
protected void setPersonSearchTooltip(Component component, String value,
Constants.SearchType searchType) {
if (searchType.equals(Constants.SearchType.AUTHOR)) {
WicketUtils.setHtmlTooltip(component, getString("gb.searchForAuthor") + " " + value);
} else if (searchType.equals(Constants.SearchType.COMMITTER)) {
WicketUtils.setHtmlTooltip(component, getString("gb.searchForCommitter") + " " + value);
}
}
示例5: createPermissionBadge
import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
protected Label createPermissionBadge(String wicketId, RepositoryUrl repoUrl) {
Label permissionLabel = new Label(wicketId, repoUrl.isExternal() ? externalPermission : repoUrl.permission.toString());
WicketUtils.setPermissionClass(permissionLabel, repoUrl.permission);
String tooltip = getProtocolPermissionDescription(repository, repoUrl);
WicketUtils.setHtmlTooltip(permissionLabel, tooltip);
return permissionLabel;
}
示例6: setPersonSearchTooltip
import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
protected void setPersonSearchTooltip(Component component, String value, Constants.SearchType searchType) {
if (searchType.equals(Constants.SearchType.AUTHOR)) {
WicketUtils.setHtmlTooltip(component, getString("gb.searchForAuthor") + " " + value);
} else if (searchType.equals(Constants.SearchType.COMMITTER)) {
WicketUtils.setHtmlTooltip(component, getString("gb.searchForCommitter") + " " + value);
}
}
示例7: 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));
}
示例8: setupPage
import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
protected void setupPage(String repositoryName, String pageName) {
if (repositoryName != null && repositoryName.trim().length() > 0) {
add(new Label("title", getServerName() + " - " + repositoryName));
} else {
add(new Label("title", getServerName()));
}
ExternalLink rootLink = new ExternalLink("rootLink", urlFor(RepositoriesPage.class, null).toString());
WicketUtils.setHtmlTooltip(rootLink, GitBlit.getString(Keys.web.siteName, Constants.NAME));
add(rootLink);
// Feedback panel for info, warning, and non-fatal error messages
add(new FeedbackPanel("feedback"));
// footer
if (GitBlit.getBoolean(Keys.web.authenticateViewPages, true)
|| GitBlit.getBoolean(Keys.web.authenticateAdminPages, true)) {
UserFragment userFragment = new UserFragment("userPanel", "userFragment", BasePage.this);
add(userFragment);
} else {
add(new Label("userPanel", ""));
}
add(new Label("gbVersion", "v" + Constants.getVersion()));
if (GitBlit.getBoolean(Keys.web.aggressiveHeapManagement, false)) {
System.gc();
}
}
示例9: setTranslatedAttributes
import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
void setTranslatedAttributes() {
WicketUtils.setHtmlTooltip(get("searchType"), getString("gb.searchTypeTooltip"));
WicketUtils.setHtmlTooltip(get("searchBox"),
MessageFormat.format(getString("gb.searchTooltip"), repositoryName));
WicketUtils.setInputPlaceholder(get("searchBox"), getString("gb.search"));
}
示例10: UsersPanel
import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
public UsersPanel(String wicketId, final boolean showAdmin) {
super(wicketId);
Fragment adminLinks = new Fragment("adminPanel", "adminLinks", this);
adminLinks.add(new BookmarkablePageLink<Void>("newUser", EditUserPage.class)
.setVisible(GitBlit.self().supportsAddUser()));
add(adminLinks.setVisible(showAdmin));
final List<UserModel> users = GitBlit.self().getAllUsers();
DataView<UserModel> usersView = new DataView<UserModel>("userRow",
new ListDataProvider<UserModel>(users)) {
private static final long serialVersionUID = 1L;
private int counter;
@Override
protected void onBeforeRender() {
super.onBeforeRender();
counter = 0;
}
public void populateItem(final Item<UserModel> item) {
final UserModel entry = item.getModelObject();
LinkPanel editLink = new LinkPanel("username", "list", entry.username,
EditUserPage.class, WicketUtils.newUsernameParameter(entry.username));
WicketUtils.setHtmlTooltip(editLink, getString("gb.edit") + " " + entry.getDisplayName());
item.add(editLink);
if (StringUtils.isEmpty(entry.displayName)) {
item.add(new Label("displayName").setVisible(false));
} else {
editLink = new LinkPanel("displayName", "list", entry.getDisplayName(),
EditUserPage.class, WicketUtils.newUsernameParameter(entry.username));
WicketUtils.setHtmlTooltip(editLink, getString("gb.edit") + " " + entry.getDisplayName());
item.add(editLink);
}
if (StringUtils.isEmpty(entry.emailAddress)) {
item.add(new Label("emailAddress").setVisible(false));
} else {
editLink = new LinkPanel("emailAddress", "list", entry.emailAddress,
EditUserPage.class, WicketUtils.newUsernameParameter(entry.username));
WicketUtils.setHtmlTooltip(editLink, getString("gb.edit") + " " + entry.getDisplayName());
item.add(editLink);
}
item.add(new Label("accountType", entry.accountType.name() + (entry.canAdmin() ? ", admin":"")));
item.add(new Label("teams", entry.teams.size() > 0 ? ("" + entry.teams.size()) : ""));
item.add(new Label("repositories",
entry.permissions.size() > 0 ? ("" + entry.permissions.size()) : ""));
Fragment userLinks = new Fragment("userLinks", "userAdminLinks", this);
userLinks.add(new BookmarkablePageLink<Void>("editUser", EditUserPage.class,
WicketUtils.newUsernameParameter(entry.username)));
Link<Void> deleteLink = new Link<Void>("deleteUser") {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
if (GitBlit.self().deleteUser(entry.username)) {
users.remove(entry);
info(MessageFormat.format(getString("gb.userDeleted"), entry.username));
} else {
error(MessageFormat.format(getString("gb.deleteUserFailed"),
entry.username));
}
}
};
deleteLink.add(new JavascriptEventConfirmation("onclick", MessageFormat.format(
getString("gb.deleteUser"), entry.username)));
userLinks.add(deleteLink);
item.add(userLinks);
WicketUtils.setAlternatingBackground(item, counter);
counter++;
}
};
add(usersView.setVisible(showAdmin));
}
示例11: TeamsPanel
import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
public TeamsPanel(String wicketId, final boolean showAdmin) {
super(wicketId);
Fragment adminLinks = new Fragment("adminPanel", "adminLinks", this);
adminLinks.add(new BookmarkablePageLink<Void>("newTeam", EditTeamPage.class));
add(adminLinks.setVisible(showAdmin && GitBlit.self().supportsTeamMembershipChanges(null)));
final List<TeamModel> teams = GitBlit.self().getAllTeams();
DataView<TeamModel> teamsView = new DataView<TeamModel>("teamRow",
new ListDataProvider<TeamModel>(teams)) {
private static final long serialVersionUID = 1L;
private int counter;
@Override
protected void onBeforeRender() {
super.onBeforeRender();
counter = 0;
}
public void populateItem(final Item<TeamModel> item) {
final TeamModel entry = item.getModelObject();
LinkPanel editLink = new LinkPanel("teamname", "list", entry.name,
EditTeamPage.class, WicketUtils.newTeamnameParameter(entry.name));
WicketUtils.setHtmlTooltip(editLink, getString("gb.edit") + " " + entry.name);
item.add(editLink);
item.add(new Label("members", entry.users.size() > 0 ? ("" + entry.users.size())
: ""));
item.add(new Label("repositories",
entry.repositories.size() > 0 ? ("" + entry.repositories.size()) : ""));
Fragment teamLinks = new Fragment("teamLinks", "teamAdminLinks", this);
teamLinks.add(new BookmarkablePageLink<Void>("editTeam", EditTeamPage.class,
WicketUtils.newTeamnameParameter(entry.name)));
Link<Void> deleteLink = new Link<Void>("deleteTeam") {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
if (GitBlit.self().deleteTeam(entry.name)) {
teams.remove(entry);
info(MessageFormat.format("Team ''{0}'' deleted.", entry.name));
} else {
error(MessageFormat
.format("Failed to delete team ''{0}''!", entry.name));
}
}
};
deleteLink.add(new JavascriptEventConfirmation("onclick", MessageFormat.format(
"Delete team \"{0}\"?", entry.name)));
teamLinks.add(deleteLink);
item.add(teamLinks);
WicketUtils.setAlternatingBackground(item, counter);
counter++;
}
};
add(teamsView.setVisible(showAdmin));
}