Search in sources :

Example 96 with Icon

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");
}
Also used : VaadinIcon(com.vaadin.flow.component.icon.VaadinIcon) Icon(com.vaadin.flow.component.icon.Icon)

Example 97 with 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);
}
Also used : VaadinIcon(com.vaadin.flow.component.icon.VaadinIcon) Label(com.vaadin.flow.component.html.Label) VerticalLayout(com.vaadin.flow.component.orderedlayout.VerticalLayout) VaadinIcon(com.vaadin.flow.component.icon.VaadinIcon) Icon(com.vaadin.flow.component.icon.Icon) HorizontalLayout(com.vaadin.flow.component.orderedlayout.HorizontalLayout)

Example 98 with Icon

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");
}
Also used : Button(com.vaadin.flow.component.button.Button) VaadinIcon(com.vaadin.flow.component.icon.VaadinIcon) Icon(com.vaadin.flow.component.icon.Icon)

Example 99 with Icon

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);
}
Also used : TextField(com.vaadin.flow.component.textfield.TextField) Icon(com.vaadin.flow.component.icon.Icon) VaadinIcon(com.vaadin.flow.component.icon.VaadinIcon)

Example 100 with Icon

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());
    }
}
Also used : VaadinIcon(com.vaadin.flow.component.icon.VaadinIcon) Icon(com.vaadin.flow.component.icon.Icon)

Aggregations

Icon (com.vaadin.flow.component.icon.Icon)110 VaadinIcon (com.vaadin.flow.component.icon.VaadinIcon)94 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)46 Button (com.vaadin.flow.component.button.Button)39 Span (com.vaadin.flow.component.html.Span)21 Div (com.vaadin.flow.component.html.Div)19 ComponentRenderer (com.vaadin.flow.data.renderer.ComponentRenderer)18 Tab (com.vaadin.flow.component.tabs.Tab)16 Text (com.vaadin.flow.component.Text)15 Test (org.junit.Test)12 EnhancedButton (org.komunumo.ui.component.EnhancedButton)12 Grid (com.vaadin.flow.component.grid.Grid)10 RouterLink (com.vaadin.flow.router.RouterLink)9 Notification (com.vaadin.flow.component.notification.Notification)8 Component (com.vaadin.flow.component.Component)7 ColumnTextAlign (com.vaadin.flow.component.grid.ColumnTextAlign)7 Anchor (com.vaadin.flow.component.html.Anchor)7 TextField (com.vaadin.flow.component.textfield.TextField)7 UI (com.vaadin.flow.component.UI)6 StreamResource (com.vaadin.flow.server.StreamResource)6