private void configureOnChangeHandler() {

      final WeeklyRecurrenceEditor localThis = this;

      KeyboardListener keyboardListener =
          new KeyboardListener() {
            public void onKeyDown(Widget sender, char keyCode, int modifiers) {}

            public void onKeyPress(Widget sender, char keyCode, int modifiers) {}

            public void onKeyUp(Widget sender, char keyCode, int modifiers) {
              localThis.changeHandler();
            }
          };

      ClickListener clickListener =
          new ClickListener() {
            public void onClick(Widget sender) {
              localThis.changeHandler();
            }
          };
      for (DayOfWeek d : dayToCheckBox.keySet()) {
        CheckBox cb = dayToCheckBox.get(d);
        cb.addClickListener(clickListener);
        cb.addKeyboardListener(keyboardListener);
      }
    }
Пример #2
0
  /** constructor */
  public LoginUiHorizontal() {

    HorizontalPanel hp = new HorizontalPanel();
    hp.add(wLoading);
    hp.add(pUi);

    pWidget.add(hp);

    initWidget(pWidget);

    // observers
    bLogin.addClickListener(this);
    bForgot.addClickListener(this);

    tbConsumerKey.addClickListener(this);
    tbConsumerKey.addChangeListener(this);
    tbConsumerKey.addKeyboardListener(this);
    tbConsumerKey.addFocusListener(this);

    tbConsumerSecret.addClickListener(this);
    tbConsumerSecret.addChangeListener(this);
    tbConsumerSecret.addKeyboardListener(this);
    tbConsumerSecret.addFocusListener(this);

    tbConsumerSecretPass.addClickListener(this);
    tbConsumerSecretPass.addChangeListener(this);
    tbConsumerSecretPass.addKeyboardListener(this);
    tbConsumerSecretPass.addFocusListener(this);

    cbRemberMe.addKeyboardListener(this);
    cbRemberMe.addClickListener(this);

    hAccountLogin.addClickListener(this);
    hForgotPassword.addClickListener(this);

    // style
    pWidget.setStyleName("login-Ui");

    // defaults
    pError.setVisible(false);

    hp.setCellVerticalAlignment(wLoading, VerticalPanel.ALIGN_MIDDLE);

    // debug
    // pWidget.addStyleName("test2");

  }