public String getText() { return ((HasHTML)link).getText(); }
@Override public String getTitleText() { return dialogPanel.getDialogTitle().getText(); }
@Override public String getTitleText() { return dialogPanel.getDialogTitle().getText(); }
private Optional<Supplier<Object>> maybeCreateElementValueGetter(final Element element) { final Optional<Supplier<Object>> uiGetter; final Supplier<ElementWrapperWidget> toWidget = () -> ElementWrapperWidget.getWidget(element); final ElementWrapperWidget wrapper = toWidget.get(); if (wrapper instanceof HasValue) { uiGetter = Optional.ofNullable(() -> ((HasValue) toWidget.get()).getValue()); } else if (wrapper instanceof HasHTML) { uiGetter = Optional.ofNullable(() -> ((HasHTML) toWidget.get()).getText()); } else { uiGetter = Optional.empty(); } return uiGetter; }
private Optional<Supplier<Object>> maybeCreateElementValueGetter(final Element element) { final Optional<Supplier<Object>> uiGetter; final Supplier<ElementWrapperWidget> toWidget = () -> ElementWrapperWidget.getWidget(element); final ElementWrapperWidget wrapper = toWidget.get(); if (wrapper instanceof HasValue) { uiGetter = Optional.ofNullable(() -> ((HasValue) toWidget.get()).getValue()); } else if (wrapper instanceof HasHTML) { uiGetter = Optional.ofNullable(() -> ((HasHTML) toWidget.get()).getText()); } else { uiGetter = Optional.empty(); } return uiGetter; }
protected String getString(Object o) { String actualValue; if (o == null) { return null; } else if (HasHTML.class.isInstance(o)) { HasHTML hasHTML = (HasHTML) o; String html = hasHTML.getHTML(); actualValue = html != null && html.length() > 0 ? html : hasHTML.getText(); } else if (HasText.class.isInstance(o)) { actualValue = ((HasText) o).getText(); } else { actualValue = "" + o; } return actualValue; }