/** Constructor */
  public ConfirmDialog() {
    dialogBox = new DialogBox(false, true);

    confirmPanel = new DockPanel();
    messageLabel = createMessageLabel();
    confirmPanel.add(messageLabel, DockPanel.CENTER);

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setSpacing(10);
    okButton = createOkButton();
    horizontalPanel.add(okButton);
    cancelButton = createCancelButton();
    horizontalPanel.add(cancelButton);

    if (defaultCloseHandlers != null) {
      for (CloseHandler<ConfirmDialog> closeHandler : defaultCloseHandlers) {
        this.addCloseHandler(closeHandler);
      }
    }

    if (defaultOpenHandlers != null) {
      for (OpenHandler<ConfirmDialog> openHandler : defaultOpenHandlers) {
        this.addOpenHandler(openHandler);
      }
    }

    confirmPanel.add(horizontalPanel, DockPanel.SOUTH);
    confirmPanel.setCellHorizontalAlignment(horizontalPanel, HasHorizontalAlignment.ALIGN_CENTER);

    dialogBox.add(confirmPanel);
    confirmPanel.getElement().getParentElement().setAttribute("align", "center");

    setStyleName(DEFAULT_STYLE_NAME);
  }
Example #2
0
 public void testStringAttributeWithFormatChars() {
   assertEquals("100%", root.getElement().getStyle().getProperty("width"));
 }
Example #3
0
 public void testMinimalDom() {
   assertEquals("Expect no wrapper div around root", widgetUi.getElement(), root.getElement());
 }