예제 #1
0
  private VLayout createDisplayLabel() {
    String message =
        "Search for value sets.  Select the value sets by checking the checkbox and then click Add to add them.";
    i_label = new Label("<b>" + message + "<b>");
    i_label.setWidth100();
    i_label.setHeight(30);
    i_label.setMargin(2);
    i_label.setValign(VerticalAlignment.CENTER);
    i_label.setBackgroundColor(BACKGROUND_COLOR);

    final VLayout vLayoutLayoutSpacers = new VLayout();
    vLayoutLayoutSpacers.setWidth100();
    vLayoutLayoutSpacers.setHeight(30);
    vLayoutLayoutSpacers.setBackgroundColor(BACKGROUND_COLOR);
    vLayoutLayoutSpacers.setLayoutMargin(6);
    vLayoutLayoutSpacers.setMembersMargin(6);

    vLayoutLayoutSpacers.addMember(i_label);

    return vLayoutLayoutSpacers;
  }
예제 #2
0
  //    private final MapServiceInfoAsync mapServiceInfo = GWT.create(MapServiceInfo.class);
  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  public Authorization(final AsyncCallback<String> callback) {
    super(WINDOW_TITLE, WIDTH, HEIGHT, callback);

    this.setShowMinimizeButton(false);

    VLayout layout = new VLayout();
    layout.layoutChildren(null);

    accountForm = new DynamicForm();
    accountForm.setWidth100();
    accountForm.setPadding(5);
    //        backGround.setBorder("1px solid #ff0");
    TextItem login = new TextItem(CONTROL_LOGIN);
    login.setTitle(CAPTION_LOGIN);
    PasswordItem password = new PasswordItem(CONTROL_PASSWORD);
    password.setTitle(CAPTION_PASSWORD);

    password.addKeyPressHandler(
        new KeyPressHandler() {
          public void onKeyPress(KeyPressEvent keyPressEvent) {
            //                com.google.gwt.user.client.Window.alert("" +
            // keyPressEvent.getKeyName());
            if (keyPressEvent.getKeyName().equalsIgnoreCase("ENTER")) onOkClick();
          }
        });

    accountForm.setFields(login, password);

    Label linkRegistration = null;
    if (GWTViewer.config.withRegistration()) {
      linkRegistration = new Label();
      linkRegistration.setAlign(Alignment.RIGHT);
      linkRegistration.setStyleName(CSS_LABEL_LINK);
      linkRegistration.setHeight(20);
      linkRegistration.setWidth(265);
      linkRegistration.setContents(REGISTRATION);

      linkRegistration.addClickHandler(
          new ClickHandler() {
            public void onClick(ClickEvent event) {
              callback.onSuccess(CMD_REGISTRATION);
              closeForm();
            }
          });
    }
    labelException = new Label();
    labelException.setAlign(Alignment.CENTER);
    labelException.setStyleName(CSS_LABEL_ERROR);
    labelException.setHeight(35);
    labelException.setWidth100();
    labelException.setMargin(5);
    //       labelException.setBorder("1px solid #0aa");
    labelException.setContents("");

    HLayout controlPanel = new HLayout();
    controlPanel.setHeight("30px");
    controlPanel.setLayoutLeftMargin(55);

    Button btnOk = null;
    btnOk = new Button("Ok");
    btnOk.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            onOkClick();
          }
        });
    Button btnClose = new Button(CAPTION_CLOSE);
    btnClose.setTop(10);
    btnClose.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            closeForm();
          }
        });
    controlPanel.addMember(btnOk);
    controlPanel.addMember(btnClose);

    layout.addMember(accountForm);
    if (linkRegistration != null) layout.addMember(linkRegistration);
    layout.addMember(labelException);
    layout.addMember(controlPanel);
    addItem(layout);
  }