use of io.jmix.ui.UiComponents in project jmix-docs by Haulmont.
the class HasBanner method initBanner.
@Subscribe
default void initBanner(Screen.InitEvent event) {
// <1>
ApplicationContext applicationContext = Extensions.getApplicationContext(event.getSource());
// <2>
UiComponents uiComponents = applicationContext.getBean(UiComponents.class);
// <3>
Label<String> banner = uiComponents.create(Label.TYPE_STRING);
banner.setStyleName(ThemeClassNames.LABEL_H2);
banner.setValue("Hello, world!");
// <4>
event.getSource().getWindow().add(banner, 0);
}
Aggregations