本文整理匯總了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);
}
示例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);
}
示例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"));
}