use of com.vaadin.flow.component.icon.Icon in project linkki by linkki-framework.
the class LinkkiTabSheetTest method testGetTab.
@Test
void testGetTab() {
Icon captionComponent = VaadinIcon.PLUS.create();
LinkkiTabSheet tabSheet = new LinkkiTabSheet("id", "caption", captionComponent, "description", () -> new Span("content"), () -> true, Collections.emptyList());
assertThat(tabSheet.getTab().getLabel(), is("caption"));
assertThat(tabSheet.getTab().getChildren().findFirst().get(), is(captionComponent));
assertThat(tabSheet.getTab().getId().get(), is("id"));
assertThat(tabSheet.getTab().getElement().getAttribute("title"), is("description"));
// TODO LIN-2054 description as tooltip
}
use of com.vaadin.flow.component.icon.Icon in project linkki by linkki-framework.
the class LinkkiTabSheetTest method testBuilder_WithCaptionComponent_OverwritesExistingCaption.
@Test
void testBuilder_WithCaptionComponent_OverwritesExistingCaption() {
Icon icon = VaadinIcon.PLUS.create();
LinkkiTabSheet tabSheet = LinkkiTabSheet.builder("id").caption("caption").caption(icon).content(() -> new Span("content")).build();
assertThat(tabSheet.getTab().getLabel(), is(""));
}
use of com.vaadin.flow.component.icon.Icon in project linkki by linkki-framework.
the class LinkkiTabSheetTest method testBuilder_WithCaptionComponent.
@Test
void testBuilder_WithCaptionComponent() {
Icon icon = VaadinIcon.PLUS.create();
LinkkiTabSheet tabSheet = LinkkiTabSheet.builder("id").caption(icon).content(() -> new Span("content")).build();
assertThat(tabSheet.getTab().getLabel(), is(""));
assertThat(tabSheet.getTab().getChildren().findFirst().get(), is(icon));
}
use of com.vaadin.flow.component.icon.Icon in project sapl-demos by heutelbeck.
the class Utilities method getInfoText.
public static HorizontalLayout getInfoText(String infoText) {
Pre infoTextPre = new Pre(infoText);
infoTextPre.getStyle().set("white-space", "pre-wrap").set("margin", "auto").set("font-size", "medium").set("padding-left", "5px").set("padding-right", "5px");
Icon infoIcon = new Icon(VaadinIcon.INFO_CIRCLE);
return new HorizontalLayout(infoIcon, infoTextPre);
}
use of com.vaadin.flow.component.icon.Icon in project ArchCNL by Mari-Wie.
the class TripletView method addCreateRemoveButtons.
private void addCreateRemoveButtons() {
HorizontalLayout buttons = new HorizontalLayout();
buttons.add(new Button(new Icon(VaadinIcon.TRASH), click -> fireEvent(new TripletViewDeleteButtonPressedEvent(this))));
buttons.add(new Button(new Icon(VaadinIcon.PLUS), click -> fireEvent(new AddTripletViewAfterButtonPressedEvent(this))));
add(buttons);
setVerticalComponentAlignment(Alignment.END, buttons);
}
Aggregations