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


Java WicketUtils.setHtmlTooltip方法代碼示例

本文整理匯總了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;
	}
}
 
開發者ID:tomaswolf,項目名稱:gerrit-gitblit-plugin,代碼行數:18,代碼來源:RepositoryPage.java

示例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();
	}
}
 
開發者ID:warpfork,項目名稱:gitblit,代碼行數:24,代碼來源:BasePage.java

示例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));
}
 
開發者ID:BullShark,項目名稱:IRCBlit,代碼行數:22,代碼來源:GravatarImage.java

示例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);
	}
}
 
開發者ID:tomaswolf,項目名稱:gerrit-gitblit-plugin,代碼行數:9,代碼來源:RepositoryPage.java

示例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;
}
 
開發者ID:warpfork,項目名稱:gitblit,代碼行數:8,代碼來源:RepositoryUrlPanel.java

示例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);
	}
}
 
開發者ID:warpfork,項目名稱:gitblit,代碼行數:8,代碼來源:BasePanel.java

示例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));
}
 
開發者ID:warpfork,項目名稱:gitblit,代碼行數:29,代碼來源:GravatarImage.java

示例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();
	}
}
 
開發者ID:BullShark,項目名稱:IRCBlit,代碼行數:29,代碼來源:BasePage.java

示例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"));
}
 
開發者ID:tomaswolf,項目名稱:gerrit-gitblit-plugin,代碼行數:7,代碼來源:RepositoryPage.java

示例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));
}
 
開發者ID:warpfork,項目名稱:gitblit,代碼行數:79,代碼來源:UsersPanel.java

示例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));
}
 
開發者ID:warpfork,項目名稱:gitblit,代碼行數:59,代碼來源:TeamsPanel.java


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