Package com.google.gwt.event.dom.client

Examples of com.google.gwt.event.dom.client.KeyPressHandler


     * numeric conventions - it will also allow formulas (a formula is when the
     * first value is a "=" which means it is meant to be taken as the user
     * typed)
     */
    public static KeyPressHandler getNumericFilter(final TextBox box) {
        return new KeyPressHandler() {

            public void onKeyPress(KeyPressEvent event) {
                TextBox w = (TextBox) event.getSource();
                char c = event.getCharCode();
                if ( Character.isLetter( c ) && c != '=' && !(box.getText().startsWith( "=" )) ) {
View Full Code Here


            data.setWidget( i,
                            3,
                            del );

            //we only want numbers here...
            num.addKeyPressHandler( new KeyPressHandler() {
                public void onKeyPress(KeyPressEvent event) {
                    if ( Character.isLetter( event.getCharCode() ) ) {
                        ((TextBox) event.getSource()).cancelKey();
                    }
                }
View Full Code Here

            }

        };

        go.addClickHandler( cl );
        searchTextBox.addKeyPressHandler( new KeyPressHandler() {
            public void onKeyPress( KeyPressEvent event ) {
                if ( event.getCharCode() == KeyCodes.KEY_ENTER ) {
                    cl.onClick( null );
                }
            }
View Full Code Here

                          userName );
        final PasswordTextBox password = new PasswordTextBox();
        pop.addAttribute( constants.Password(),
                          password );

        KeyPressHandler kph = new KeyPressHandler() {
            public void onKeyPress(KeyPressEvent event) {
                if ( KeyCodes.KEY_ENTER == event.getNativeEvent().getKeyCode() ) {
                    doLogin( userName,
                             password,
                             pop );
View Full Code Here

            }

        } );

        // Restrict entry to navigation and numerics
        textBox.addKeyPressHandler( new KeyPressHandler() {

            public void onKeyPress(KeyPressEvent event) {

                // Permit navigation
                int keyCode = event.getNativeEvent().getKeyCode();
View Full Code Here

    }

    protected void setup() {
        final TextBox me = this;

        this.addKeyPressHandler( new KeyPressHandler() {

            public void onKeyPress(KeyPressEvent event) {

                // Permit navigation
                int keyCode = event.getNativeEvent().getKeyCode();
View Full Code Here

        addStockFromTextBox(true);
      }
    });

    // Listen for keyboard events in the input box.
    newSymbolTextBox.addKeyPressHandler(new KeyPressHandler() {
      public void onKeyPress(KeyPressEvent event) {
        if (event.getCharCode() == KeyCodes.KEY_ENTER) {
          addStockFromTextBox(true);
        }
      }
View Full Code Here

            data.setWidget( i,
                            3,
                            del );

            //we only want numbers here...
            num.addKeyPressHandler( new KeyPressHandler() {
                public void onKeyPress(KeyPressEvent event) {
                    if ( Character.isLetter( event.getCharCode() ) ) {
                        ((TextBox) event.getSource()).cancelKey();
                    }
                }
View Full Code Here

            public void onKeyUp(KeyUpEvent event) {
                assertTextAreaDimensions();
            }
        } );
        addKeyPressHandler( new KeyPressHandler() {

            public void onKeyPress(KeyPressEvent event) {
                assertTextAreaDimensions();
            }
        } );
View Full Code Here

   public void pressKey() {
      // Arrange
      final List<KeyPressEventData> events = new ArrayList<KeyPressEventData>();
      TextBox tb = new TextBox();

      tb.addKeyPressHandler(new KeyPressHandler() {

         public void onKeyPress(KeyPressEvent event) {
            KeyPressEventData data = new KeyPressEventData();
            data.keyCode = event.getNativeEvent().getKeyCode();
            data.charCode = event.getCharCode();
View Full Code Here

TOP

Related Classes of com.google.gwt.event.dom.client.KeyPressHandler

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.