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

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


    afterText = new LabelToolItem();
    afterText.setStyleName("my-paging-text");
    pageText = new TextBox();
    if (GXT.isAriaEnabled()) pageText.setTitle("Page");
    pageText.addKeyDownHandler(new KeyDownHandler() {
      public void onKeyDown(KeyDownEvent event) {
        if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
          onPageChange();
        }
      }
View Full Code Here


        addStyleName("stack-section");

        /**
         * actions that reveal content
         */
        addKeyDownHandler(new KeyDownHandler() {
            @Override
            public void onKeyDown(KeyDownEvent keyDownEvent) {
                if(keyDownEvent.getNativeKeyCode()== KeyCodes.KEY_ENTER)
                {
                    revealContent(false);
View Full Code Here

    }

    private FocusPanel createKeyListeningFocusPanel(VerticalPanel verticalPanel) {
        FocusPanel focusPanel = new FocusPanel(verticalPanel);

        focusPanel.addKeyDownHandler(new KeyDownHandler() {
            public void onKeyDown(KeyDownEvent event) {
                if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) {
                    hide();
                }
            }
View Full Code Here

  {
    this.args = new String[]{path};
    setTitle("Notepad");


    textArea.addKeyDownHandler(new KeyDownHandler()
    {
      public void onKeyDown(KeyDownEvent kd)
      {
        // Ctrl-s
        if(kd.getNativeEvent().getCtrlKey() && kd.getNativeEvent().getKeyCode() == 83)
View Full Code Here

    dtkHour.setText("0");
    dtkMin.setText("0");
    dtkSec.setText("0");

    // handler per impedire che l'utente inserisca Minuti e Secondi con formato errato
    KeyDownHandler   time   = new KeyDownHandler() {
      @Override
      public void onKeyDown(KeyDownEvent event) {
        // inputbox interessata
        TextBox input = (TextBox)(event.getSource());
        char carattere = (char)event.getNativeKeyCode();
         
        // il carattere inserito � un numero?
        if (Character.isDigit(carattere)){
        // effettuo il controllo sul contenuto solo se necessario
        if (!input.getText().isEmpty()){
            
          int limit;
          // l'ora pu� assumere valori 0-23, minuti/secondi 0-59
          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())));}}
        }
           
        }else{
        // 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();}
        }

      }
    };
   
   
    KeyDownHandler   fDown   = new KeyDownHandler() {
      @Override
      public void onKeyDown(KeyDownEvent event) {
        // inputbox interessata
        TextBox input = (TextBox)(event.getSource());
        char carattere = (char)event.getNativeKeyCode();
View Full Code Here

                    public void onClick(ClickEvent event) {
                        doLogin();
                    }
                }));

        final KeyDownHandler handler = new KeyDownHandler()
        {
            public void onKeyDown(KeyDownEvent event)
            {
                if (KeyCodes.KEY_ENTER == event.getNativeKeyCode())
                    doLogin();
View Full Code Here

        addStyleName("stack-section");

        /**
         * actions that reveal content
         */
        addKeyDownHandler(new KeyDownHandler() {
            public void onKeyDown(KeyDownEvent keyDownEvent) {
                if(keyDownEvent.getNativeKeyCode()== KeyCodes.KEY_ENTER)
                {
                    revealContent(false);
                }
View Full Code Here

        }
        matrix.setPiece(currRow, currCol, currPiece);
      }
    });
   
    surface.addKeyDownHandler(new KeyDownHandler() {
      @Override
      public void onKeyDown(KeyDownEvent event) {
        if (currPiece == null) {
          return;
        }
View Full Code Here

    }

    private FocusPanel createKeyListeningFocusPanel(VerticalPanel verticalPanel) {
        FocusPanel focusPanel = new FocusPanel( verticalPanel );

        focusPanel.addKeyDownHandler( new KeyDownHandler() {
            public void onKeyDown(KeyDownEvent event) {
                if ( event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE ) {
                    hide();
                }
            }
View Full Code Here

        this.listBox = new ListBox();
        setItems( items );

        // Tabbing out of the ListBox commits changes
        listBox.addKeyDownHandler( new KeyDownHandler() {

            public void onKeyDown( KeyDownEvent event ) {
                boolean keyTab = event.getNativeKeyCode() == KeyCodes.KEY_TAB;
                boolean keyEnter = event.getNativeKeyCode() == KeyCodes.KEY_ENTER;
                if ( keyEnter
View Full Code Here

TOP

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

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.