本文整理匯總了Java中com.google.gwt.user.client.ui.PasswordTextBox類的典型用法代碼示例。如果您正苦於以下問題:Java PasswordTextBox類的具體用法?Java PasswordTextBox怎麽用?Java PasswordTextBox使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PasswordTextBox類屬於com.google.gwt.user.client.ui包,在下文中一共展示了PasswordTextBox類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: validateInput
import com.google.gwt.user.client.ui.PasswordTextBox; //導入依賴的package包/類
private void validateInput() {
String value = "";
switch (inputType) {
case TEXTBOX:
value = ((TextBox)input).getValue();
break;
case TEXTAREA:
value = ((TextArea)input).getValue();
break;
case PASSWORD:
value = ((PasswordTextBox)input).getValue();
break;
}
if (isOptional && value.length() == 0) {
setInputValid(true);
} else {
if (validationStr != null) {
setInputValid(value.matches(validationStr));
} else {
setInputValid(true);
}
}
}
示例2: ChangePasswordPopup
import com.google.gwt.user.client.ui.PasswordTextBox; //導入依賴的package包/類
public ChangePasswordPopup(UserSecurityInfo user) {
super(false);
this.user = user;
password1 = new PasswordTextBox();
password2 = new PasswordTextBox();
FlexTable layout = new FlexTable();
layout.setWidget(0, 0,
new HTML("Change Password for " + user.getUsername()));
layout.setWidget(1, 0, new HTML("Password:"));
layout.setWidget(1, 1, password1);
layout.setWidget(2, 0, new HTML("Password (again):"));
layout.setWidget(2, 1, password2);
layout.setWidget(3, 0, new ExecuteChangePasswordButton(this));
layout.setWidget(3, 1, new ClosePopupButton(this));
setWidget(layout);
}
示例3: swap
import com.google.gwt.user.client.ui.PasswordTextBox; //導入依賴的package包/類
/**
* Swaps a TextBox with an element of the same type for remember password. The text box needs to be within an panel. The styles of the text box are also
* copied
*
* @param textBox
* @param elementId
* @return
*/
@SuppressWarnings("unchecked")
public static <T extends TextBox> T swap (T textBox, String elementId) {
Panel parent = (Panel) textBox.getParent();
T newTextBox = null;
if (textBox instanceof PasswordTextBox) {
newTextBox = (T) PasswordTextBox
.wrap(DOM.getElementById(elementId));
} else if (textBox instanceof TextBox) {
newTextBox = (T) TextBox.wrap(DOM.getElementById(elementId));
}
newTextBox.getElement().setAttribute("class",
textBox.getElement().getAttribute("class"));
newTextBox.removeFromParent();
parent.getElement().insertBefore(newTextBox.getElement(),
textBox.getElement());
textBox.removeFromParent();
return newTextBox;
}
示例4: TextBoxExample
import com.google.gwt.user.client.ui.PasswordTextBox; //導入依賴的package包/類
public TextBoxExample() {
super("Text Boxes");
TextBox text = new TextBox();
text.setVisibleLength(15);
text.setMaxLength(10);
add(text);
TextBox readOnly = new TextBox();
readOnly.setReadOnly(true);
readOnly.setVisibleLength(15);
readOnly.setText("Read only text");
add(readOnly);
PasswordTextBox password = new PasswordTextBox();
password.setVisibleLength(15);
add(password);
}
示例5: MockPasswordTextBox
import com.google.gwt.user.client.ui.PasswordTextBox; //導入依賴的package包/類
/**
* Creates a new MockPasswordTextBox component.
*
* @param editor editor of source file the component belongs to.
*/
public MockPasswordTextBox(SimpleEditor editor) {
super(editor, TYPE, images.passwordtextbox());
// Initialize mock PasswordTextBox UI.
passwordTextBoxWidget = new PasswordTextBox();
// Change PasswordTextBox text so that it doesn't show up as a blank box in the designer.
passwordTextBoxWidget.setText("**********");
initWrapper(passwordTextBoxWidget);
}
示例6: onClick
import com.google.gwt.user.client.ui.PasswordTextBox; //導入依賴的package包/類
@Override
public void onClick(ClickEvent event) {
super.onClick(event);
PasswordTextBox password1 = popup.getPassword1();
PasswordTextBox password2 = popup.getPassword2();
UserSecurityInfo userInfo = popup.getUser();
RealmSecurityInfo realmInfo = AggregateUI.getUI().getRealmInfo();
String pw1 = password1.getText();
String pw2 = password2.getText();
if (pw1 == null || pw2 == null || pw1.length() == 0) {
Window.alert("Password cannot be blank");
} else if (pw1.equals(pw2)) {
if (realmInfo == null || userInfo == null) {
Window.alert("Unable to obtain required information from server");
} else {
CredentialsInfo credential;
try {
credential = CredentialsInfoBuilder.build(userInfo.getUsername(), realmInfo, pw1);
} catch (NoSuchAlgorithmException e) {
Window.alert("Unable to build credentials hash");
return;
}
baseUrl = realmInfo.getChangeUserPasswordURL();
// Construct a JSOP request
String parameters = credential.getRequestParameters();
String url = baseUrl + "?" + parameters + "&callback=";
getJson(jsonRequestId++, url, this);
}
} else {
Window.alert("The passwords do not match. Please retype the password.");
}
}
示例7: password
import com.google.gwt.user.client.ui.PasswordTextBox; //導入依賴的package包/類
public static MessageBox password(String caption, String message, MessageBoxListener listener) {
final MessageBox mb = new MessageBox();
mb.setText(caption);
mb.setButtons(BTN_OK_CANCEL, listener);
mb._dockPanel.add(new Label(message), DockPanel.NORTH);
mb._textBox = new PasswordTextBox();
mb._dockPanel.add(mb._textBox, DockPanel.CENTER);
mb.center();
mb._textBox.setFocus(true);
return mb;
}
示例8: LoginWidget
import com.google.gwt.user.client.ui.PasswordTextBox; //導入依賴的package包/類
public LoginWidget(AsyncCallback<Void> logincb, AsyncCallback<Void> logoutcb) {
this.resize(1, 2);
this.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_RIGHT);
this.addStyleName("easyvote-LoginWidget");
LoginHandler handler = new LoginHandler();
whoAmIPanel = new HorizontalPanel();
whoAmIPanel.setVisible(false);
userIdLabel = new Label();
userIdLabel.addStyleName("LoginWidget-component");
whoAmIPanel.add(userIdLabel);
logoutButton = new Button("Logout");
logoutButton.addStyleName("LoginWidget-logoutButton");
logoutButton.addClickHandler(new LogoutHandler());
whoAmIPanel.add(logoutButton);
setWidget(0, 1, whoAmIPanel);
inputPanel = new FlowPanel();
loginCallback = logincb;
logoutCallback = logoutcb;
nameField = new TextBox();
nameField.setText("VoterID");
nameField.addStyleName("LoginWidget-component");
nameField.addKeyUpHandler(handler);
inputPanel.add(nameField);
passField = new PasswordTextBox();
passField.setText("Password");
passField.addKeyUpHandler(handler);
passField.addStyleName("LoginWidget-component");
inputPanel.add(passField);
sendButton = new Button("Login");
sendButton.addClickHandler(handler);
inputPanel.add(sendButton);
this.setWidget(0, 0, inputPanel);
}
示例9: onModuleLoad
import com.google.gwt.user.client.ui.PasswordTextBox; //導入依賴的package包/類
public void onModuleLoad() {
final DialogBox loginBox=new DialogBox();
loginBox.setAnimationEnabled(true);
loginBox.setGlassEnabled(true);
loginBox.setTitle("This panel allows you to login to the system.");
final VerticalPanel vp=new VerticalPanel();
final PasswordTextBox ptb=new PasswordTextBox();
final Button lbutton=new Button("Go");
vp.add(ptb);
vp.add(lbutton);
loginBox.add(vp);
lbutton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if(ptb.getText().startsWith("abracadabra")) {
user=ptb.getText().substring("abracadabra".length());
loadModule();
loginBox.hide();
}
else
Window.alert("Sorry better luck next time :)");
}
});
loginBox.center();
}
示例10: PasswordTextBoxByDomId
import com.google.gwt.user.client.ui.PasswordTextBox; //導入依賴的package包/類
public PasswordTextBoxByDomId(FDesc fielddescriptor, WidgetRDesc wrDesc) {
super(fielddescriptor);
String domId = wrDesc.getPropValue(IneFormProperties.domId);
if (domId == null)
return;
Element element = DOM.getElementById(domId);
textBox = element == null ? new PasswordTextBox() : PasswordTextBox.wrap(element);
updateWidth(wrDesc);
initWidget(textBox);
textBox.addStyleName(ResourceHelper.ineformRes().style().textBoxFW());
}
示例11: getOldPwd
import com.google.gwt.user.client.ui.PasswordTextBox; //導入依賴的package包/類
public PasswordTextBox getOldPwd(){
return oldPwd;
}
示例12: getNewPwd
import com.google.gwt.user.client.ui.PasswordTextBox; //導入依賴的package包/類
public PasswordTextBox getNewPwd(){
return newPwd;
}
示例13: getVerPwd
import com.google.gwt.user.client.ui.PasswordTextBox; //導入依賴的package包/類
public PasswordTextBox getVerPwd(){
return verPwd;
}
示例14: ClonedPasswordTextBox
import com.google.gwt.user.client.ui.PasswordTextBox; //導入依賴的package包/類
ClonedPasswordTextBox(PasswordTextBox ptb) {
// Get the Element from the PasswordTextBox.
// Call DOM.clone to make a deep clone of that element.
// Pass that cloned element to the super constructor.
super(DOM.clone(ptb.getElement(), true));
}
示例15: getPassword1
import com.google.gwt.user.client.ui.PasswordTextBox; //導入依賴的package包/類
public PasswordTextBox getPassword1() {
return password1;
}