Exemplo n.º 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.");
  }
Exemplo n.º 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.");
    }
  }
Exemplo n.º 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.");
    }
  }
Exemplo n.º 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.");
    }
  }
Exemplo n.º 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 {

    }
  }
Exemplo n.º 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 {

    }
  }
Exemplo n.º 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();
 }
Exemplo n.º 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);
 }
Exemplo n.º 9
0
 /** Set the tooltips initial state on page load */
 private void setTooltipInitialState() {
   active.setVisible(false);
 }