Exemplo n.º 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);
  }
Exemplo n.º 2
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);
  }