Exemple #1
0
  public void show(String html, Position position, String style) {
    NotificationConfigurationBean styleSetup = getUiState(style);
    String assistiveDeviceOnlyStyle = AriaHelper.ASSISTIVE_DEVICE_ONLY_STYLE;

    setWaiAriaRole(styleSetup);

    String type = "";
    String usage = "";

    if (styleSetup != null && styleSetup.hasAssistivePrefix()) {
      type =
          "<span class='"
              + assistiveDeviceOnlyStyle
              + "'>"
              + styleSetup.getAssistivePrefix()
              + "</span>";
    }

    if (styleSetup != null && styleSetup.hasAssistivePostfix()) {
      usage =
          "<span class='"
              + assistiveDeviceOnlyStyle
              + "'>"
              + styleSetup.getAssistivePostfix()
              + "</span>";
    }

    setWidget(new HTML(type + html + usage));
    show(position, style);
  }
Exemple #2
0
  private void setWaiAriaRole(NotificationConfigurationBean styleSetup) {
    Roles.getAlertRole().set(getElement());

    if (styleSetup != null && styleSetup.getAssistiveRole() != null) {
      if (Role.STATUS == styleSetup.getAssistiveRole()) {
        Roles.getStatusRole().set(getElement());
      }
    }
  }
Exemple #3
0
  public void show(Widget widget, Position position, String style) {
    NotificationConfigurationBean styleSetup = getUiState(style);
    setWaiAriaRole(styleSetup);

    FlowPanel panel = new FlowPanel();
    if (styleSetup.hasAssistivePrefix()) {
      panel.add(new Label(styleSetup.getAssistivePrefix()));
      AriaHelper.setVisibleForAssistiveDevicesOnly(panel.getElement(), true);
    }

    panel.add(widget);

    if (styleSetup.hasAssistivePostfix()) {
      panel.add(new Label(styleSetup.getAssistivePostfix()));
      AriaHelper.setVisibleForAssistiveDevicesOnly(panel.getElement(), true);
    }
    setWidget(panel);
    show(position, style);
  }