use of com.vaadin.flow.component.icon.Icon in project flow-components by vaadin.
the class ButtonTest method setIcon_addThemeVariant_themeAttributeContiansThemeVariantAndIcon.
@Test
public void setIcon_addThemeVariant_themeAttributeContiansThemeVariantAndIcon() {
button = new Button();
button.setIcon(new Icon(VaadinIcon.ARROW_RIGHT));
button.addThemeVariants(ButtonVariant.LUMO_SUCCESS);
Set<String> themeNames = button.getThemeNames();
Assert.assertTrue(themeNames.contains("icon"));
Assert.assertTrue(themeNames.contains(ButtonVariant.LUMO_SUCCESS.getVariantName()));
}
use of com.vaadin.flow.component.icon.Icon in project flow-components by vaadin.
the class ButtonTest method setText_setIcon_changeOrder.
@Test
public void setText_setIcon_changeOrder() {
icon = new Icon();
button = new Button();
button.setText(TEST_STRING);
button.setIcon(icon);
assertIconBeforeText();
button.setIconAfterText(true);
assertIconAfterText();
}
use of com.vaadin.flow.component.icon.Icon in project flow-components by vaadin.
the class ButtonTest method iconCtor.
@Test
public void iconCtor() {
Icon icon = new Icon();
button = new Button(icon);
Assert.assertEquals("", button.getText());
Assert.assertEquals(icon, button.getIcon());
}
use of com.vaadin.flow.component.icon.Icon in project flow-components by vaadin.
the class ButtonTest method textAndIconCtor.
@Test
public void textAndIconCtor() {
Icon icon = new Icon();
button = new Button("foo", icon);
Assert.assertEquals("foo", button.getText());
Assert.assertEquals(icon, button.getIcon());
}
use of com.vaadin.flow.component.icon.Icon in project flow-components by vaadin.
the class IconView method createBasicIconsView.
private void createBasicIconsView() {
// Creating an icon from the Vaadin icons collection
Icon close = new Icon(VaadinIcon.CLOSE);
// Creating an icon from the Lumo icons collection
Icon clock = new Icon("lumo", "clock");
close.getStyle().set("marginRight", "5px");
addCard("Creating a new icon", new HorizontalLayout(close, clock));
close.setId("close-icon");
clock.setId("clock-icon");
}
Aggregations