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


Java PasswordTextBox類代碼示例

本文整理匯總了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);
		}
	}
}
 
開發者ID:openremote,項目名稱:WebConsole,代碼行數:24,代碼來源:FormField.java

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

示例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;
}
 
開發者ID:billy1380,項目名稱:blogwt,代碼行數:31,代碼來源:UiHelper.java

示例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);
}
 
開發者ID:DavidWhitlock,項目名稱:PortlandStateJava,代碼行數:19,代碼來源:TextBoxExample.java

示例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);
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:15,代碼來源:MockPasswordTextBox.java

示例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.");
  }
}
 
開發者ID:opendatakit,項目名稱:aggregate,代碼行數:37,代碼來源:ExecuteChangePasswordButton.java

示例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;
}
 
開發者ID:sanderberents,項目名稱:gwtlib,代碼行數:12,代碼來源:MessageBox.java

示例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);
}
 
開發者ID:nmldiegues,項目名稱:easy-vote,代碼行數:41,代碼來源:LoginWidget.java

示例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();		
	
}
 
開發者ID:ganeshjawahar,項目名稱:ire-seimp,代碼行數:32,代碼來源:SEIMPAnnotator.java

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

示例11: getOldPwd

import com.google.gwt.user.client.ui.PasswordTextBox; //導入依賴的package包/類
public PasswordTextBox getOldPwd(){
	return oldPwd;
}
 
開發者ID:ICT-BDA,項目名稱:EasyML,代碼行數:4,代碼來源:AccountView.java

示例12: getNewPwd

import com.google.gwt.user.client.ui.PasswordTextBox; //導入依賴的package包/類
public PasswordTextBox getNewPwd(){
	return newPwd;
}
 
開發者ID:ICT-BDA,項目名稱:EasyML,代碼行數:4,代碼來源:AccountView.java

示例13: getVerPwd

import com.google.gwt.user.client.ui.PasswordTextBox; //導入依賴的package包/類
public PasswordTextBox getVerPwd(){
	return verPwd;
}
 
開發者ID:ICT-BDA,項目名稱:EasyML,代碼行數:4,代碼來源:AccountView.java

示例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));
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:7,代碼來源:MockPasswordTextBox.java

示例15: getPassword1

import com.google.gwt.user.client.ui.PasswordTextBox; //導入依賴的package包/類
public PasswordTextBox getPassword1() {
    return password1;
}
 
開發者ID:opendatakit,項目名稱:aggregate,代碼行數:4,代碼來源:ChangePasswordPopup.java


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