Application Framework

Headline

For every sheet it is useful to have a headline that describes the current content. It natively has a headline caption and could be extended by subclasses.

create report simple

To use a Headline, simply instantiate and add the component to your content.

If you want the Headline’s title to be updated dynamically, you can also bind it to a PMO. To do so, create a PMO containing a corresponding getter method for Headline#HEADER_TITLE:

public class HeadlinePmo {

    private List<Report> reports;

    public HeadlinePmo(List<Report> reports) {
        this.reports = reports;
    }

    public String getHeaderTitle() {
        return "Report List - Existing reports: " + reports.size();
    }
}

Then bind it with the headline:

        new Binder(headline, headlinePmo).setupBindings(getBindingContext());

To add additional components into the <h2> element holding the title, Headline provides the method addToTitle(Component). Components added via addToTitle() remain present when the title text is updated using setTitle(). Headline uses CompositeH2 internally, which in contrast to H2 preserves children when setting the text. However, Headline can also be initialized with a standard H2 element if needed.

Alternatively, you can also use @UIHeadline for simple use cases without additional components:

@UIHeadline
public String getHeadlineText() {
    return "MyHeadline";
}