diff options
Diffstat (limited to 'uitest/src')
19 files changed, 340 insertions, 42 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxGroupTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxGroupTestUI.java index 56d45995cb..88006fd68a 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxGroupTestUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxGroupTestUI.java @@ -15,7 +15,7 @@ */ package com.vaadin.tests.components.checkbox; -import com.vaadin.server.FontAwesome; +import com.vaadin.icons.VaadinIcons; import com.vaadin.tests.components.abstractlisting.AbstractMultiSelectTestUI; import com.vaadin.ui.CheckBoxGroup; import com.vaadin.ui.IconGenerator; @@ -60,7 +60,7 @@ public class CheckBoxGroupTestUI boolean activate, Object data) { if (activate) { group.setItemIconGenerator( - item -> FontAwesome.values()[getIndex(item) + 1]); + item -> VaadinIcons.values()[getIndex(item) + 1]); } else { group.setItemIconGenerator(DEFAULT_ICON_GENERATOR); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxClickIcon.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxClickIcon.java index fe1d4c4670..2edf43e398 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxClickIcon.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxClickIcon.java @@ -15,7 +15,7 @@ */ package com.vaadin.tests.components.combobox; -import com.vaadin.server.FontAwesome; +import com.vaadin.icons.VaadinIcons; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractReindeerTestUI; import com.vaadin.ui.ComboBox; @@ -31,7 +31,7 @@ public class ComboBoxClickIcon extends AbstractReindeerTestUI { protected void setup(VaadinRequest request) { final ComboBox<String> combo = new ComboBox<>(); combo.setItems("A", "B", "C"); - combo.setItemIconGenerator(item -> FontAwesome.ALIGN_CENTER); + combo.setItemIconGenerator(item -> VaadinIcons.ALIGN_CENTER); combo.setTextInputAllowed(false); addComponent(combo); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/SingleUseDragAndDropUpload.java b/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/SingleUseDragAndDropUpload.java index 2e2c791e5e..cd4b180d63 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/SingleUseDragAndDropUpload.java +++ b/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/SingleUseDragAndDropUpload.java @@ -24,7 +24,7 @@ import com.vaadin.event.dd.DragAndDropEvent; import com.vaadin.event.dd.DropHandler; import com.vaadin.event.dd.acceptcriteria.AcceptAll; import com.vaadin.event.dd.acceptcriteria.AcceptCriterion; -import com.vaadin.server.FontAwesome; +import com.vaadin.icons.VaadinIcons; import com.vaadin.server.StreamVariable; import com.vaadin.server.VaadinRequest; import com.vaadin.shared.ui.ContentMode; @@ -39,7 +39,7 @@ public class SingleUseDragAndDropUpload extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { - Label upload = new Label(FontAwesome.UPLOAD.getHtml(), + Label upload = new Label(VaadinIcons.UPLOAD.getHtml(), ContentMode.HTML); upload.setSizeUndefined(); upload.setStyleName("upload"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarsWithNesting.java b/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarsWithNesting.java index 1855fd149d..70016c9fb8 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarsWithNesting.java +++ b/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarsWithNesting.java @@ -15,7 +15,7 @@ */ package com.vaadin.tests.components.menubar; -import com.vaadin.server.FontAwesome; +import com.vaadin.icons.VaadinIcons; import com.vaadin.server.Resource; import com.vaadin.server.ThemeResource; import com.vaadin.server.VaadinRequest; @@ -27,7 +27,7 @@ import com.vaadin.ui.MenuBar.MenuItem; /** * A UI for testing VMenuBar.getSubPartElement(String). The UI contains two * MenuBars, one without icons and one containing items with and without icons. - * Some of the icons are textual (using FontAwesome) and should behave like + * Some of the icons are textual (using VaadinIcons) and should behave like * items with image icons: the icon should not be considered to be a part of the * item's caption. * @@ -44,13 +44,13 @@ public class MenuBarsWithNesting extends AbstractReindeerTestUI { public final static String[] itemNames = { "Icon item", "Arrow down", "Arrow up", "Warning" }; private final static Resource[] itemIcons = { - new ThemeResource("window/img/restore.png"), FontAwesome.ARROW_DOWN, - FontAwesome.ARROW_UP, FontAwesome.WARNING }; + new ThemeResource("window/img/restore.png"), VaadinIcons.ARROW_DOWN, + VaadinIcons.ARROW_UP, VaadinIcons.WARNING }; // The last menu item is nested with the following submenu items. public final static String[] nestedItemnames = { "No icon", "Font icon", "Image icon" }; - private final static Resource[] nestedItemIcons = { null, FontAwesome.LINK, + private final static Resource[] nestedItemIcons = { null, VaadinIcons.LINK, new ThemeResource("window/img/restore.png") }; private MenuBar.Command selectionCommand; diff --git a/uitest/src/main/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTestUI.java index 672ab1a49f..20314fd347 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTestUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTestUI.java @@ -18,7 +18,7 @@ package com.vaadin.tests.components.radiobutton; import java.util.LinkedHashMap; import java.util.stream.IntStream; -import com.vaadin.server.FontAwesome; +import com.vaadin.icons.VaadinIcons; import com.vaadin.tests.components.abstractlisting.AbstractListingTestUI; import com.vaadin.ui.ItemCaptionGenerator; import com.vaadin.ui.RadioButtonGroup; @@ -71,7 +71,7 @@ public class RadioButtonGroupTestUI boolean activate, Object data) { if (activate) { group.setItemIconGenerator( - item -> FontAwesome.values()[getIndex(item) + 1]); + item -> VaadinIcons.values()[getIndex(item) + 1]); } else { group.setItemIconGenerator(item -> null); } diff --git a/uitest/src/main/java/com/vaadin/tests/fonticon/FontIcons.java b/uitest/src/main/java/com/vaadin/tests/fonticon/FontIcons.java index 7007e6706c..97ea396f93 100644 --- a/uitest/src/main/java/com/vaadin/tests/fonticon/FontIcons.java +++ b/uitest/src/main/java/com/vaadin/tests/fonticon/FontIcons.java @@ -57,6 +57,11 @@ import com.vaadin.v7.ui.TextArea; import com.vaadin.v7.ui.Tree; import com.vaadin.v7.ui.TwinColSelect; +/** + * This is a legacy test ui for using font icons (font awesome). + * <p> + * {@link VaadinIconSet} is the newer one for testing valo+vaadin icons. + */ public class FontIcons extends AbstractReindeerTestUI { @Override diff --git a/uitest/src/main/java/com/vaadin/tests/fonticon/VaadinIconSet.java b/uitest/src/main/java/com/vaadin/tests/fonticon/VaadinIconSet.java new file mode 100644 index 0000000000..fe1436d0a7 --- /dev/null +++ b/uitest/src/main/java/com/vaadin/tests/fonticon/VaadinIconSet.java @@ -0,0 +1,181 @@ +package com.vaadin.tests.fonticon; + +import java.util.List; + +import com.vaadin.icons.VaadinIcons; +import com.vaadin.server.FontIcon; +import com.vaadin.server.Page; +import com.vaadin.server.Resource; +import com.vaadin.server.VaadinRequest; +import com.vaadin.shared.Position; +import com.vaadin.shared.ui.ContentMode; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.AbstractListing; +import com.vaadin.ui.Accordion; +import com.vaadin.ui.Button; +import com.vaadin.ui.CheckBox; +import com.vaadin.ui.CheckBoxGroup; +import com.vaadin.ui.ComboBox; +import com.vaadin.ui.Component; +import com.vaadin.ui.DateField; +import com.vaadin.ui.Grid; +import com.vaadin.ui.GridLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.Link; +import com.vaadin.ui.ListSelect; +import com.vaadin.ui.MenuBar; +import com.vaadin.ui.MenuBar.MenuItem; +import com.vaadin.ui.NativeButton; +import com.vaadin.ui.NativeSelect; +import com.vaadin.ui.Notification; +import com.vaadin.ui.Panel; +import com.vaadin.ui.RadioButtonGroup; +import com.vaadin.ui.Slider; +import com.vaadin.ui.TabSheet; +import com.vaadin.ui.TextArea; +import com.vaadin.ui.TextField; +import com.vaadin.ui.TwinColSelect; +import com.vaadin.ui.Upload; +import com.vaadin.ui.VerticalLayout; + +public class VaadinIconSet extends AbstractTestUI { + + private List<Component> componentz; + + @Override + protected void setup(VaadinRequest request) { + buildUI(com.vaadin.icons.VaadinIcons.VAADIN_V); + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + private void buildUI(final Resource icon) { + VerticalLayout layout = new VerticalLayout(); + addComponent(layout); + layout.setSpacing(false); + + layout.setIcon(icon); + + GridLayout gl = new GridLayout(5, 5); + + layout.addComponent(new Button("Switch icon type", + event -> gl.iterator().forEachRemaining( + c -> c.setIcon(VaadinIcons.AIRPLANE)))); + + // Notification + Notification n = new Notification("Hey there!"); + n.setIcon(icon); + n.setPosition(Position.BOTTOM_CENTER); + n.setDelayMsec(300000); + n.show(Page.getCurrent()); + + // grid of compoents + layout.addComponent(gl); + + // Basic components, caption icon only + Class<?>[] components = { Button.class, CheckBox.class, DateField.class, + NativeButton.class, Link.class, Label.class, Panel.class, + Slider.class, TextArea.class, TextField.class, Upload.class }; + for (Class<?> clazz : components) { + Component c; + try { + c = (Component) clazz.newInstance(); + } catch (Exception e) { + e.printStackTrace(); + continue; + } + c.setCaption(clazz.getSimpleName()); + c.setIcon(icon); + gl.addComponent(c); + } + + // TabSheet, caption + tab icons + TabSheet tabs = new TabSheet(); + tabs.setCaption("TabSheet"); + tabs.setIcon(icon); + tabs.addStyleName("myTabs"); + tabs.addTab(createLabel("Content 1"), "Tab 1", icon); + tabs.addTab(createLabel("Content 2"), "Tab 2", icon); + tabs.setWidth("150px"); + gl.addComponent(tabs); + + // Accordion, caption + tab icons + Accordion acc = new Accordion(); + acc.setCaption("Accordion"); + acc.setIcon(icon); + acc.addTab(createLabel(""), "Section 1", icon); + acc.addTab(createLabel(""), "Section 2", icon); + gl.addComponent(acc); + + Grid<String> grid = new Grid<>(); + grid.setCaption("Grid"); + grid.setIcon(icon); + grid.setItems("item 1", "item 2", "item 3"); + grid.addColumn(string -> string).setCaption("column 1"); + grid.addColumn(string -> "Another " + string).setCaption("column 2"); + // vaadin/framework#8207 + // grid.setHeightByRows(3); + grid.setHeight("150px"); + gl.addComponent(grid); + + // Selects, caption + item icons + Class<?>[] selects = { ComboBox.class, NativeSelect.class, + ListSelect.class, TwinColSelect.class, RadioButtonGroup.class, + CheckBoxGroup.class }; + for (Class<?> clazz : selects) { + AbstractListing<String> sel; + try { + sel = (AbstractListing<String>) clazz.newInstance(); + } catch (Exception e) { + e.printStackTrace(); + continue; + } + sel.setCaption(clazz.getSimpleName()); + sel.setIcon(icon); + sel.setItems("One", "Two"); + if (sel instanceof RadioButtonGroup) { + ((RadioButtonGroup) sel).setItemIconGenerator(item -> icon); + } else if (sel instanceof CheckBoxGroup) { + ((CheckBoxGroup) sel).setItemIconGenerator(item -> icon); + } else if (sel instanceof ComboBox) { + ((ComboBox) sel).setItemIconGenerator(item -> icon); + } + gl.addComponent(sel); + } + + // MenuBar, caption + item + sub-item icons + MenuBar menu = new MenuBar(); + menu.setIcon(icon); + menu.setCaption("MenuBar"); + MenuItem mi = menu.addItem("File", icon, null); + MenuItem smi = mi.addItem("Item", icon, null); + smi = mi.addItem("Item", icon, null); + smi = smi.addItem("Item", icon, null); + gl.addComponent(menu); + + // All of Vaadin Icons + String allIcons = ""; + for (FontIcon ic : com.vaadin.icons.VaadinIcons.values()) { + allIcons += ic.getHtml() + " "; + } + Label label = new Label(allIcons, ContentMode.HTML); + label.setWidth("100%"); + layout.addComponent(label); + } + + private Label createLabel(String caption) { + Label label = new Label(caption); + label.setWidth("100%"); + return label; + } + + @Override + protected String getTestDescription() { + return "Vaadin Icons should show up in all the right places"; + } + + @Override + protected Integer getTicketNumber() { + return 7979; + } + +} diff --git a/uitest/src/main/java/com/vaadin/tests/fonticon/VaadinIconUI.java b/uitest/src/main/java/com/vaadin/tests/fonticon/VaadinIconUI.java new file mode 100644 index 0000000000..0f8af5e9f0 --- /dev/null +++ b/uitest/src/main/java/com/vaadin/tests/fonticon/VaadinIconUI.java @@ -0,0 +1,45 @@ +package com.vaadin.tests.fonticon; + +import com.vaadin.annotations.Theme; +import com.vaadin.icons.VaadinIcons; +import com.vaadin.server.VaadinRequest; +import com.vaadin.shared.ui.ContentMode; +import com.vaadin.ui.Button; +import com.vaadin.ui.Label; +import com.vaadin.ui.TextField; +import com.vaadin.ui.UI; +import com.vaadin.ui.VerticalLayout; + +@Theme("tests-valo") +public class VaadinIconUI extends UI { + + @Override + protected void init(VaadinRequest request) { + VerticalLayout layout = new VerticalLayout(); + + TextField name = new TextField("Name"); + name.setIcon(VaadinIcons.USER); + name.addStyleName("blueicon"); + layout.addComponent(name); + + // Button allows specifying icon resource in constructor + Button ok = new Button("OK", VaadinIcons.CHECK); + ok.addStyleName("blueicon"); + layout.addComponent(ok); + + setContent(layout); + + Label label = new Label("I " + VaadinIcons.HEART.getHtml() + " Vaadin", + ContentMode.HTML); + label.addStyleName("redicon"); + layout.addComponent(label); + + TextField amount = new TextField("Amount (in " + + new String( + Character.toChars(VaadinIcons.DOLLAR.getCodepoint())) + + ")"); + amount.addStyleName("amount"); + layout.addComponent(amount); + } + +} diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/CommonParts.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/CommonParts.java index f0f0e0995b..4f95aff06f 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/valo/CommonParts.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/CommonParts.java @@ -16,11 +16,11 @@ package com.vaadin.tests.themes.valo; import com.vaadin.event.ShortcutAction.KeyCode; +import com.vaadin.icons.VaadinIcons; import com.vaadin.navigator.View; import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; import com.vaadin.server.AbstractErrorMessage; import com.vaadin.server.ErrorMessage.ErrorLevel; -import com.vaadin.server.FontAwesome; import com.vaadin.server.Page; import com.vaadin.server.UserError; import com.vaadin.shared.Position; @@ -267,7 +267,7 @@ public class CommonParts extends VerticalLayout implements View { delay.setValue(""); } }); - clear.setIcon(FontAwesome.TIMES_CIRCLE); + clear.setIcon(VaadinIcons.CLOSE_CIRCLE); clear.addStyleName("last"); clear.addStyleName(ValoTheme.BUTTON_SMALL); clear.addStyleName(ValoTheme.BUTTON_ICON_ONLY); diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/MenuBars.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/MenuBars.java index 9d4f0a1f61..edba8c5612 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/valo/MenuBars.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/MenuBars.java @@ -15,9 +15,9 @@ */ package com.vaadin.tests.themes.valo; +import com.vaadin.icons.VaadinIcons; import com.vaadin.navigator.View; import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; -import com.vaadin.server.FontAwesome; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.MenuBar; @@ -192,12 +192,12 @@ public class MenuBars extends VerticalLayout implements View { fav.setCheckable(true); fav.setCheckable(true); - menubar.addItem("Attach", click).setIcon(FontAwesome.PAPERCLIP); - menubar.addItem("Undo", click).setIcon(FontAwesome.UNDO); + menubar.addItem("Attach", click).setIcon(VaadinIcons.PAPERCLIP); + menubar.addItem("Undo", click).setIcon(VaadinIcons.ROTATE_LEFT); MenuItem redo = menubar.addItem("Redo", click); - redo.setIcon(FontAwesome.REPEAT); + redo.setIcon(VaadinIcons.ROTATE_RIGHT); redo.setEnabled(false); - menubar.addItem("Upload", click).setIcon(FontAwesome.UPLOAD); + menubar.addItem("Upload", click).setIcon(VaadinIcons.UPLOAD); return menubar; } @@ -207,31 +207,31 @@ public class MenuBars extends VerticalLayout implements View { menubar.setWidth("100%"); MenuItem fav = menubar.addItem("", null); - fav.setIcon(FontAwesome.ALIGN_LEFT); + fav.setIcon(VaadinIcons.ALIGN_LEFT); fav.setStyleName("icon-only"); fav.setCheckable(true); // fav.setChecked(true); fav = menubar.addItem("", null); - fav.setIcon(FontAwesome.ALIGN_CENTER); + fav.setIcon(VaadinIcons.ALIGN_CENTER); fav.setStyleName("icon-only"); fav.setCheckable(true); fav = menubar.addItem("", null); - fav.setIcon(FontAwesome.ALIGN_RIGHT); + fav.setIcon(VaadinIcons.ALIGN_RIGHT); fav.setStyleName("icon-only"); fav.setCheckable(true); MenuItem clip = menubar.addItem("", null); - clip.setIcon(FontAwesome.PAPERCLIP); + clip.setIcon(VaadinIcons.PAPERCLIP); clip.setStyleName("icon-only"); MenuItem undo = menubar.addItem("", null); - undo.setIcon(FontAwesome.UNDO); + undo.setIcon(VaadinIcons.ROTATE_LEFT); undo.setStyleName("icon-only"); MenuItem redo = menubar.addItem("", null); - redo.setIcon(FontAwesome.REPEAT); + redo.setIcon(VaadinIcons.ROTATE_RIGHT); redo.setEnabled(false); redo.setStyleName("icon-only"); diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/Panels.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/Panels.java index ecd968b607..19fea50862 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/valo/Panels.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/Panels.java @@ -15,9 +15,9 @@ */ package com.vaadin.tests.themes.valo; +import com.vaadin.icons.VaadinIcons; import com.vaadin.navigator.View; import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; -import com.vaadin.server.FontAwesome; import com.vaadin.ui.Button; import com.vaadin.ui.Component; import com.vaadin.ui.CssLayout; @@ -112,7 +112,7 @@ public class Panels extends VerticalLayout implements View { panelCaption.setExpandRatio(label, 1); Button action = new Button(); - action.setIcon(FontAwesome.PENCIL); + action.setIcon(VaadinIcons.PENCIL); action.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); action.addStyleName(ValoTheme.BUTTON_SMALL); action.addStyleName(ValoTheme.BUTTON_ICON_ONLY); @@ -120,7 +120,7 @@ public class Panels extends VerticalLayout implements View { MenuBar dropdown = new MenuBar(); dropdown.addStyleName(ValoTheme.MENUBAR_BORDERLESS); dropdown.addStyleName(ValoTheme.MENUBAR_SMALL); - MenuItem addItem = dropdown.addItem("", FontAwesome.CHEVRON_DOWN, null); + MenuItem addItem = dropdown.addItem("", VaadinIcons.CHEVRON_DOWN, null); addItem.setStyleName("icon-only"); addItem.addItem("Settings", null); addItem.addItem("Preferences", null); diff --git a/uitest/src/main/resources/com/vaadin/tests/themes/valo/ResponsiveStylesDesign.html b/uitest/src/main/resources/com/vaadin/tests/themes/valo/ResponsiveStylesDesign.html index 2651bb43ed..f1ed93ffea 100644 --- a/uitest/src/main/resources/com/vaadin/tests/themes/valo/ResponsiveStylesDesign.html +++ b/uitest/src/main/resources/com/vaadin/tests/themes/valo/ResponsiveStylesDesign.html @@ -14,11 +14,11 @@ <strong>Application</strong> </v-label> </v-horizontal-layout> - <v-button icon="fonticon://FontAwesome/f03a" style-name="primary small valo-menu-toggle" plain-text="" > + <v-button icon="fonticon://Vaadin-Icons/e7f1" style-name="primary small valo-menu-toggle" plain-text="" > Menu </v-button> <v-css-layout style-name="valo-menuitems" > - <v-button icon="fonticon://FontAwesome/f01c" primary-style-name="valo-menu-item" > + <v-button icon="fonticon://Vaadin-Icons/e71b" primary-style-name="valo-menu-item" > Inbox <span class="valo-menu-badge">7</span> </v-button> @@ -39,11 +39,11 @@ <strong>Application</strong> </v-label> </v-horizontal-layout> - <v-button icon="fonticon://FontAwesome/f03a" style-name="primary small valo-menu-toggle" plain-text="" > + <v-button icon="fonticon://Vaadin-Icons/e7f1" style-name="primary small valo-menu-toggle" plain-text="" > Menu </v-button> <v-css-layout style-name="valo-menuitems" > - <v-button icon="fonticon://FontAwesome/f01c" primary-style-name="valo-menu-item" > + <v-button icon="fonticon://Vaadin-Icons/e71b" primary-style-name="valo-menu-item" > Inbox <span class="valo-menu-badge">7</span> </v-button> @@ -64,11 +64,11 @@ <strong>Application</strong> </v-label> </v-horizontal-layout> - <v-button icon="fonticon://FontAwesome/f03a" style-name="primary small valo-menu-toggle" plain-text=""> + <v-button icon="fonticon://Vaadin-Icons/e7f1" style-name="primary small valo-menu-toggle" plain-text=""> Menu </v-button> <v-css-layout style-name="valo-menuitems"> - <v-button icon="fonticon://FontAwesome/f01c" primary-style-name="valo-menu-item" > + <v-button icon="fonticon://Vaadin-Icons/e71b" primary-style-name="valo-menu-item" > Inbox <span class="valo-menu-badge">7</span> </v-button> diff --git a/uitest/src/main/themes/VAADIN/themes/tests-valo-disabled-animations/_variables.scss b/uitest/src/main/themes/VAADIN/themes/tests-valo-disabled-animations/_variables.scss index d2411c675c..2ef5a5cc5d 100644 --- a/uitest/src/main/themes/VAADIN/themes/tests-valo-disabled-animations/_variables.scss +++ b/uitest/src/main/themes/VAADIN/themes/tests-valo-disabled-animations/_variables.scss @@ -1,3 +1,4 @@ $v-animations-enabled: false; +$v-font-awesome: true; @import "../valo/valo"; diff --git a/uitest/src/main/themes/VAADIN/themes/tests-valo/_valotest.scss b/uitest/src/main/themes/VAADIN/themes/tests-valo/_valotest.scss index 568dfec0b8..ff408dc93f 100644 --- a/uitest/src/main/themes/VAADIN/themes/tests-valo/_valotest.scss +++ b/uitest/src/main/themes/VAADIN/themes/tests-valo/_valotest.scss @@ -145,4 +145,18 @@ .v-menubar-color1 { @include valo-menubar-style($background-color: $v-selection-color, $unit-size: null); } + + .redicon .v-icon { + color: #ff3a49; + } + .v-caption-blueicon, + .blueicon { + .v-icon { + color: #00b4f0; + }} + + .v-caption-amount .v-captiontext { + font-family: Vaadin-Icons; + } + } diff --git a/uitest/src/test/java/com/vaadin/tests/components/checkboxgroup/CheckBoxGroupTest.java b/uitest/src/test/java/com/vaadin/tests/components/checkboxgroup/CheckBoxGroupTest.java index ea2bf8f875..5d7c37c754 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/checkboxgroup/CheckBoxGroupTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/checkboxgroup/CheckBoxGroupTest.java @@ -32,7 +32,7 @@ import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; -import com.vaadin.server.FontAwesome; +import com.vaadin.icons.VaadinIcons; import com.vaadin.testbench.elements.CheckBoxGroupElement; import com.vaadin.tests.components.checkbox.CheckBoxGroupTestUI; import com.vaadin.tests.tb3.MultiBrowserTest; @@ -168,9 +168,10 @@ public class CheckBoxGroupTest extends MultiBrowserTest { "Use Item Icon Generator"); assertItemSuffices(20); List<WebElement> icons = getSelect() - .findElements(By.cssSelector(".v-icon.FontAwesome")); + .findElements(By.cssSelector(".v-select-optiongroup .v-icon")); + Assert.assertTrue(icons.size() > 0); for (int i = 0; i < icons.size(); i++) { - Assert.assertEquals(FontAwesome.values()[i + 1].getCodepoint(), + Assert.assertEquals(VaadinIcons.values()[i + 1].getCodepoint(), icons.get(i).getText().charAt(0)); } } diff --git a/uitest/src/test/java/com/vaadin/tests/components/javascriptcomponent/JSComponentLoadingIndicatorTest.java b/uitest/src/test/java/com/vaadin/tests/components/javascriptcomponent/JSComponentLoadingIndicatorTest.java index c88ea234f6..a1c5edd095 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/javascriptcomponent/JSComponentLoadingIndicatorTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/javascriptcomponent/JSComponentLoadingIndicatorTest.java @@ -12,9 +12,9 @@ public class JSComponentLoadingIndicatorTest extends SingleBrowserTest { @Test public void ensureLoadingIndicatorShown() { openTestURL(); + WebElement js = findElement(By.id("js")); testBench().disableWaitForVaadin(); - WebElement js = findElement(By.id("js")); js.click(); waitUntilLoadingIndicatorVisible(); waitUntilLoadingIndicatorNotVisible(); diff --git a/uitest/src/test/java/com/vaadin/tests/components/radiobuttongroup/RadioButtonGroupTest.java b/uitest/src/test/java/com/vaadin/tests/components/radiobuttongroup/RadioButtonGroupTest.java index 20f207acc9..2c53903d29 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/radiobuttongroup/RadioButtonGroupTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/radiobuttongroup/RadioButtonGroupTest.java @@ -25,7 +25,7 @@ import org.junit.Before; import org.junit.Test; import org.openqa.selenium.WebElement; -import com.vaadin.server.FontAwesome; +import com.vaadin.icons.VaadinIcons; import com.vaadin.testbench.By; import com.vaadin.testbench.elements.RadioButtonGroupElement; import com.vaadin.tests.components.radiobutton.RadioButtonGroupTestUI; @@ -131,7 +131,7 @@ public class RadioButtonGroupTest extends MultiBrowserTest { assertEquals(20, icons.size()); for (int i = 0; i < icons.size(); i++) { - Assert.assertEquals(FontAwesome.values()[i + 1].getCodepoint(), + Assert.assertEquals(VaadinIcons.values()[i + 1].getCodepoint(), icons.get(i).getText().charAt(0)); } } diff --git a/uitest/src/test/java/com/vaadin/tests/fonticon/FontIconsTest.java b/uitest/src/test/java/com/vaadin/tests/fonticon/FontIconsTest.java index 82e9ea7f79..b162a7467b 100644 --- a/uitest/src/test/java/com/vaadin/tests/fonticon/FontIconsTest.java +++ b/uitest/src/test/java/com/vaadin/tests/fonticon/FontIconsTest.java @@ -30,7 +30,7 @@ public class FontIconsTest extends MultiBrowserTest { @Test public void checkScreenshot() throws IOException { openTestURL(); - compareScreen("allFontIcons"); + compareScreen("allVaadinIcons"); } @Test diff --git a/uitest/src/test/java/com/vaadin/tests/fonticon/VaadinIconSetTest.java b/uitest/src/test/java/com/vaadin/tests/fonticon/VaadinIconSetTest.java new file mode 100644 index 0000000000..c55bf80a5f --- /dev/null +++ b/uitest/src/test/java/com/vaadin/tests/fonticon/VaadinIconSetTest.java @@ -0,0 +1,51 @@ +package com.vaadin.tests.fonticon; + +import static org.junit.Assert.assertEquals; + +import java.io.IOException; + +import org.junit.Test; +import org.openqa.selenium.Keys; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.ComboBoxElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class VaadinIconSetTest extends MultiBrowserTest { + + @Test + public void checkScreenshot_initial() throws IOException { + openTestURL(); + compareScreen("allVaadinIcons"); + } + + @Test + public void checkScreenshot_changeIcon() throws IOException { + openTestURL(); + + $(ButtonElement.class).first().click(); + + compareScreen("allVaadinIcons-switch"); + } + + @Test + public void comboBoxItemIconsOnKeyboardNavigation() throws Exception { + openTestURL(); + ComboBoxElement comboBox = $(ComboBoxElement.class).first(); + + // No initial value. + assertEquals("", comboBox.getText()); + + // Navigate to the first item with keyboard navigation. + comboBox.sendKeys(400, Keys.ARROW_DOWN, Keys.ARROW_DOWN); + + // Value must be "One" without any extra characters. + // See ticket #14660 + assertEquals("One", comboBox.getText()); + + // Check also the second item. + comboBox.sendKeys(Keys.ARROW_DOWN); + assertEquals("Two", comboBox.getText()); + } + +} |