use of com.vaadin.flow.component.icon.Icon in project flow-components by vaadin.
the class IconView method createStyledIconView.
private void createStyledIconView() {
Icon logo = new Icon(VaadinIcon.VAADIN_H);
logo.setSize("100px");
logo.setColor("orange");
addCard("Styling an icon", logo);
logo.setId("logo-icon");
}
use of com.vaadin.flow.component.icon.Icon in project flow-components by vaadin.
the class IconView method createAllIconsView.
private void createAllIconsView() {
HorizontalLayout iconLayout = new HorizontalLayout();
iconLayout.getStyle().set("flexWrap", "wrap");
iconLayout.setDefaultVerticalComponentAlignment(Alignment.CENTER);
for (VaadinIcon icon : VaadinIcon.values()) {
Icon iconComponent = icon.create();
iconComponent.setSize("50px");
iconComponent.getStyle().set("color", "#00b4f0").set("marginBottom", "3px");
VerticalLayout iconWithName = new VerticalLayout(iconComponent, new Label(icon.name()));
iconWithName.setSizeUndefined();
iconWithName.setDefaultHorizontalComponentAlignment(Alignment.CENTER);
iconWithName.getStyle().set("margin", "5px").set("width", "140px").set("fontSize", "12px");
iconLayout.add(iconWithName);
}
iconLayout.setId("all-icons");
addCard("All available icons", iconLayout);
}
use of com.vaadin.flow.component.icon.Icon in project flow-components by vaadin.
the class ButtonView method createButtonsWithIcons.
private void createButtonsWithIcons() {
Button leftButton = new Button("Left", new Icon(VaadinIcon.ARROW_LEFT));
Button rightButton = new Button("Right", new Icon(VaadinIcon.ARROW_RIGHT));
rightButton.setIconAfterText(true);
Button thumbsUpButton = new Button(new Icon(VaadinIcon.THUMBS_UP));
leftButton.addClickListener(this::showButtonClickedMessage);
rightButton.addClickListener(this::showButtonClickedMessage);
thumbsUpButton.addClickListener(this::showButtonClickedMessage);
addCard("Buttons with icons", leftButton, rightButton, thumbsUpButton);
leftButton.setId("left-icon-button");
rightButton.setId("right-icon-button");
thumbsUpButton.setId("thumb-icon-button");
}
use of com.vaadin.flow.component.icon.Icon in project psip-automation by bssw-psip.
the class AppBar method initSearch.
private void initSearch() {
search = new TextField();
search.setPlaceholder("Search");
search.setPrefixComponent(new Icon(VaadinIcon.SEARCH));
search.setVisible(false);
}
use of com.vaadin.flow.component.icon.Icon in project psip-automation by bssw-psip.
the class NaviDrawer method toggleRailMode.
private void toggleRailMode() {
if (getElement().hasAttribute(RAIL)) {
getElement().setAttribute(RAIL, false);
railButton.setIcon(new Icon(VaadinIcon.CHEVRON_LEFT_SMALL));
railButton.setText("Collapse");
UIUtils.setAriaLabel("Collapse menu", railButton);
} else {
getElement().setAttribute(RAIL, true);
railButton.setIcon(new Icon(VaadinIcon.CHEVRON_RIGHT_SMALL));
railButton.setText("Expand");
UIUtils.setAriaLabel("Expand menu", railButton);
getUI().get().getPage().executeJavaScript(//
"var originalStyle = getComputedStyle($0).pointerEvents;" + //
"$0.style.pointerEvents='none';" + "setTimeout(function() {$0.style.pointerEvents=originalStyle;}, 170);", getElement());
}
}
Aggregations