@UiHandler("projectDescription")
 void onProjectDescriptionChanged(KeyUpEvent event) {
   if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
     return;
   }
   delegate.projectDescriptionChanged(projectDescription.getValue());
 }
 @UiHandler({"fuf0", "fuf1", "fuf2", "fuf3", "fuf4"})
 void onFormKeyUp(KeyUpEvent event) {
   if ((event.getNativeKeyCode() == KeyCodes.KEY_BACKSPACE)
       || (event.getNativeKeyCode() == KeyCodes.KEY_DELETE)) {
     TextField tf = (TextField) event.getSource();
     for (IPCFileUploadField fuf : fufList) {
       String value = fuf.getValue();
       String currentValue = tf.getCurrentValue();
       if (value.equalsIgnoreCase(currentValue)) {
         fuf.clear();
         fuf.validate(true);
         break;
       }
     }
   }
 }
  @Override
  public final void onKeyUp(KeyUpEvent event) {
    if (event.getNativeKeyCode() != KeyCodes.KEY_TAB) {
      updateValue(event.getSource());

      validate();

      if (getState() != State.Initial) {
        setState(validate() ? State.Valid : State.Invalid);
      }
    }
  }
  /*
   * auto-insert degree symbol when appropriate
   */
  public void onKeyUp(KeyUpEvent e) {

    // return unless digit typed (instead of !Character.isDigit)
    if (e.getNativeKeyCode() < 48
        || (e.getNativeKeyCode() > 57 && e.getNativeKeyCode() < 96)
        || e.getNativeKeyCode() > 105) return;

    AutoCompleteTextFieldW tc = inputPanel.getTextComponent();
    String text = tc.getText();

    // if text already contains degree symbol or variable
    for (int i = 0; i < text.length(); i++) {
      if (!StringUtil.isDigit(text.charAt(i))) return;
    }

    int caretPos = tc.getCaretPosition();

    tc.setText(tc.getText() + Unicode.degree);

    tc.setCaretPosition(caretPos);
  }
 @Override
 public void onKeyUp(KeyUpEvent event) {
   if (event.getNativeKeyCode() == KeyCodes.KEY_DOWN) {
     iCourses.setSelectedRow(iCourses.getSelectedRow() + 1);
     scrollToSelectedRow();
     updateCourseDetails();
   } else if (event.getNativeKeyCode() == KeyCodes.KEY_UP) {
     iCourses.setSelectedRow(
         iCourses.getSelectedRow() == 0
             ? iCourses.getRowsCount() - 1
             : iCourses.getSelectedRow() - 1);
     scrollToSelectedRow();
     updateCourseDetails();
   } else if (event.isControlKeyDown() || event.isAltKeyDown()) {
     for (Map.Entry<Character, Integer> entry : iTabAccessKeys.entrySet())
       if (event.getNativeKeyCode() == Character.toLowerCase(entry.getKey())
           || event.getNativeKeyCode() == Character.toUpperCase(entry.getKey())) {
         iCourseDetailsTabPanel.selectTab(entry.getValue());
         event.preventDefault();
         event.stopPropagation();
       }
   }
 }
  @UiHandler("projectName")
  void onProjectNameChanged(KeyUpEvent event) {
    String projectNameValue = projectName.getValue();

    if (projectNameValue != null && projectNameValue.contains(" ")) {
      projectNameValue = projectNameValue.replace(" ", "-");
      projectName.setValue(projectNameValue);
    }

    if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
      return;
    }

    delegate.projectNameChanged(projectName.getValue());
  }
 @Override
 public void onKeyUp(KeyUpEvent event) {
   if (isValidate) {
     if (txtConfirmAction.getText().trim().equalsIgnoreCase(deleteCode)
         && isUserCheckedAllOptions()) {
       btnPositive.getElement().removeClassName("disabled");
       btnPositive.setEnabled(true);
       if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
         if (lblRemoving.getText() != null && !lblRemoving.getText().equalsIgnoreCase("")) {
           setButtonVisibility(false);
           showIsRemoving();
         }
         onClickPositiveButton(null);
       }
     } else {
       setPositiveBtnStatus(false);
     }
   }
 }
Beispiel #8
0
 /**
  * Aliases typing Enter in the name box to the same as pressing the "Go" button.
  *
  * @param event The key event. The value {@code event.getNativeKeyCode()} is compared against
  *     {@code KeyCodes.KEY_ENTER}.
  */
 @UiHandler("nameBox")
 void onNameBoxKeypress(KeyUpEvent event) {
   if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
     onGoButtonClick(null);
   }
 }
 /** Fired when the user types in the nameField. */
 public void onKeyUp(KeyUpEvent event) {
   if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
     sendNameToServer();
   }
 }
Beispiel #10
0
 /** When the user input ENTER key, the query starts */
 @UiHandler("queryTextBox")
 void onKeyEnterRunQuery(KeyUpEvent event) {
   if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
     runQuery();
   }
 }
Beispiel #11
0
 @Override
 public void onKeyUp(KeyUpEvent event) {
   if (isClosable() && event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) {
     onCloseClick();
   }
 }