/** 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");

  }
Esempio n. 2
0
    private void doInitHandlerInfo(final LoggerInfo info) {

      // ScrollPanel scroll=new ScrollPanel(handlersBriefInfo);
      // display.add(scroll, DockPanel.CENTER);
      handlersBriefInfo = new ListPanel();
      display.add(handlersBriefInfo, DockPanel.CENTER);
      display.setCellWidth(handlersBriefInfo, "100%");
      // handlersBriefInfo.setHeight("200px");
      // handlersBriefInfo.setWidth("630px");

      handlersBriefInfo.setColumnWidth(0, "25px");
      handlersBriefInfo.setColumnWidth(1, "25px");

      handlersBriefInfo.setColumnWidth(2, "100px");
      handlersBriefInfo.setColumnWidth(3, "80%");

      handlersBriefInfo.setHeader(0, "Index");
      handlersBriefInfo.setHeader(1, "Remove");
      handlersBriefInfo.setHeader(2, "Name");
      handlersBriefInfo.setHeader(3, "Class name");

      if (info.getHandlerInfos() != null)
        for (int i = 0; i < info.getHandlerInfos().length; i++) {

          final int ii = i;
          // FIXME: Add details
          Hyperlink details = new Hyperlink();
          details.setHTML("#" + i);

          Hyperlink remove = new Hyperlink();
          remove.setHTML("Remove");
          ClickListener removeClick =
              new ClickListener() {

                public void onClick(Widget sender) {

                  AsyncCallback removeCallback =
                      new AsyncCallback() {

                        public void onFailure(Throwable caught) {
                          Logger.error(
                              "Failed to remove handler from logger["
                                  + fullName
                                  + "] at index["
                                  + ii
                                  + "] due to:\n"
                                  + caught);
                        }

                        public void onSuccess(Object result) {
                          onHide();
                          onShow();
                        }
                      };

                  ServerConnection.logServiceAsync.removeHandlerAtIndex(
                      info.getFullName(), ii, removeCallback);
                }
              };

          remove.addClickListener(removeClick);

          handlersBriefInfo.setCell(i, 0, details);
          handlersBriefInfo.setCell(i, 1, remove);
          handlersBriefInfo.setCellText(i, 2, info.getHandlerInfos()[i].getName());
          handlersBriefInfo.setCellText(i, 3, info.getHandlerInfos()[i].getHandelerClassName());
        }
    }
  private void buildParamList() {
    paramsList = new ListPanel();
    // Now part with constructor params
    Hyperlink addParam = new Hyperlink("Add", null);
    Hyperlink removeParam = new Hyperlink("Remove", null);

    addParam.addClickListener(
        new ClickListener() {

          public void onClick(Widget arg0) {
            TextBox paramType = new TextBox();
            TextBox value = new TextBox();
            // paramsList.setCell(paramTypes.size(), 1, paramType);
            paramTypes.add(paramType);
            // paramsList.setCell(paramBoxes.size(), 2, value);
            paramBoxes.add(value);
            buildParamList();
          }
        });

    removeParam.addClickListener(
        new ClickListener() {

          public void onClick(Widget arg0) {
            if (paramTypes.size() > 0) {

              paramBoxes.remove(paramBoxes.size() - 1);
              paramTypes.remove(paramTypes.size() - 1);
              buildParamList();
            }
          }
        });

    // Small trick
    FlexTable ft = new FlexTable();
    ft.setWidget(0, 0, addParam);
    ft.setText(0, 1, "/");
    ft.setWidget(0, 2, removeParam);

    paramsList.setHeader(0, ft);
    paramsList.setHeader(1, "Type");
    paramsList.setHeader(2, "Value");
    paramsList.setColumnWidth(0, "8%");
    paramsList.setColumnWidth(1, "46%");
    paramsList.setColumnWidth(2, "46%");
    paramsList.setWidth("100%");
    paramsList.setHeight("100%");
    // Rebuild boxes
    for (int i = 0; i < paramTypes.size(); i++) {
      paramsList.setCell(i, 1, (Widget) paramTypes.get(i));
      paramsList.setCell(i, 2, (Widget) paramBoxes.get(i));
      paramsList.setCellText(i, 0, "#" + (i + 1));
    }

    ListPanel pp = new ListPanel();
    pp.setHeader(0, "Filter Class Consturctor Parameters");
    pp.setCell(0, 0, paramsList);
    pp.setWidth("100%");
    pp.setHeight("100%");
    this.setCell(1, 0, pp);
  }