com.vaadin.flow.component.HasText

Here are the examples of the java api com.vaadin.flow.component.HasText taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

6 Examples 7

19 Source : DefaultBadgeHolder.java
with Apache License 2.0
from appreciated

private void addBadgeHolderComponent(HasText text) {
    this.badgeHolderComponents.add(text);
    updateBadgeCaption(text);
}

19 Source : DefaultBadgeHolder.java
with Apache License 2.0
from appreciated

public void bind(HasText text) {
    addBadgeHolderComponent(text);
}

19 Source : NotificationHolder.java
with Apache License 2.0
from appreciated

public void bind(HasText text) {
    addBadgeHolderComponent(text);
    updateBadgeCaptions();
}

18 Source : DefaultBadgeHolder.java
with Apache License 2.0
from appreciated

private void updateBadgeCaption(HasText hasText) {
    if (hasText != null) {
        hasText.setText(String.valueOf(getCount()));
        if (hasText instanceof Component) {
            ((Component) hasText).setVisible(getCount() > 0);
        }
    }
}

18 Source : NotificationHolder.java
with Apache License 2.0
from appreciated

private void updateBadgeCaption(HasText hasText) {
    if (hasText != null) {
        int unread = getUnreadNotifications();
        String value;
        if (unread < 1) {
            value = String.valueOf(0);
        } else if (unread < 10) {
            value = String.valueOf(unread);
        } else {
            value = "9+";
        }
        hasText.setText(value);
        if (hasText instanceof Component) {
            ((Component) hasText).setVisible(unread > 0);
        }
    }
}

17 Source : ClearNodeChildrenView.java
with MIT License
from mcollovati

private void setTextTo(HasText container, String id) {
    container.setText("Hello World");
    message.setText(message.getText() + "\nDiv '" + id + "' text set to '" + container.getText() + "'.");
}