示例#1
0
  @UiHandler("usernameTextBox")
  void usernameTextBoxOnFocus(FocusEvent event) {
    active.setVisible(true);

    int x = getTooltipPosition(usernameTextBox)[0];
    int y = getTooltipPosition(usernameTextBox)[1];

    active.setGray();
    setTooltipPosition(x, y);
    setTooltipText("Optional Field. Enter username if you wish to create a superuser.");
  }
示例#2
0
  @UiHandler("emailTextBox")
  void emailTextBoxOnFocus(FocusEvent event) {
    if (!emailTextBox.getStyleName().equals(deployer.redBorder())) {
      active.setVisible(true);

      int x = getTooltipPosition(emailTextBox)[0];
      int y = getTooltipPosition(emailTextBox)[1];

      active.setGray();
      setTooltipPosition(x, y);
      setTooltipText("Enter your email address.");
    }
  }
示例#3
0
  @UiHandler("passwordConfirmTextBox")
  void passwordConfirmTextBoxOnFocus(FocusEvent event) {
    if (!passwordTextBox.getStyleName().equals(deployer.redBorder())) {
      active.setVisible(true);

      int x = getTooltipPosition(passwordConfirmTextBox)[0];
      int y = getTooltipPosition(passwordConfirmTextBox)[1];

      active.setGray();
      setTooltipPosition(x, y);
      setTooltipText("Confirm the previous password.");
    }
  }
示例#4
0
  @UiHandler("passwordTextBox")
  void passwordTextBoxOnFocus(FocusEvent event) {
    if (!passwordTextBox.getStyleName().equals(deployer.redBorder())) {
      active.setVisible(true);

      int x = getTooltipPosition(passwordTextBox)[0];
      int y = getTooltipPosition(passwordTextBox)[1];

      active.setGray();
      setTooltipPosition(x, y);
      setTooltipText("Must be entered if your wish to create a superuser.");
    }
  }
示例#5
0
  @UiHandler("emailTextBox")
  void emailTextBoxOnChange(KeyUpEvent event) {
    if (!usernameTextBox.getText().isEmpty()) {
      if (!isEmailValid()) {
        active.hide();
        emailError.setText("Enter a valid email address");
        emailTextBox.setStyleName(deployer.redBorder());
      } else {
        emailError.setText("");
        emailTextBox.setStyleName(deployer.greyBorder());
      }
    } else {

    }
  }
示例#6
0
  @UiHandler("passwordConfirmTextBox")
  void passwordConfirmTextBoxOnChange(KeyUpEvent event) {
    if (!usernameTextBox.getText().isEmpty()) {
      if (!isPasswordValid()) {
        active.hide();
        passwordError.setText("Passwords do not match");
        passwordTextBox.setStyleName(deployer.redBorder());
        passwordConfirmTextBox.setStyleName(deployer.redBorder());
      } else {
        passwordError.setText("");
        passwordTextBox.setStyleName(deployer.greyBorder());
        passwordConfirmTextBox.setStyleName(deployer.greyBorder());
      }
    } else {

    }
  }
示例#7
0
 /**
  * Set the text of a tooltip
  *
  * @param text the text to set
  */
 private void setTooltipText(String text) {
   active.hide();
   active.setText(text);
   active.show();
 }
示例#8
0
 /**
  * Set the position of a tooltip relative to the browser window
  *
  * @param x the x coordinate
  * @param y the y coordinate
  */
 private void setTooltipPosition(int x, int y) {
   active.setPopupPosition(x, y);
 }
示例#9
0
 /** Set the tooltips initial state on page load */
 private void setTooltipInitialState() {
   active.setVisible(false);
 }