/** * 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; }
/** 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(); } }
/** @return */ public String getCancelLabel() { return cancelButton.getText(); }
/** @return */ public String getOkLabel() { return okButton.getText(); }
/** @param cancelLabel */ public void setCancelLabel(String cancelLabel) { cancelButton.setText(cancelLabel); }
/** @param okLabel */ public void setOkLabel(String okLabel) { okButton.setText(okLabel); }