Пример #1
0
  /**
   * Creates the Cancel button
   *
   * @return
   */
  private Button createCancelButton() {
    Button cancelButton = new Button();

    cancelButton.setText(WidgetMsgFactory.getMessages().cancelLabel());
    cancelButton.addStyleName("button");
    cancelButton.addStyleName("cancelButton");
    cancelButton.addSelectHandler(
        new SelectHandler() {
          public void onSelect(SelectEvent event) {
            hide();
            try {
              CancelEvent.fire(ConfirmDialog.this);
            } catch (Throwable e) {
              Crux.getErrorHandler().handleError(e);
            }
          }
        });
    return cancelButton;
  }
Пример #2
0
 /** Show message dilaog. The dialog is centered and the screen is blocked for edition */
 private void doShow() {
   try {
     dialogBox.center();
     dialogBox.show();
     okButton.setFocus(true);
     OpenEvent.fire(ConfirmDialog.this, ConfirmDialog.this);
   } catch (Exception e) {
     Crux.getErrorHandler().handleError(e);
     Screen.unblockToUser();
   }
 }
Пример #3
0
 /** @return */
 public String getCancelLabel() {
   return cancelButton.getText();
 }
Пример #4
0
 /** @return */
 public String getOkLabel() {
   return okButton.getText();
 }
Пример #5
0
 /** @param cancelLabel */
 public void setCancelLabel(String cancelLabel) {
   cancelButton.setText(cancelLabel);
 }
Пример #6
0
 /** @param okLabel */
 public void setOkLabel(String okLabel) {
   okButton.setText(okLabel);
 }