Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.KeyboardListenerAdapter


public class IntegerDataControl extends TextBoxDataControl {
 
  public IntegerDataControl(){
    super();
      // Let's disallow non-numeric entry in the normal text box.
      this.textBox.addKeyboardListener(new KeyboardListenerAdapter() {
        public void onKeyPress(Widget sender, char keyCode, int modifiers) {
          if (!Character.isDigit(keyCode) &&
              keyCode != KEY_BACKSPACE &&
              keyCode != KEY_DELETE &&
              keyCode != KEY_LEFT &&
View Full Code Here


public class FloatDataControl extends TextBoxDataControl {
 
  public FloatDataControl(){
    super();
      // Let's disallow non-numeric entry in the normal text box.
      this.textBox.addKeyboardListener(new KeyboardListenerAdapter() {
        public void onKeyPress(Widget sender, char keyCode, int modifiers) {
          if (!Character.isDigit(keyCode) &&
            keyCode != KEY_BACKSPACE &&
            keyCode != KEY_DELETE &&
            keyCode != KEY_LEFT &&
View Full Code Here

   */
  private void setupCellEditors(PagingScrollTable<Serializable> table) {
    // Integer only cell editor for age
    TextBox intOnlyTextBox = new TextBox();
    intOnlyTextBox.setWidth("4em");
    intOnlyTextBox.addKeyboardListener(new KeyboardListenerAdapter() {
      @Override
      public void onKeyPress(Widget sender, char keyCode, int modifiers) {
        if ((!Character.isDigit(keyCode)) && (keyCode != (char) KEY_TAB)
            && (keyCode != (char) KEY_BACKSPACE)
            && (keyCode != (char) KEY_DELETE) && (keyCode != (char) KEY_ENTER)
View Full Code Here

        amountBox.setText(widget.reformatContent());
        previewPanel.hide();
      }
    });

    amountBox.addKeyboardListener(new KeyboardListenerAdapter() {
      public void onKeyDown(Widget sender, char keyCode, int modifiers) {
        if (keyCode == (char) KEY_ENTER) {
          previewPanel.hide();
          amountBox.setText(widget.reformatContent());
        } else if (keyCode != (char) KEY_TAB) {
View Full Code Here

      public void onLostFocus(Widget sender) {
        amountBox.setText(reformatContent());
      }
    });

    amountBox.addKeyboardListener(new KeyboardListenerAdapter() {
      public void onKeyDown(Widget sender, char keyCode, int modifiers) {
        if (keyCode == (char) KEY_ENTER) {
          amountBox.setText(reformatContent());
        }
      }
View Full Code Here

                complete(event.getSelectedSuggestion()
                        .getReplacementString());
            }
        });

        suggestBox.addKeyboardListener(new KeyboardListenerAdapter() {
            // @Override
            public void onKeyPress(Widget sender, char keyCode,
                    int modifiers) {
                if (keyCode == KEY_ENTER) {
View Full Code Here

    curPageBox.setWidth("3em");
    curPageBox.setText("1");
    curPageBox.setTextAlignment(TextBoxBase.ALIGN_RIGHT);

    // Disallow non-numeric pages
    KeyboardListenerAdapter listener = new KeyboardListenerAdapter() {
      @Override
      public void onKeyPress(Widget sender, char keyCode, int modifiers) {
        if (keyCode == (char) KEY_ENTER) {
          PagingOptions.this.table.gotoPage(getPagingBoxValue(), false);
        } else if ((!Character.isDigit(keyCode)) && (keyCode != (char) KEY_TAB)
View Full Code Here

  }
 
 
  private TextBox createTextBox(final Map<String,RegisteredOntologyInfo> suggestions, final ListBox listBox, final MyDialog popup) {
    final TextBox textBox = new TextBox();
    KeyboardListener kb = new KeyboardListenerAdapter() {
      String[] lastEntered = {""};
      public void onKeyUp(Widget sender, char keyCode, int modifiers) {
        String enteredText = textBox.getText().trim();
        if ( keyCode == KeyboardListener.KEY_ENTER ) {
          Orr.log("ENTER: '" + enteredText + "'");
View Full Code Here

   
    if ( includeIsMapCheck ) {
      resourceTypeIsMap = new CheckBox("Check here if this is a mapping ontology");

      // update this checkbox according to contents in the text field:
      resourceTypeFieldWithChoose.getTextBox().addKeyboardListener(new KeyboardListenerAdapter() {
        public void onKeyUp(Widget sender, char keyCode, int modifiers) {
          String value = resourceTypeFieldWithChoose.getTextBox().getText().toLowerCase();
          boolean isMap = value.matches(".*_[mM][aA][pP]($|_.*)");
          resourceTypeIsMap.setChecked(isMap);
        }
 
View Full Code Here

          }
        }
      });
     
     
      focusPanel.addKeyboardListener(new KeyboardListenerAdapter() {
        public void onKeyPress(Widget sender, char keyCode, int modifiers) {
         
          if ( ! editMode ) {
            return;
          }
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.KeyboardListenerAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.