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

Examples of com.google.gwt.user.client.ui.TextBox.cancelKey()


          if (input==dtkHour){
          limit = 23; }else{ limit = 59; }
         
          // ci stiamo allargando troppo, elimina il carattere!
          if (Integer.parseInt(input.getText()+carattere) > limit) {
          input.cancelKey(); }
          // se il testo inizia per '0' e contiene altri 2 caratteri allora eliminalo!
          if (input.getText().startsWith("0")){
          if (input.getText().length()==2){
          input.setText(Integer.toString(Integer.parseInt(input.getText())));}}
        }
View Full Code Here


        // Il carattere inserito non � un numero? Eliminalo!
           
        // il controllo per il Backspace non pu� avvenire assieme a
        // quello del formato del carattere
        if(carattere != (char) KeyCodes.KEY_BACKSPACE &&
          carattere != (char) KeyCodes.KEY_TAB){input.cancelKey();}
        }

      }
    };
   
View Full Code Here

        if (Character.isDigit(carattere)){
          // niente da fare qui
        }else if (carattere == (char) 109 || // carattere [ - ] in Opera e Firefox
              carattere == (char) 189){ // carattere [ - ] in MSIE, Safari e Chrome
          if (input == txtLight){
            input.cancelKey();
          }else{toCheck[curFocus] = true;}
        }else if (
              carattere == (char) 190){ // carattere [ . ]
          //toCheck = true;
        }else if (carattere == (char) KeyCodes.KEY_BACKSPACE){
View Full Code Here

        }else if (carattere == (char) KeyCodes.KEY_BACKSPACE){
          toCheck[curFocus] = true;
        }else if (carattere == (char) KeyCodes.KEY_TAB){
          // niente da fare qui, se ne occupa onBlur
        }else{
          input.cancelKey();
        }
      }
    };
   
    KeyUpHandler fUp = new KeyUpHandler(){
View Full Code Here

            if (!input.getText().isEmpty()
            &&(
                !Character.isDigit((char)event.getNativeKeyCode())||
                    (Integer.parseInt(input.getText()+(char)event.getNativeKeyCode())<0||
                    Integer.parseInt(input.getText()+(char)event.getNativeKeyCode())>23))) {
                input.cancelKey();
                }
          }
        }
     
     
View Full Code Here

          if (!input.getText().isEmpty()
          &&(
              !Character.isDigit((char)event.getNativeKeyCode())||
                  (Integer.parseInt(input.getText()+(char)event.getNativeKeyCode())<0||
                  Integer.parseInt(input.getText()+(char)event.getNativeKeyCode())>59))) {
              input.cancelKey();
              }
        }
      }

 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.