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


Java WicketUtils.setInputPlaceholder方法代碼示例

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


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

示例1: LoginForm

import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
public LoginForm(String id, String markupId, MarkupContainer markupProvider) {
	super(id, markupId, markupProvider);
	setRenderBodyOnly(true);

	SessionlessForm<Void> loginForm = new SessionlessForm<Void>("loginForm", RootPage.this.getClass(), getPageParameters()) {

		private static final long serialVersionUID = 1L;

		@Override
		public void onSubmit() {
			String username = RootPage.this.username.getObject();
			char[] password = RootPage.this.password.getObject().toCharArray();

			HttpServletRequest request = ((WebRequest) RequestCycle.get().getRequest()).getHttpServletRequest();

			UserModel user = app().authentication().authenticate(username, password, request.getRemoteAddr());
			if (user == null) {
				error(getString("gb.invalidUsernameOrPassword"));
			} else if (user.username.equals(Constants.FEDERATION_USER)) {
				// disallow the federation user from logging in via the
				// web ui
				error(getString("gb.invalidUsernameOrPassword"));
				user = null;
			} else {
				loginUser(user);
			}
		}
	};
	TextField<String> unameField = new TextField<String>("username", username);
	WicketUtils.setInputPlaceholder(unameField, markupProvider.getString("gb.username"));
	loginForm.add(unameField);
	NonTrimmedPasswordTextField pwField = new NonTrimmedPasswordTextField("password", password);
	WicketUtils.setInputPlaceholder(pwField, markupProvider.getString("gb.password"));
	loginForm.add(pwField);
	add(loginForm);
}
 
開發者ID:tomaswolf,項目名稱:gerrit-gitblit-plugin,代碼行數:37,代碼來源:RootPage.java

示例2: LoginForm

import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
public LoginForm(String id, String markupId, MarkupContainer markupProvider) {
	super(id, markupId, markupProvider);
	setRenderBodyOnly(true);

	SessionlessForm<Void> loginForm = new SessionlessForm<Void>("loginForm", RootPage.this.getClass(), getPageParameters()) {

		private static final long serialVersionUID = 1L;

		@Override
		public void onSubmit() {
			String username = RootPage.this.username.getObject();
			char[] password = RootPage.this.password.getObject().toCharArray();

			UserModel user = GitBlit.self().authenticate(username, password);
			if (user == null) {
				error(getString("gb.invalidUsernameOrPassword"));
			} else if (user.username.equals(Constants.FEDERATION_USER)) {
				// disallow the federation user from logging in via the
				// web ui
				error(getString("gb.invalidUsernameOrPassword"));
				user = null;
			} else {
				loginUser(user);
			}
		}
	};
	TextField<String> unameField = new TextField<String>("username", username);
	WicketUtils.setInputPlaceholder(unameField, markupProvider.getString("gb.username"));
	loginForm.add(unameField);
	PasswordTextField pwField = new PasswordTextField("password", password);
	WicketUtils.setInputPlaceholder(pwField, markupProvider.getString("gb.password"));
	loginForm.add(pwField);
	add(loginForm);
}
 
開發者ID:warpfork,項目名稱:gitblit,代碼行數:35,代碼來源:RootPage.java

示例3: 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


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