use of com.vaadin.flow.component.icon.Icon in project docs by vaadin.
the class AppLayoutDrawer method createTab.
private Tab createTab(VaadinIcon viewIcon, String viewName) {
Icon icon = viewIcon.create();
icon.getStyle().set("box-sizing", "border-box").set("margin-inline-end", "var(--lumo-space-m)").set("padding", "var(--lumo-space-xs)");
RouterLink link = new RouterLink();
link.add(icon, new Span(viewName));
// Demo has no routes
// link.setRoute(viewClass.java);
link.setTabIndex(-1);
return new Tab(link);
}
use of com.vaadin.flow.component.icon.Icon in project docs by vaadin.
the class AppLayoutNavbarPlacement method createTab.
private Tab createTab(VaadinIcon viewIcon, String viewName) {
Icon icon = viewIcon.create();
icon.getStyle().set("box-sizing", "border-box").set("margin-inline-end", "var(--lumo-space-m)").set("margin-inline-start", "var(--lumo-space-xs)").set("padding", "var(--lumo-space-xs)");
RouterLink link = new RouterLink();
link.add(icon, new Span(viewName));
// Demo has no routes
// link.setRoute(viewClass.java);
link.setTabIndex(-1);
return new Tab(link);
}
use of com.vaadin.flow.component.icon.Icon in project docs by vaadin.
the class AppLayoutNavbarPlacementSide method createTab.
private Tab createTab(VaadinIcon viewIcon, String viewName) {
Icon icon = viewIcon.create();
icon.getStyle().set("box-sizing", "border-box").set("margin-inline-end", "var(--lumo-space-m)").set("padding", "var(--lumo-space-xs)");
RouterLink link = new RouterLink();
link.add(icon, new Span(viewName));
// Demo has no routes
// link.setRoute(viewClass.java);
link.setTabIndex(-1);
return new Tab(link);
}
use of com.vaadin.flow.component.icon.Icon in project docs by vaadin.
the class BadgeIconsOnly method createIcon.
// tag::snippet2[]
private Icon createIcon(VaadinIcon vaadinIcon, String label) {
Icon icon = vaadinIcon.create();
icon.getStyle().set("padding", "var(--lumo-space-xs");
// Accessible label
icon.getElement().setAttribute("aria-label", label);
// Tooltip
icon.getElement().setAttribute("title", label);
return icon;
}
use of com.vaadin.flow.component.icon.Icon in project docs by vaadin.
the class BadgeIconsOnlyTable method createIcon.
private Icon createIcon(VaadinIcon vaadinIcon, String label) {
Icon icon = vaadinIcon.create();
icon.getStyle().set("padding", "var(--lumo-space-xs");
// Accessible label
icon.getElement().setAttribute("aria-label", label);
// Tooltip
icon.getElement().setAttribute("title", label);
return icon;
}
Aggregations