diff options
272 files changed, 1979 insertions, 2162 deletions
diff --git a/uitest/pom.xml b/uitest/pom.xml index 6d291ab1a6..891b8cd071 100644 --- a/uitest/pom.xml +++ b/uitest/pom.xml @@ -247,6 +247,15 @@ <plugins> <plugin> + <groupId>net.revelc.code.formatter</groupId> + <artifactId>formatter-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>com.github.dantwining.whitespace-maven-plugin</groupId> + <artifactId>whitespace-maven-plugin</artifactId> + </plugin> + + <plugin> <groupId>com.vaadin</groupId> <artifactId>vaadin-maven-plugin</artifactId> <configuration> diff --git a/uitest/src/main/java/com/vaadin/launcher/ApplicationRunnerServlet.java b/uitest/src/main/java/com/vaadin/launcher/ApplicationRunnerServlet.java index f0bb2ef533..d02ed38d0f 100644 --- a/uitest/src/main/java/com/vaadin/launcher/ApplicationRunnerServlet.java +++ b/uitest/src/main/java/com/vaadin/launcher/ApplicationRunnerServlet.java @@ -115,8 +115,8 @@ public class ApplicationRunnerServlet extends LegacyVaadinServlet { @Override protected void servletInitialized() throws ServletException { super.servletInitialized(); - getService().addSessionInitListener( - event -> onVaadinSessionStarted(event.getRequest(), event.getSession())); + getService().addSessionInitListener(event -> onVaadinSessionStarted( + event.getRequest(), event.getSession())); } private void addDirectories(File parent, LinkedHashSet<String> packages, diff --git a/uitest/src/main/java/com/vaadin/launcher/DevelopmentServerLauncher.java b/uitest/src/main/java/com/vaadin/launcher/DevelopmentServerLauncher.java index b9f865aa55..4598505ee3 100644 --- a/uitest/src/main/java/com/vaadin/launcher/DevelopmentServerLauncher.java +++ b/uitest/src/main/java/com/vaadin/launcher/DevelopmentServerLauncher.java @@ -233,7 +233,7 @@ public class DevelopmentServerLauncher { scanner.setScanInterval(interval); scanner.setRecursive(true); - scanner.addListener((BulkListener) e-> { + scanner.addListener((BulkListener) e -> { webappcontext.stop(); server.stop(); webappcontext.start(); diff --git a/uitest/src/main/java/com/vaadin/tests/NativeWindowing.java b/uitest/src/main/java/com/vaadin/tests/NativeWindowing.java index 48f8a64310..20be365e22 100644 --- a/uitest/src/main/java/com/vaadin/tests/NativeWindowing.java +++ b/uitest/src/main/java/com/vaadin/tests/NativeWindowing.java @@ -21,51 +21,49 @@ public class NativeWindowing extends LegacyApplication { setMainWindow(main); - main.addComponent( - new Button("Add new subwindow", event -> { - VerticalLayout layout = new VerticalLayout(); - layout.setMargin(true); - final Window w = new Window( - "sw " + System.currentTimeMillis(), layout); - main.addWindow(w); - w.setPositionX(100); - w.setPositionY(100); - w.setWidth("200px"); - w.setHeight("200px"); - - w.setWidth("100px"); - w.setHeight("400px"); - - final Button closebutton = new Button( - "Close " + w.getCaption(), - clickEvent -> main.removeWindow(w)); - layout.addComponent(closebutton); - - layout.addComponent(new Label( - "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>", - ContentMode.HTML)); - })); + main.addComponent(new Button("Add new subwindow", event -> { + VerticalLayout layout = new VerticalLayout(); + layout.setMargin(true); + final Window w = new Window("sw " + System.currentTimeMillis(), + layout); + main.addWindow(w); + w.setPositionX(100); + w.setPositionY(100); + w.setWidth("200px"); + w.setHeight("200px"); + + w.setWidth("100px"); + w.setHeight("400px"); + + final Button closebutton = new Button("Close " + w.getCaption(), + clickEvent -> main.removeWindow(w)); + layout.addComponent(closebutton); + + layout.addComponent(new Label( + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>", + ContentMode.HTML)); + })); main.addComponent(new Button( "Open a currently uncreated application level window", diff --git a/uitest/src/main/java/com/vaadin/tests/TestBench.java b/uitest/src/main/java/com/vaadin/tests/TestBench.java index 8b6565fc2c..5cddf06dff 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestBench.java +++ b/uitest/src/main/java/com/vaadin/tests/TestBench.java @@ -110,68 +110,67 @@ public class TestBench extends com.vaadin.server.LegacyApplication VerticalLayout lo = new VerticalLayout(); lo.addComponent(menu); - mainWindow.getPage().addUriFragmentChangedListener( - event -> { - String fragment = event.getUriFragment(); - if (fragment != null && !fragment.isEmpty()) { - // try to find a proper test class - - // exact match - for (Object next : menu.getItemIds()) { - if (next instanceof Class) { - Class<?> c = (Class<?>) next; - String string = c.getName(); - if (string.equals(fragment)) { - menu.setValue(c); - mainLayout.setSplitPosition(0); - return; - } - } + mainWindow.getPage().addUriFragmentChangedListener(event -> { + String fragment = event.getUriFragment(); + if (fragment != null && !fragment.isEmpty()) { + // try to find a proper test class + + // exact match + for (Object next : menu.getItemIds()) { + if (next instanceof Class) { + Class<?> c = (Class<?>) next; + String string = c.getName(); + if (string.equals(fragment)) { + menu.setValue(c); + mainLayout.setSplitPosition(0); + return; } + } + } - // simple name match - for (Object next : menu.getItemIds()) { - if (next instanceof Class) { - Class<?> c = (Class<?>) next; - String string = c.getSimpleName(); - if (string.equals(fragment)) { - menu.setValue(c); - mainLayout.setSplitPosition(0); - return; - } - } + // simple name match + for (Object next : menu.getItemIds()) { + if (next instanceof Class) { + Class<?> c = (Class<?>) next; + String string = c.getSimpleName(); + if (string.equals(fragment)) { + menu.setValue(c); + mainLayout.setSplitPosition(0); + return; } - // ticket match - for (Object next : menu.getItemIds()) { - if (next instanceof Class) { - Class<?> c = (Class<?>) next; - String string = c.getSimpleName(); - if (string.startsWith("Ticket" + fragment)) { - menu.setValue(c); - mainLayout.setSplitPosition(0); - return; - } - } + } + } + // ticket match + for (Object next : menu.getItemIds()) { + if (next instanceof Class) { + Class<?> c = (Class<?>) next; + String string = c.getSimpleName(); + if (string.startsWith("Ticket" + fragment)) { + menu.setValue(c); + mainLayout.setSplitPosition(0); + return; } + } + } - // just partly match lowercase - for (Object next : menu.getItemIds()) { - if (next instanceof Class) { - Class<?> c = (Class<?>) next; - String string = c.getSimpleName(); - if (string.toLowerCase(Locale.ROOT).contains( - fragment.toLowerCase(Locale.ROOT))) { - menu.setValue(c); - mainLayout.setSplitPosition(0); - return; - } - } + // just partly match lowercase + for (Object next : menu.getItemIds()) { + if (next instanceof Class) { + Class<?> c = (Class<?>) next; + String string = c.getSimpleName(); + if (string.toLowerCase(Locale.ROOT) + .contains(fragment.toLowerCase(Locale.ROOT))) { + menu.setValue(c); + mainLayout.setSplitPosition(0); + return; } - - getMainWindow().showNotification( - "No potential matc for #" + fragment); } - }); + } + + getMainWindow() + .showNotification("No potential matc for #" + fragment); + } + }); mainLayout.addComponent(lo); diff --git a/uitest/src/main/java/com/vaadin/tests/TestContainerChanges.java b/uitest/src/main/java/com/vaadin/tests/TestContainerChanges.java index 001f48b4c9..d142bc01ed 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestContainerChanges.java +++ b/uitest/src/main/java/com/vaadin/tests/TestContainerChanges.java @@ -86,9 +86,8 @@ public class TestContainerChanges extends CustomComponent { event -> cont.removeItem(tbl.lastItemId())); buttons.addComponent(b); - b = new Button("indexedcontainer.addContainerProperty()", - event -> cont.addContainerProperty("prop" + cnt, String.class, - "#" + cnt++)); + b = new Button("indexedcontainer.addContainerProperty()", event -> cont + .addContainerProperty("prop" + cnt, String.class, "#" + cnt++)); buttons.addComponent(b); b = new Button("indexedcontainer.clear()", diff --git a/uitest/src/main/java/com/vaadin/tests/TestForNativeWindowing.java b/uitest/src/main/java/com/vaadin/tests/TestForNativeWindowing.java index d4556024a9..600474ff95 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestForNativeWindowing.java +++ b/uitest/src/main/java/com/vaadin/tests/TestForNativeWindowing.java @@ -21,51 +21,49 @@ public class TestForNativeWindowing extends LegacyApplication { setMainWindow(main); - main.addComponent( - new Button("Add new subwindow", event -> { - VerticalLayout layout = new VerticalLayout(); - layout.setMargin(true); - final Window w = new Window( - "sw " + System.currentTimeMillis(), layout); - main.addWindow(w); - w.setPositionX(100); - w.setPositionY(100); - w.setWidth("200px"); - w.setHeight("200px"); - - w.setWidth("100px"); - w.setHeight("400px"); - - final Button closebutton = new Button( - "Close " + w.getCaption(), - clickEvent -> main.removeWindow(w)); - layout.addComponent(closebutton); - - layout.addComponent(new Label( - "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>" - + "<p>Lorem ipsum dolor sit amet.</p>", - ContentMode.HTML)); - })); + main.addComponent(new Button("Add new subwindow", event -> { + VerticalLayout layout = new VerticalLayout(); + layout.setMargin(true); + final Window w = new Window("sw " + System.currentTimeMillis(), + layout); + main.addWindow(w); + w.setPositionX(100); + w.setPositionY(100); + w.setWidth("200px"); + w.setHeight("200px"); + + w.setWidth("100px"); + w.setHeight("400px"); + + final Button closebutton = new Button("Close " + w.getCaption(), + clickEvent -> main.removeWindow(w)); + layout.addComponent(closebutton); + + layout.addComponent(new Label( + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>" + + "<p>Lorem ipsum dolor sit amet.</p>", + ContentMode.HTML)); + })); main.addComponent(new Button( "Open a currently uncreated application level window", diff --git a/uitest/src/main/java/com/vaadin/tests/TestForPreconfiguredComponents.java b/uitest/src/main/java/com/vaadin/tests/TestForPreconfiguredComponents.java index 91bf69695c..3600d29b31 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestForPreconfiguredComponents.java +++ b/uitest/src/main/java/com/vaadin/tests/TestForPreconfiguredComponents.java @@ -19,12 +19,11 @@ import com.vaadin.v7.ui.TwinColSelect; */ public class TestForPreconfiguredComponents extends CustomComponent { - private static final String[] firstnames = { "John", "Mary", - "Joe", "Sarah", "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" }; + private static final String[] firstnames = { "John", "Mary", "Joe", "Sarah", + "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" }; - private static final String[] lastnames = { "Torvalds", - "Smith", "Jones", "Beck", "Sheridan", "Picard", "Hill", "Fielding", - "Einstein" }; + private static final String[] lastnames = { "Torvalds", "Smith", "Jones", + "Beck", "Sheridan", "Picard", "Hill", "Fielding", "Einstein" }; private final VerticalLayout main = new VerticalLayout(); diff --git a/uitest/src/main/java/com/vaadin/tests/TestForStyledUpload.java b/uitest/src/main/java/com/vaadin/tests/TestForStyledUpload.java index 856bb0d87c..0a8eb4bd27 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestForStyledUpload.java +++ b/uitest/src/main/java/com/vaadin/tests/TestForStyledUpload.java @@ -72,11 +72,9 @@ public class TestForStyledUpload extends LegacyApplication "Transferred " + readBytes + " of " + contentLenght); }); - final Button b = new Button("Update status", - event -> readState()); + final Button b = new Button("Update status", event -> readState()); - final Button c = new Button("Update status with gc", - evenet -> gc()); + final Button c = new Button("Update status with gc", evenet -> gc()); main.addComponent(up); l = new Label("Idle"); diff --git a/uitest/src/main/java/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java b/uitest/src/main/java/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java index 04c64adf95..a656501aba 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java +++ b/uitest/src/main/java/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java @@ -126,19 +126,19 @@ public class TestForTablesInitialColumnWidthLogicRendering return t; } - static String[] testString = { "Jacob", "Michael", "Joshua", - "Matthew", "Ethan", "Andrew", "Daniel", "Anthony", "Christopher", - "Joseph", "William", "Alexander", "Ryan", "David", "Nicholas", - "Tyler", "James", "John", "Jonathan", "Nathan", "Samuel", - "Christian", "Noah", "Dylan", "Benjamin", "Logan", "Brandon", - "Gabriel", "Zachary", "Jose", "Elijah", "Angel", "Kevin", "Jack", - "Caleb", "Justin", "Austin", "Evan", "Robert", "Thomas", "Luke", - "Mason", "Aidan", "Jackson", "Isaiah", "Jordan", "Gavin", "Connor", - "Aiden", "Isaac", "Jason", "Cameron", "Hunter", "Jayden", "Juan", - "Charles", "Aaron", "Lucas", "Luis", "Owen", "Landon", "Diego", - "Brian", "Adam", "Adrian", "Kyle", "Eric", "Ian", "Nathaniel", - "Carlos", "Alex", "Bryan", "Jesus", "Julian", "Sean", "Carter", - "Hayden", "Jeremiah", "Cole", "Brayden", "Wyatt", "Chase", "Steven", + static String[] testString = { "Jacob", "Michael", "Joshua", "Matthew", + "Ethan", "Andrew", "Daniel", "Anthony", "Christopher", "Joseph", + "William", "Alexander", "Ryan", "David", "Nicholas", "Tyler", + "James", "John", "Jonathan", "Nathan", "Samuel", "Christian", + "Noah", "Dylan", "Benjamin", "Logan", "Brandon", "Gabriel", + "Zachary", "Jose", "Elijah", "Angel", "Kevin", "Jack", "Caleb", + "Justin", "Austin", "Evan", "Robert", "Thomas", "Luke", "Mason", + "Aidan", "Jackson", "Isaiah", "Jordan", "Gavin", "Connor", "Aiden", + "Isaac", "Jason", "Cameron", "Hunter", "Jayden", "Juan", "Charles", + "Aaron", "Lucas", "Luis", "Owen", "Landon", "Diego", "Brian", + "Adam", "Adrian", "Kyle", "Eric", "Ian", "Nathaniel", "Carlos", + "Alex", "Bryan", "Jesus", "Julian", "Sean", "Carter", "Hayden", + "Jeremiah", "Cole", "Brayden", "Wyatt", "Chase", "Steven", "Timothy", "Dominic", "Sebastian", "Xavier", "Jaden", "Jesse", "Devin", "Seth", "Antonio", "Richard", "Miguel", "Colin", "Cody", "Alejandro", "Caden", "Blake", "Carson" }; diff --git a/uitest/src/main/java/com/vaadin/tests/TestForTrees.java b/uitest/src/main/java/com/vaadin/tests/TestForTrees.java index 6ee40e5808..84f5caf464 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestForTrees.java +++ b/uitest/src/main/java/com/vaadin/tests/TestForTrees.java @@ -19,12 +19,11 @@ import com.vaadin.v7.ui.Tree; */ public class TestForTrees extends CustomComponent implements Handler { - private static final String[] firstnames = { "John", "Mary", - "Joe", "Sarah", "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" }; + private static final String[] firstnames = { "John", "Mary", "Joe", "Sarah", + "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" }; - private static final String[] lastnames = { "Torvalds", - "Smith", "Jones", "Beck", "Sheridan", "Picard", "Hill", "Fielding", - "Einstein" }; + private static final String[] lastnames = { "Torvalds", "Smith", "Jones", + "Beck", "Sheridan", "Picard", "Hill", "Fielding", "Einstein" }; private final VerticalLayout main = new VerticalLayout(); diff --git a/uitest/src/main/java/com/vaadin/tests/TestForWindowing.java b/uitest/src/main/java/com/vaadin/tests/TestForWindowing.java index 8876e41db9..bbc350377e 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestForWindowing.java +++ b/uitest/src/main/java/com/vaadin/tests/TestForWindowing.java @@ -26,54 +26,52 @@ public class TestForWindowing extends CustomComponent { final CheckBox asModal = new CheckBox("As modal"); main.addComponent(asModal); - final Button create = new Button("Create a new window", - event -> { - VerticalLayout layout = new VerticalLayout(); - layout.setMargin(true); - Window w = new Window("Testing Window", layout); - - if (asModal.getValue().booleanValue()) { - w.setModal(true); - } - - AbstractSelect s1 = new OptionGroup(); - s1.setCaption("1. Select output format"); - s1.addItem("Excel sheet"); - s1.addItem("CSV plain text"); - s1.setValue("Excel sheet"); - s1.setImmediate(true); - - s2 = new Select(); - s2.addItem("Separate by comma (,)"); - s2.addItem("Separate by colon (:)"); - s2.addItem("Separate by semicolon (;)"); + final Button create = new Button("Create a new window", event -> { + VerticalLayout layout = new VerticalLayout(); + layout.setMargin(true); + Window w = new Window("Testing Window", layout); + + if (asModal.getValue().booleanValue()) { + w.setModal(true); + } + + AbstractSelect s1 = new OptionGroup(); + s1.setCaption("1. Select output format"); + s1.addItem("Excel sheet"); + s1.addItem("CSV plain text"); + s1.setValue("Excel sheet"); + s1.setImmediate(true); + + s2 = new Select(); + s2.addItem("Separate by comma (,)"); + s2.addItem("Separate by colon (:)"); + s2.addItem("Separate by semicolon (;)"); + s2.setEnabled(false); + + s1.addValueChangeListener(valueChangeEvent -> { + String v = (String) valueChangeEvent.getProperty().getValue(); + if (v.equals("CSV plain text")) { + s2.setEnabled(true); + } else { s2.setEnabled(false); + } + }); - s1.addValueChangeListener(valueChangeEvent -> { - String v = (String) valueChangeEvent.getProperty() - .getValue(); - if (v.equals("CSV plain text")) { - s2.setEnabled(true); - } else { - s2.setEnabled(false); - } - }); - - layout.addComponent(s1); - layout.addComponent(s2); - - Slider s = new Slider(); - s.setCaption("Volume"); - s.setMax(13); - s.setMin(12); - s.setResolution(2); - // s.setOrientation(Slider.ORIENTATION_VERTICAL); - // s.setArrows(false); - - layout.addComponent(s); - - UI.getCurrent().addWindow(w); - }); + layout.addComponent(s1); + layout.addComponent(s2); + + Slider s = new Slider(); + s.setCaption("Volume"); + s.setMax(13); + s.setMin(12); + s.setResolution(2); + // s.setOrientation(Slider.ORIENTATION_VERTICAL); + // s.setArrows(false); + + layout.addComponent(s); + + UI.getCurrent().addWindow(w); + }); main.addComponent(create); diff --git a/uitest/src/main/java/com/vaadin/tests/UsingObjectsInSelect.java b/uitest/src/main/java/com/vaadin/tests/UsingObjectsInSelect.java index 2e6996b79f..54664c04d0 100644 --- a/uitest/src/main/java/com/vaadin/tests/UsingObjectsInSelect.java +++ b/uitest/src/main/java/com/vaadin/tests/UsingObjectsInSelect.java @@ -48,10 +48,9 @@ public class UsingObjectsInSelect extends com.vaadin.server.LegacyApplication } public void createExampleTasks() { - final String[] assignedTo = { "John", "Mary", "Joe", - "Sarah", "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" }; - final String[] type = { "Enhancement", "Bugfix", "Testing", - "Task" }; + final String[] assignedTo = { "John", "Mary", "Joe", "Sarah", "Jeff", + "Jane", "Peter", "Marc", "Josie", "Linus" }; + final String[] type = { "Enhancement", "Bugfix", "Testing", "Task" }; for (int j = 0; j < 100; j++) { final Task task = new Task( type[(int) (random.nextDouble() * (type.length - 1))], diff --git a/uitest/src/main/java/com/vaadin/tests/actions/ActionsOnInvisibleComponents.java b/uitest/src/main/java/com/vaadin/tests/actions/ActionsOnInvisibleComponents.java index a98abd0927..8129a24e18 100644 --- a/uitest/src/main/java/com/vaadin/tests/actions/ActionsOnInvisibleComponents.java +++ b/uitest/src/main/java/com/vaadin/tests/actions/ActionsOnInvisibleComponents.java @@ -18,27 +18,24 @@ public class ActionsOnInvisibleComponents extends AbstractTestUIWithLog { Button invisibleButton = new Button("Invisible button with shortcut"); invisibleButton.setClickShortcut(KeyCode.A); - invisibleButton - .addClickListener( - event -> log("Click event for invisible button")); + invisibleButton.addClickListener( + event -> log("Click event for invisible button")); invisibleButton.setVisible(false); addComponent(invisibleButton); Button disabledButton = new Button("Disabled button with shortcut"); disabledButton.setClickShortcut(KeyCode.B); - disabledButton - .addClickListener( - event -> log("Click event for disabled button")); + disabledButton.addClickListener( + event -> log("Click event for disabled button")); disabledButton.setEnabled(false); addComponent(disabledButton); Button enabledButton = new Button("Enabled button with shortcut"); enabledButton.setClickShortcut(KeyCode.C); - enabledButton - .addClickListener( - event -> log("Click event for enabled button")); + enabledButton.addClickListener( + event -> log("Click event for enabled button")); addComponent(enabledButton); } diff --git a/uitest/src/main/java/com/vaadin/tests/application/ApplicationCloseTest.java b/uitest/src/main/java/com/vaadin/tests/application/ApplicationCloseTest.java index d95b2c0e96..7e7f348540 100644 --- a/uitest/src/main/java/com/vaadin/tests/application/ApplicationCloseTest.java +++ b/uitest/src/main/java/com/vaadin/tests/application/ApplicationCloseTest.java @@ -40,11 +40,10 @@ public class ApplicationCloseTest extends TestBase { memoryConsumer = sb.toString(); long totalUsage = Runtime.getRuntime().totalMemory(); String totalUsageString = totalUsage / 1000 / 1000 + "MiB"; - Label memoryUsage = new Label( - "Using about " + memoryConsumer.length() / 1000 / 1000 - + "MiB memory for this application.<br/>Total memory usage reported as " - + totalUsageString + "<br/>", - ContentMode.HTML); + Label memoryUsage = new Label("Using about " + + memoryConsumer.length() / 1000 / 1000 + + "MiB memory for this application.<br/>Total memory usage reported as " + + totalUsageString + "<br/>", ContentMode.HTML); addComponent(thisApp); addComponent(memoryUsage); diff --git a/uitest/src/main/java/com/vaadin/tests/application/CommErrorEmulatorUI.java b/uitest/src/main/java/com/vaadin/tests/application/CommErrorEmulatorUI.java index 34c53ec3ed..c66a69cda9 100644 --- a/uitest/src/main/java/com/vaadin/tests/application/CommErrorEmulatorUI.java +++ b/uitest/src/main/java/com/vaadin/tests/application/CommErrorEmulatorUI.java @@ -94,10 +94,9 @@ public class CommErrorEmulatorUI extends AbstractTestUIWithLog { reconnectDialogMessage.setWidth("50em"); reconnectDialogMessage .setValue(getReconnectDialogConfiguration().getDialogText()); - reconnectDialogMessage - .addValueChangeListener(event -> - getReconnectDialogConfiguration().setDialogText( - reconnectDialogMessage.getValue())); + reconnectDialogMessage.addValueChangeListener( + event -> getReconnectDialogConfiguration() + .setDialogText(reconnectDialogMessage.getValue())); final TextField reconnectDialogGaveUpMessage = new TextField( "Reconnect gave up message"); @@ -105,42 +104,37 @@ public class CommErrorEmulatorUI extends AbstractTestUIWithLog { reconnectDialogGaveUpMessage.setValue( getReconnectDialogConfiguration().getDialogTextGaveUp()); - reconnectDialogGaveUpMessage - .addValueChangeListener(event -> - getReconnectDialogConfiguration().setDialogTextGaveUp( - reconnectDialogGaveUpMessage.getValue())); + reconnectDialogGaveUpMessage.addValueChangeListener( + event -> getReconnectDialogConfiguration().setDialogTextGaveUp( + reconnectDialogGaveUpMessage.getValue())); final TextField reconnectDialogReconnectAttempts = new TextField( "Reconnect attempts"); reconnectDialogReconnectAttempts.setConverter(Integer.class); reconnectDialogReconnectAttempts.setConvertedValue( getReconnectDialogConfiguration().getReconnectAttempts()); - reconnectDialogReconnectAttempts - .addValueChangeListener(event -> - getReconnectDialogConfiguration().setReconnectAttempts( - (Integer) reconnectDialogReconnectAttempts - .getConvertedValue())); + reconnectDialogReconnectAttempts.addValueChangeListener( + event -> getReconnectDialogConfiguration().setReconnectAttempts( + (Integer) reconnectDialogReconnectAttempts + .getConvertedValue())); final TextField reconnectDialogReconnectInterval = new TextField( "Reconnect interval (ms)"); reconnectDialogReconnectInterval.setConverter(Integer.class); reconnectDialogReconnectInterval.setConvertedValue( getReconnectDialogConfiguration().getReconnectInterval()); - reconnectDialogReconnectInterval - .addValueChangeListener(event -> - getReconnectDialogConfiguration().setReconnectInterval( - (Integer) reconnectDialogReconnectInterval - .getConvertedValue())); + reconnectDialogReconnectInterval.addValueChangeListener( + event -> getReconnectDialogConfiguration().setReconnectInterval( + (Integer) reconnectDialogReconnectInterval + .getConvertedValue())); final TextField reconnectDialogGracePeriod = new TextField( "Reconnect dialog grace period (ms)"); reconnectDialogGracePeriod.setConverter(Integer.class); reconnectDialogGracePeriod.setConvertedValue( getReconnectDialogConfiguration().getDialogGracePeriod()); - reconnectDialogGracePeriod - .addValueChangeListener( - event -> getReconnectDialogConfiguration() - .setDialogGracePeriod( - (Integer) reconnectDialogGracePeriod - .getConvertedValue())); + reconnectDialogGracePeriod.addValueChangeListener( + event -> getReconnectDialogConfiguration().setDialogGracePeriod( + (Integer) reconnectDialogGracePeriod + .getConvertedValue())); final CheckBox reconnectDialogModal = new CheckBox( "Reconnect dialog modality"); diff --git a/uitest/src/main/java/com/vaadin/tests/application/ConfirmBrowserTabClose.java b/uitest/src/main/java/com/vaadin/tests/application/ConfirmBrowserTabClose.java index e0144cf7cc..e7ae9647f9 100644 --- a/uitest/src/main/java/com/vaadin/tests/application/ConfirmBrowserTabClose.java +++ b/uitest/src/main/java/com/vaadin/tests/application/ConfirmBrowserTabClose.java @@ -17,10 +17,9 @@ public class ConfirmBrowserTabClose extends AbstractTestUIWithLog { // There should be no error Button b = new Button("Say hello", event -> log("Hello")); addComponent(b); - JavaScript - .eval("window.addEventListener('beforeunload', function (e) {" - + "var confirmationMessage = 'Please stay!';" - + "e.returnValue = confirmationMessage;" - + "return confirmationMessage;" + "});"); + JavaScript.eval("window.addEventListener('beforeunload', function (e) {" + + "var confirmationMessage = 'Please stay!';" + + "e.returnValue = confirmationMessage;" + + "return confirmationMessage;" + "});"); } } diff --git a/uitest/src/main/java/com/vaadin/tests/application/CriticalNotifications.java b/uitest/src/main/java/com/vaadin/tests/application/CriticalNotifications.java index 9bf3563144..ff103e64a1 100644 --- a/uitest/src/main/java/com/vaadin/tests/application/CriticalNotifications.java +++ b/uitest/src/main/java/com/vaadin/tests/application/CriticalNotifications.java @@ -26,31 +26,31 @@ public class CriticalNotifications extends AbstractReindeerTestUI { Button sessionExpired = new Button("Session expired"); addComponent(sessionExpired); - sessionExpired.addClickListener(event -> - showCriticalNotification(systemMessages.getSessionExpiredCaption(), + sessionExpired.addClickListener(event -> showCriticalNotification( + systemMessages.getSessionExpiredCaption(), systemMessages.getSessionExpiredMessage(), getDetailsMessage(), systemMessages.getSessionExpiredURL())); Button authenticationError = new Button("Authentication error"); addComponent(authenticationError); - authenticationError.addClickListener(event -> - showCriticalNotification(systemMessages.getAuthenticationErrorCaption(), + authenticationError.addClickListener(event -> showCriticalNotification( + systemMessages.getAuthenticationErrorCaption(), systemMessages.getAuthenticationErrorMessage(), getDetailsMessage(), systemMessages.getAuthenticationErrorURL())); Button communicationError = new Button("Communication error"); addComponent(communicationError); - communicationError.addClickListener(event -> - showCriticalNotification(systemMessages.getCommunicationErrorCaption(), + communicationError.addClickListener(event -> showCriticalNotification( + systemMessages.getCommunicationErrorCaption(), systemMessages.getCommunicationErrorMessage(), getDetailsMessage(), systemMessages.getCommunicationErrorURL())); Button internalError = new Button("Internal error"); addComponent(internalError); - internalError.addClickListener(event -> - showCriticalNotification(systemMessages.getInternalErrorCaption(), + internalError.addClickListener(event -> showCriticalNotification( + systemMessages.getInternalErrorCaption(), systemMessages.getInternalErrorMessage(), getDetailsMessage(), systemMessages.getInternalErrorURL())); @@ -63,9 +63,8 @@ public class CriticalNotifications extends AbstractReindeerTestUI { Button custom = new Button("Custom"); addComponent(custom); custom.addClickListener( - event -> - showCriticalNotification("Custom caption", "Custom message", - "Custom details", "custom url")); + event -> showCriticalNotification("Custom caption", + "Custom message", "Custom details", "custom url")); } protected String getDetailsMessage() { diff --git a/uitest/src/main/java/com/vaadin/tests/application/DetachOldUIOnReload.java b/uitest/src/main/java/com/vaadin/tests/application/DetachOldUIOnReload.java index db21e06f85..c32808014e 100644 --- a/uitest/src/main/java/com/vaadin/tests/application/DetachOldUIOnReload.java +++ b/uitest/src/main/java/com/vaadin/tests/application/DetachOldUIOnReload.java @@ -16,12 +16,11 @@ public class DetachOldUIOnReload extends AbstractTestUIWithLog { protected void setup(VaadinRequest request) { addComponent(new Label("This is UI " + getUIId())); addComponent(new Button("Reload page", event -> getPage().reload())); - addComponent(new Button("Read log messages from session", - event -> { - for (String message : getSessionMessages(false)) { - log(message); - } - })); + addComponent(new Button("Read log messages from session", event -> { + for (String message : getSessionMessages(false)) { + log(message); + } + })); } private List<String> getSessionMessages(boolean storeIfNeeded) { diff --git a/uitest/src/main/java/com/vaadin/tests/application/MissingHierarchyDetection.java b/uitest/src/main/java/com/vaadin/tests/application/MissingHierarchyDetection.java index 0fe52b01e1..9cd8cc415f 100644 --- a/uitest/src/main/java/com/vaadin/tests/application/MissingHierarchyDetection.java +++ b/uitest/src/main/java/com/vaadin/tests/application/MissingHierarchyDetection.java @@ -36,8 +36,7 @@ public class MissingHierarchyDetection extends AbstractReindeerTestUIWithLog { addComponent(brokenLayout); addComponent(normalLayout); addComponent(new Button("Toggle properly", event -> toggle(true))); - addComponent( - new Button("Toggle improperly", event -> toggle(false))); + addComponent(new Button("Toggle improperly", event -> toggle(false))); } private void toggle(boolean properly) { diff --git a/uitest/src/main/java/com/vaadin/tests/application/TerminalErrorNotification.java b/uitest/src/main/java/com/vaadin/tests/application/TerminalErrorNotification.java index 34818eeda0..3589ef42b2 100644 --- a/uitest/src/main/java/com/vaadin/tests/application/TerminalErrorNotification.java +++ b/uitest/src/main/java/com/vaadin/tests/application/TerminalErrorNotification.java @@ -9,10 +9,9 @@ public class TerminalErrorNotification extends TestBase { @Override protected void setup() { - Button button = new Button("Throw exception", - event -> { - throw new RuntimeException("You asked for it"); - }); + Button button = new Button("Throw exception", event -> { + throw new RuntimeException("You asked for it"); + }); addComponent(button); } diff --git a/uitest/src/main/java/com/vaadin/tests/application/TimingInfoReported.java b/uitest/src/main/java/com/vaadin/tests/application/TimingInfoReported.java index 766ea579e7..9ca5ddd809 100644 --- a/uitest/src/main/java/com/vaadin/tests/application/TimingInfoReported.java +++ b/uitest/src/main/java/com/vaadin/tests/application/TimingInfoReported.java @@ -14,26 +14,25 @@ public class TimingInfoReported extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { - getPage().getJavaScript().addFunction("report", - arguments -> { - log("Got: " + arguments.toJson()); - JsonArray values = arguments.getArray(0); + getPage().getJavaScript().addFunction("report", arguments -> { + log("Got: " + arguments.toJson()); + JsonArray values = arguments.getArray(0); - if (values.length() != 5) { - log("ERROR: expected 5 values, got " + values.length()); - return; - } + if (values.length() != 5) { + log("ERROR: expected 5 values, got " + values.length()); + return; + } - for (int i = 0; i < values.length(); i++) { - if (i < 0 || i > 10000) { - log("ERROR: expected value " + i - + " to be between 0 and 10000, was " - + values.getNumber(i)); - return; - } - } - log("Timings ok"); - }); + for (int i = 0; i < values.length(); i++) { + if (i < 0 || i > 10000) { + log("ERROR: expected value " + i + + " to be between 0 and 10000, was " + + values.getNumber(i)); + return; + } + } + log("Timings ok"); + }); getPage().getJavaScript().execute(reportTimings); Button b = new Button("test request", event -> getPage().getJavaScript().execute(reportTimings)); diff --git a/uitest/src/main/java/com/vaadin/tests/application/VaadinSessionAttribute.java b/uitest/src/main/java/com/vaadin/tests/application/VaadinSessionAttribute.java index 3258eda113..1f97d33153 100644 --- a/uitest/src/main/java/com/vaadin/tests/application/VaadinSessionAttribute.java +++ b/uitest/src/main/java/com/vaadin/tests/application/VaadinSessionAttribute.java @@ -14,14 +14,13 @@ public class VaadinSessionAttribute extends AbstractReindeerTestUI { getSession().setAttribute(ATTR_NAME, Integer.valueOf(42)); getSession().setAttribute(Integer.class, Integer.valueOf(42 * 2)); - addComponent( - new Button("Show attribute values", event -> { - Notification notification = new Notification( - getSession().getAttribute(ATTR_NAME) + " & " - + getSession().getAttribute(Integer.class)); - notification.setDelayMsec(Notification.DELAY_FOREVER); - notification.show(getPage()); - })); + addComponent(new Button("Show attribute values", event -> { + Notification notification = new Notification( + getSession().getAttribute(ATTR_NAME) + " & " + + getSession().getAttribute(Integer.class)); + notification.setDelayMsec(Notification.DELAY_FOREVER); + notification.show(getPage()); + })); } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/application/calculator/Calc.java b/uitest/src/main/java/com/vaadin/tests/application/calculator/Calc.java index be6f51d465..153022ec5a 100644 --- a/uitest/src/main/java/com/vaadin/tests/application/calculator/Calc.java +++ b/uitest/src/main/java/com/vaadin/tests/application/calculator/Calc.java @@ -195,8 +195,8 @@ public class Calc extends AbstractReindeerTestUI { // The operations for the calculator in the order they appear on the // screen (left to right, top to bottom) - String[] operations = { "7", "8", "9", "/", "4", "5", "6", - "*", "1", "2", "3", "-", "0", "=", "C", "+" }; + String[] operations = { "7", "8", "9", "/", "4", "5", "6", "*", "1", + "2", "3", "-", "0", "=", "C", "+" }; for (String caption : operations) { diff --git a/uitest/src/main/java/com/vaadin/tests/applicationcontext/CloseSession.java b/uitest/src/main/java/com/vaadin/tests/applicationcontext/CloseSession.java index aae16bf043..f83ed52db4 100644 --- a/uitest/src/main/java/com/vaadin/tests/applicationcontext/CloseSession.java +++ b/uitest/src/main/java/com/vaadin/tests/applicationcontext/CloseSession.java @@ -49,15 +49,13 @@ public class CloseSession extends AbstractReindeerTestUI { + OLD_SESSION_ID_PARAM + "=" + sessionId; addComponent(log); - addComponent( - new Button("Close VaadinServiceSession and redirect elsewhere", - event -> { - // Assuming Vaadin is deployed to the root - // context - getPage().setLocation( - "/statictestfiles/static.html"); - getSession().close(); - })); + addComponent(new Button( + "Close VaadinServiceSession and redirect elsewhere", event -> { + // Assuming Vaadin is deployed to the root + // context + getPage().setLocation("/statictestfiles/static.html"); + getSession().close(); + })); addComponent(new Button("Close VaadinServiceSession and reopen page", event -> { getPage().setLocation(reopenUrl); @@ -67,8 +65,8 @@ public class CloseSession extends AbstractReindeerTestUI { event -> getSession().close())); addComponent(new Button("Just close HttpSession", event -> getSession().getSession().invalidate())); - addComponent(new Button("Invalidate HttpSession and reopen page", - event -> { + addComponent( + new Button("Invalidate HttpSession and reopen page", event -> { VaadinService.getCurrentRequest().getWrappedSession() .invalidate(); getPage().setLocation(reopenUrl); diff --git a/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentContainerTest.java b/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentContainerTest.java index b34fcad46d..5a35da23b6 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentContainerTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentContainerTest.java @@ -313,8 +313,8 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent // addCommands.put("HorizontalLayout", addHorizontalLayoutCommand); // addCommands.put("VerticalLayout", addVerticalLayoutCommand); - ComponentSize[] sizes = { - new ComponentSize(null, null), new ComponentSize("200px", null), + ComponentSize[] sizes = { new ComponentSize(null, null), + new ComponentSize("200px", null), new ComponentSize("100%", null), new ComponentSize(null, "200px"), new ComponentSize(null, "100%"), diff --git a/uitest/src/main/java/com/vaadin/tests/components/AbstractTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/AbstractTestUI.java index aa0a92c364..7b10c1a7f3 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/AbstractTestUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/AbstractTestUI.java @@ -99,11 +99,10 @@ public abstract class AbstractTestUI extends UI { long currentWidgetsetTimestamp = currentWidgetsetFolder.lastModified(); int halfHour = 30 * 60 * 1000; if (currentWidgetsetTimestamp + halfHour < newestWidgetsetTimestamp) { - Notification.show( - "The currently used widgetset (" + usedWidgetset - + ") was compiled long before the most recently compiled one (" - + newestWidgetsetName - + "). Are you sure you have compiled the right widgetset?", + Notification.show("The currently used widgetset (" + usedWidgetset + + ") was compiled long before the most recently compiled one (" + + newestWidgetsetName + + "). Are you sure you have compiled the right widgetset?", Type.WARNING_MESSAGE); } } diff --git a/uitest/src/main/java/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java b/uitest/src/main/java/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java index 9f294cba3d..edb49277e6 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java +++ b/uitest/src/main/java/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java @@ -54,23 +54,22 @@ public class CustomComponentwithUndefinedSize extends TestBase { widePanel.setWidth("2000px"); widePanel.setHeight("200px"); layout.addComponent(widePanel); - Button button = new Button("Change panel size", - event -> { - switch (step++ % 4) { - case 0: - widePanel.setWidth("200px"); - break; - case 1: - widePanel.setHeight("2000px"); - break; - case 2: - widePanel.setWidth("2000px"); - break; - case 3: - widePanel.setHeight("200px"); - break; - } - }); + Button button = new Button("Change panel size", event -> { + switch (step++ % 4) { + case 0: + widePanel.setWidth("200px"); + break; + case 1: + widePanel.setHeight("2000px"); + break; + case 2: + widePanel.setWidth("2000px"); + break; + case 3: + widePanel.setHeight("200px"); + break; + } + }); panelLayout.addComponent(button); layout.setSizeUndefined(); return layout; diff --git a/uitest/src/main/java/com/vaadin/tests/components/FileDownloaderUI.java b/uitest/src/main/java/com/vaadin/tests/components/FileDownloaderUI.java index 5dafd89192..c6f9752a61 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/FileDownloaderUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/FileDownloaderUI.java @@ -87,19 +87,17 @@ public class FileDownloaderUI extends AbstractTestUIWithLog { fd.extend(downloadUtf8File); addComponent(downloadUtf8File); - addComponent( - new Button("Remove first download button", event -> { - Layout parent = (Layout) firstDownloadComponent.getParent(); - parent.removeComponent(firstDownloadComponent); + addComponent(new Button("Remove first download button", event -> { + Layout parent = (Layout) firstDownloadComponent.getParent(); + parent.removeComponent(firstDownloadComponent); + })); + addComponent(new Button( + "Detach FileDownloader from first download button", event -> { + FileDownloader e = (FileDownloader) firstDownloadComponent + .getExtensions().iterator().next(); + e.remove(); + log("FileDownload detached"); })); - addComponent( - new Button("Detach FileDownloader from first download button", - event -> { - FileDownloader e = (FileDownloader) firstDownloadComponent - .getExtensions().iterator().next(); - e.remove(); - log("FileDownload detached"); - })); } public void addComponents(String caption, ConnectorResource resource, diff --git a/uitest/src/main/java/com/vaadin/tests/components/MenuBarDownloadBrowserOpenerUI.java b/uitest/src/main/java/com/vaadin/tests/components/MenuBarDownloadBrowserOpenerUI.java index 27ab5d2347..78b3393491 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/MenuBarDownloadBrowserOpenerUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/MenuBarDownloadBrowserOpenerUI.java @@ -37,7 +37,8 @@ public class MenuBarDownloadBrowserOpenerUI extends AbstractTestUIWithLog { MenuItem open = menuBar.addItem("Open"); MenuItem openNoLog = open.addItem("Open without logging..."); - MenuItem openLog = open.addItem("Open with logging...", item -> log("Open triggered")); + MenuItem openLog = open.addItem("Open with logging...", + item -> log("Open triggered")); BrowserWindowOpener bwo = new BrowserWindowOpener(openResource); bwo.extend(openNoLog); diff --git a/uitest/src/main/java/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutPrimaryStylename.java b/uitest/src/main/java/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutPrimaryStylename.java index 1ff293e937..23a138bcf3 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutPrimaryStylename.java +++ b/uitest/src/main/java/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutPrimaryStylename.java @@ -22,9 +22,8 @@ public class AbsoluteLayoutPrimaryStylename extends TestBase { addComponent(layout); - addComponent(new Button("Change primary stylename", - event -> layout - .setPrimaryStyleName("my-second-absolute-layout"))); + addComponent(new Button("Change primary stylename", event -> layout + .setPrimaryStyleName("my-second-absolute-layout"))); } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutResizeComponents.java b/uitest/src/main/java/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutResizeComponents.java index 215faeab7f..039533119c 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutResizeComponents.java +++ b/uitest/src/main/java/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutResizeComponents.java @@ -69,7 +69,8 @@ public class AbsoluteLayoutResizeComponents extends AbstractReindeerTestUI { /** * Create size change button for component * - * @param component Component to controll with button + * @param component + * Component to controll with button * @return Created Expand Button */ private Button expandButton(Component component) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractcomponent/PrimaryStyle.java b/uitest/src/main/java/com/vaadin/tests/components/abstractcomponent/PrimaryStyle.java index afe5bf1499..e64f2b24ab 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractcomponent/PrimaryStyle.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractcomponent/PrimaryStyle.java @@ -26,17 +26,16 @@ public class PrimaryStyle extends AbstractReindeerTestUI { tf.setStyleName("state"); addComponent(tf); - Button updateButton = new Button("Update styles", - event -> { - label.setPrimaryStyleName("updated"); - label.setStyleName("correctly"); + Button updateButton = new Button("Update styles", event -> { + label.setPrimaryStyleName("updated"); + label.setStyleName("correctly"); - button.setPrimaryStyleName("updated"); - button.setStyleName("correctly"); + button.setPrimaryStyleName("updated"); + button.setStyleName("correctly"); - tf.setPrimaryStyleName("updated"); - tf.setStyleName("correctly"); - }); + tf.setPrimaryStyleName("updated"); + tf.setStyleName("correctly"); + }); updateButton.setId("update-button"); addComponent(updateButton); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractcomponent/TooltipStyling.java b/uitest/src/main/java/com/vaadin/tests/components/abstractcomponent/TooltipStyling.java index 3160019e85..f29b8407cb 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractcomponent/TooltipStyling.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractcomponent/TooltipStyling.java @@ -18,9 +18,8 @@ public class TooltipStyling extends AbstractTestUI { addComponent(defaultLabel); Label htmlLabel = new Label("I have a tooltip with HTML contents"); - htmlLabel.setDescription( - "This is regular text in a tooltip." - + "<pre>This is a pre tag inside a HTML tooltip. It should use a monospace font and by default not break to multiple lines.</pre>", + htmlLabel.setDescription("This is regular text in a tooltip." + + "<pre>This is a pre tag inside a HTML tooltip. It should use a monospace font and by default not break to multiple lines.</pre>", ContentMode.HTML); htmlLabel.setId("html"); addComponent(htmlLabel); diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/TextFieldConversions.java b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/TextFieldConversions.java index 94fd1b98e5..2341b8ca26 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/TextFieldConversions.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/TextFieldConversions.java @@ -25,9 +25,8 @@ public class TextFieldConversions extends AbstractComponentDataBindingTest { dataType.addItem(Date.class); dataType.addItem(String.class); - dataType.addValueChangeListener(event -> - tf.setPropertyDataSource(new ObjectProperty<>(o, - (Class<Object>) dataType.getValue()))); + dataType.addValueChangeListener(event -> tf.setPropertyDataSource( + new ObjectProperty<>(o, (Class<Object>) dataType.getValue()))); addComponent(dataType); tf = new TextField("TextField"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractSingleSelectTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractSingleSelectTestUI.java index 69be159dae..8a536bd483 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractSingleSelectTestUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractSingleSelectTestUI.java @@ -16,8 +16,8 @@ public abstract class AbstractSingleSelectTestUI<T extends AbstractSingleSelect< } protected void createListenerMenu() { - createListenerAction("Selection listener", "Listeners", c -> c - .addSelectionListener( + createListenerAction("Selection listener", "Listeners", + c -> c.addSelectionListener( event -> log("Selected: " + event.getValue()))); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractsingleselect/AbstractSingleSelection.java b/uitest/src/main/java/com/vaadin/tests/components/abstractsingleselect/AbstractSingleSelection.java index d3317c7485..fc10d13b53 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractsingleselect/AbstractSingleSelection.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractsingleselect/AbstractSingleSelection.java @@ -31,9 +31,8 @@ public class AbstractSingleSelection extends AbstractTestUI { addComponent(componentSelect); addComponent(component); // This will be replaced in createComponent - addComponent( - new Button("Deselect", - event -> component.setSelectedItem(null))); + addComponent(new Button("Deselect", + event -> component.setSelectedItem(null))); addComponent(new Button("Select Bar", event -> component.setSelectedItem("Bar"))); addComponent(new Button("Refresh", diff --git a/uitest/src/main/java/com/vaadin/tests/components/accordion/AccordionPrimaryStylenames.java b/uitest/src/main/java/com/vaadin/tests/components/accordion/AccordionPrimaryStylenames.java index 43df449a19..d8662a648d 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/accordion/AccordionPrimaryStylenames.java +++ b/uitest/src/main/java/com/vaadin/tests/components/accordion/AccordionPrimaryStylenames.java @@ -15,10 +15,8 @@ public class AccordionPrimaryStylenames extends TestBase { acc.setPrimaryStyleName("my-accordion"); addComponent(acc); - addComponent( - new Button("Set primary stylename", - event -> acc - .setPrimaryStyleName("my-second-accordion"))); + addComponent(new Button("Set primary stylename", + event -> acc.setPrimaryStyleName("my-second-accordion"))); } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/button/ButtonClick.java b/uitest/src/main/java/com/vaadin/tests/components/button/ButtonClick.java index b54bcb8122..465fa1fa21 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/button/ButtonClick.java +++ b/uitest/src/main/java/com/vaadin/tests/components/button/ButtonClick.java @@ -16,12 +16,10 @@ public class ButtonClick extends AbstractReindeerTestUI { protected void setup(VaadinRequest request) { final VerticalLayout rootLayout = new VerticalLayout(); final Label statusLabel = new Label("Test initialized"); - rootLayout.addComponent(new Button("Click here", event -> - statusLabel.setValue(SUCCESS_TEXT))); + rootLayout.addComponent(new Button("Click here", + event -> statusLabel.setValue(SUCCESS_TEXT))); Button visitLocation = new Button("Drag here", - event -> - statusLabel.setValue(WRONG_BUTTON_TEXT) - ); + event -> statusLabel.setValue(WRONG_BUTTON_TEXT)); rootLayout.addComponent(statusLabel); rootLayout.addComponent(visitLocation); rootLayout.setComponentAlignment(visitLocation, Alignment.BOTTOM_RIGHT); diff --git a/uitest/src/main/java/com/vaadin/tests/components/caption/IconsInCaption.java b/uitest/src/main/java/com/vaadin/tests/components/caption/IconsInCaption.java index e25ab542e6..7e9d2252c7 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/caption/IconsInCaption.java +++ b/uitest/src/main/java/com/vaadin/tests/components/caption/IconsInCaption.java @@ -16,16 +16,16 @@ public class IconsInCaption extends TestBase { private static final String TYPE_EMBEDDED = "Embedded"; private static final String TYPE_CAPTION = "In caption"; - private static final String[] icons = { "arrow-down.png", - "arrow-left.png", "arrow-right.png", "arrow-up.png", - "attention.png", "calendar.png", "cancel.png", "document.png", - "document-add.png", "document-delete.png", "document-doc.png", - "document-image.png", "document-pdf.png", "document-ppt.png", - "document-txt.png", "document-web.png", "document-xsl.png", - "email.png", "email-reply.png", "email-send.png", "folder.png", - "folder-add.png", "folder-delete.png", "globe.png", "help.png", - "lock.png", "note.png", "ok.png", "reload.png", "settings.png", - "trash.png", "trash-full.png", "user.png", "users.png" }; + private static final String[] icons = { "arrow-down.png", "arrow-left.png", + "arrow-right.png", "arrow-up.png", "attention.png", "calendar.png", + "cancel.png", "document.png", "document-add.png", + "document-delete.png", "document-doc.png", "document-image.png", + "document-pdf.png", "document-ppt.png", "document-txt.png", + "document-web.png", "document-xsl.png", "email.png", + "email-reply.png", "email-send.png", "folder.png", "folder-add.png", + "folder-delete.png", "globe.png", "help.png", "lock.png", + "note.png", "ok.png", "reload.png", "settings.png", "trash.png", + "trash-full.png", "user.png", "users.png" }; private static final String[] sizes = { "16", "32", "64" }; diff --git a/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckboxContextClick.java b/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckboxContextClick.java index 953e3e9707..9a722df140 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckboxContextClick.java +++ b/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckboxContextClick.java @@ -9,8 +9,7 @@ public class CheckboxContextClick extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { final CheckBox cb = new CheckBox("Right-click me", true); - cb.addContextClickListener( - event -> log("checkbox context clicked")); + cb.addContextClickListener(event -> log("checkbox context clicked")); addComponent(cb); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckboxFocusClick.java b/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckboxFocusClick.java index ee5210ef1e..89a05a0f62 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckboxFocusClick.java +++ b/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckboxFocusClick.java @@ -10,7 +10,8 @@ public class CheckboxFocusClick extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { final CheckBox cb = new CheckBox("Click me", true); - cb.addFocusListener((FieldEvents.FocusListener) event -> log("checkbox focused")); + cb.addFocusListener( + (FieldEvents.FocusListener) event -> log("checkbox focused")); addComponent(cb); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/checkboxgroup/CheckBoxGroupInGridLayout.java b/uitest/src/main/java/com/vaadin/tests/components/checkboxgroup/CheckBoxGroupInGridLayout.java index 7a50255000..ea0c69b9e8 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/checkboxgroup/CheckBoxGroupInGridLayout.java +++ b/uitest/src/main/java/com/vaadin/tests/components/checkboxgroup/CheckBoxGroupInGridLayout.java @@ -12,7 +12,8 @@ public class CheckBoxGroupInGridLayout extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - CheckBoxGroup<String> cbGroup = new CheckBoxGroup<>(null, DataProvider.ofItems("A", "B", "C")); + CheckBoxGroup<String> cbGroup = new CheckBoxGroup<>(null, + DataProvider.ofItems("A", "B", "C")); cbGroup.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL); GridLayout gridLayout = new GridLayout(2, 1); diff --git a/uitest/src/main/java/com/vaadin/tests/components/colorpicker/DefaultCaptionWidth.java b/uitest/src/main/java/com/vaadin/tests/components/colorpicker/DefaultCaptionWidth.java index 8cc70ae949..32e742df30 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/colorpicker/DefaultCaptionWidth.java +++ b/uitest/src/main/java/com/vaadin/tests/components/colorpicker/DefaultCaptionWidth.java @@ -20,19 +20,17 @@ public class DefaultCaptionWidth extends AbstractReindeerTestUI { addComponent(colorPicker); colorPicker.setDefaultCaptionEnabled(true); - Button setWidth = new Button("Set explicit width", - event -> { - colorPicker.setCaption(null); - colorPicker.setWidth("150px"); - }); + Button setWidth = new Button("Set explicit width", event -> { + colorPicker.setCaption(null); + colorPicker.setWidth("150px"); + }); setWidth.addStyleName("set-width"); addComponent(setWidth); - Button setCaption = new Button("Set explicit caption", - event -> { - colorPicker.setCaption("caption"); - colorPicker.setWidthUndefined(); - }); + Button setCaption = new Button("Set explicit caption", event -> { + colorPicker.setCaption("caption"); + colorPicker.setWidthUndefined(); + }); setCaption.addStyleName("set-caption"); addComponent(setCaption); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxHeight.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxHeight.java index ba6956dc22..f2713aac3b 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxHeight.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxHeight.java @@ -15,10 +15,9 @@ public class ComboBoxHeight extends AbstractTestUI { protected void setup(VaadinRequest request) { ComboBox<String> comboBox = new ComboBox<>(); comboBox.setPageLength(0); - comboBox.setItems( - IntStream.range(0, 100) - .mapToObj(i -> "Item number " + String.valueOf(i)) - .collect(Collectors.toList())); + comboBox.setItems(IntStream.range(0, 100) + .mapToObj(i -> "Item number " + String.valueOf(i)) + .collect(Collectors.toList())); addComponent(comboBox); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxOnSmallScreen.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxOnSmallScreen.java index 454310d407..42840f7da3 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxOnSmallScreen.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxOnSmallScreen.java @@ -49,8 +49,9 @@ public class ComboBoxOnSmallScreen extends AbstractReindeerTestUI { Item item = cb.getItem(itemId); item.getItemProperty(PID).setValue(v); int flagIndex = i % 3; - cb.setItemIcon(itemId, new ClassResource(flagIndex == 0 - ? "fi_small.png" : flagIndex == 1 ? "fi.gif" : "se.gif")); + cb.setItemIcon(itemId, + new ClassResource(flagIndex == 0 ? "fi_small.png" + : flagIndex == 1 ? "fi.gif" : "se.gif")); } cb.select(selectId); diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxTextFieldEventOrder.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxTextFieldEventOrder.java index 32b61ee1b1..d10c567274 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxTextFieldEventOrder.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxTextFieldEventOrder.java @@ -15,8 +15,8 @@ public class ComboBoxTextFieldEventOrder extends TestBase { final Select select = new Select("select", Arrays.asList("1", "2", "3", "4")); textField.addValueChangeListener(event -> - // or just select.requestRepaint() - select.addItem(Long.valueOf(select.size() + 1).toString())); + // or just select.requestRepaint() + select.addItem(Long.valueOf(select.size() + 1).toString())); addComponent(textField); addComponent(select); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxVaadinIcons.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxVaadinIcons.java index f43ba264be..a510e41bfc 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxVaadinIcons.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxVaadinIcons.java @@ -11,9 +11,8 @@ import com.vaadin.ui.ComboBox; @Widgetset("com.vaadin.DefaultWidgetSet") public class ComboBoxVaadinIcons extends AbstractTestUI { - public static final VaadinIcons[] icons = { - VaadinIcons.AMBULANCE, VaadinIcons.PAPERPLANE, - VaadinIcons.AIRPLANE }; + public static final VaadinIcons[] icons = { VaadinIcons.AMBULANCE, + VaadinIcons.PAPERPLANE, VaadinIcons.AIRPLANE }; @Override protected void setup(VaadinRequest request) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboPushTiming.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboPushTiming.java index 1f7d5a1644..8b7db61a3b 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboPushTiming.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboPushTiming.java @@ -37,8 +37,7 @@ public class ComboPushTiming extends TestBase { final ObjectProperty<String> log = new ObjectProperty<>(""); cb.addFocusListener(event -> { - log.setValue( - log.getValue() + "<br>" + counter + ": Focus event!"); + log.setValue(log.getValue() + "<br>" + counter + ": Focus event!"); counter++; changeValue(cb); }); diff --git a/uitest/src/main/java/com/vaadin/tests/components/customlayout/CustomLayoutUsingTheme.java b/uitest/src/main/java/com/vaadin/tests/components/customlayout/CustomLayoutUsingTheme.java index 8252084e86..fd798286a1 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/customlayout/CustomLayoutUsingTheme.java +++ b/uitest/src/main/java/com/vaadin/tests/components/customlayout/CustomLayoutUsingTheme.java @@ -28,10 +28,11 @@ public class CustomLayoutUsingTheme extends TestBase implements ClickListener { VerticalLayout menu = new VerticalLayout(); menu.addComponent(new Button("Set body to label", event -> layout .addComponent(new Label(LoremIpsum.get(200)), "body"))); - menu.addComponent(new Button("Set body to huge NativeButton", - event -> layout.addComponent( - new NativeButton("This is it, the body!"), - "body"))); + menu.addComponent( + new Button("Set body to huge NativeButton", + event -> layout.addComponent( + new NativeButton("This is it, the body!"), + "body"))); layout.addComponent(menu, "menu"); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldShortcut.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldShortcut.java index 406e13a5a3..5b9ce64332 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldShortcut.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldShortcut.java @@ -26,9 +26,8 @@ public class DateFieldShortcut extends AbstractTestUI { new ShortcutListener("Enter", KeyCode.ENTER, null) { @Override public void handleAction(Object sender, Object target) { - Notification.show(dateField.getValue() - .format(DateTimeFormatter - .ofPattern(dateFormat))); + Notification.show(dateField.getValue().format( + DateTimeFormatter.ofPattern(dateFormat))); } }); diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldUnparsableDateString.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldUnparsableDateString.java index c6147cda79..b2335922a9 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldUnparsableDateString.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldUnparsableDateString.java @@ -67,11 +67,9 @@ public class DateFieldUnparsableDateString extends AbstractTestUI { case 8: // Long year ddMMyyyy parseableString = StringUtils.leftPad(dateString, 8, "0"); - return Result - .ok(LocalDate.parse(parseableString, - new DateTimeFormatterBuilder() - .appendPattern("ddMMyyyy") - .toFormatter())); + return Result.ok(LocalDate.parse(parseableString, + new DateTimeFormatterBuilder() + .appendPattern("ddMMyyyy").toFormatter())); default: break; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldValidationError.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldValidationError.java index 74a1366ddc..086f01a30d 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldValidationError.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldValidationError.java @@ -20,10 +20,13 @@ public class DateFieldValidationError extends AbstractTestUI { df.setLocale(Locale.US); Binder<Void> binder = new Binder<>(); binder.forField(df) - .withValidator(localDate -> localDate != null && localDate.isAfter(LocalDate.now()), "Invalid date") - .bind(v -> LocalDate.now(), (v, t) -> { - /* NO-OP */ - }); + .withValidator( + localDate -> localDate != null + && localDate.isAfter(LocalDate.now()), + "Invalid date") + .bind(v -> LocalDate.now(), (v, t) -> { + /* NO-OP */ + }); addComponent(df); addComponent(new Button("Validate", event -> Notification .show(binder.validate().isOk() ? "OK" : "Fail"))); diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateTextHandling.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateTextHandling.java index c0e15be7eb..bf547b86a7 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateTextHandling.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateTextHandling.java @@ -19,7 +19,8 @@ import com.vaadin.ui.VerticalLayout; @Widgetset("com.vaadin.DefaultWidgetSet") public class DateTextHandling extends AbstractTestUI { - public static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM).withLocale(Locale.UK); + public static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter + .ofLocalizedDate(FormatStyle.MEDIUM).withLocale(Locale.UK); @Override protected void setup(VaadinRequest request) { @@ -27,7 +28,8 @@ public class DateTextHandling extends AbstractTestUI { DateField dateField = new DateField("Date") { @Override - protected Result<LocalDate> handleUnparsableDateString(String dateString) { + protected Result<LocalDate> handleUnparsableDateString( + String dateString) { if (dateString.equalsIgnoreCase("Y2K")) { return Result.ok(LocalDate.of(2000, 1, 1)); } else { @@ -45,7 +47,9 @@ public class DateTextHandling extends AbstractTestUI { layout.addComponent(errorLabel); Binder<Void> binder = new Binder<>(); - binder.forField(dateField).withStatusLabel(errorLabel).bind(o -> dateField.getValue(), (aVoid, date) -> {}); + binder.forField(dateField).withStatusLabel(errorLabel) + .bind(o -> dateField.getValue(), (aVoid, date) -> { + }); Button buttonValidate = new Button("Validate!"); buttonValidate.addClickListener(event1 -> { @@ -53,7 +57,8 @@ public class DateTextHandling extends AbstractTestUI { if (dateField.getValue() == null) { Notification.show("NULL"); } else { - Notification.show(DATE_TIME_FORMATTER.format(dateField.getValue())); + Notification + .show(DATE_TIME_FORMATTER.format(dateField.getValue())); } }); diff --git a/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropFocusObtain.java b/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropFocusObtain.java index 21a78fc22f..3508c45592 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropFocusObtain.java +++ b/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropFocusObtain.java @@ -27,9 +27,9 @@ public class DragAndDropFocusObtain extends AbstractTestUIWithLog { private FocusListener focusListener = event -> log( "Field '" + event.getComponent().getCaption() + "' focused"); - private ValueChangeListener<String> listener = event -> - log("Value of " + ((AbstractTextField) event.getSource()).getCaption() - + " changed to " + event.getValue()); + private ValueChangeListener<String> listener = event -> log( + "Value of " + ((AbstractTextField) event.getSource()).getCaption() + + " changed to " + event.getValue()); @Override protected void setup(VaadinRequest request) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/embedded/EmbeddedAltText.java b/uitest/src/main/java/com/vaadin/tests/components/embedded/EmbeddedAltText.java index 3c9413813f..d0b184b1cf 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/embedded/EmbeddedAltText.java +++ b/uitest/src/main/java/com/vaadin/tests/components/embedded/EmbeddedAltText.java @@ -35,11 +35,10 @@ public class EmbeddedAltText extends TestBase { player.setParameter("allowFullScreen", "true"); addComponent(player); - Button changeAltTexts = new Button("Change alt texts", - event -> { - e.setAlternateText("New alt text of the image!"); - player.setAlternateText("New alt text of the object!"); - }); + Button changeAltTexts = new Button("Change alt texts", event -> { + e.setAlternateText("New alt text of the image!"); + player.setAlternateText("New alt text of the object!"); + }); addComponent(changeAltTexts); } } diff --git a/uitest/src/main/java/com/vaadin/tests/components/formlayout/FormLayoutCaptionStyles.java b/uitest/src/main/java/com/vaadin/tests/components/formlayout/FormLayoutCaptionStyles.java index a562a5705f..9f9752b7c9 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/formlayout/FormLayoutCaptionStyles.java +++ b/uitest/src/main/java/com/vaadin/tests/components/formlayout/FormLayoutCaptionStyles.java @@ -16,14 +16,13 @@ public class FormLayoutCaptionStyles extends TestBase { final TextField f2 = createTextField("Text field 2", "bold"); fl.addComponent(f1); - fl.addComponent(new Button("Toggle Text field 2 bold style", - event -> { - if ("bold".equals(f2.getStyleName())) { - f2.setStyleName(""); - } else { - f2.setStyleName("bold"); - } - })); + fl.addComponent(new Button("Toggle Text field 2 bold style", event -> { + if ("bold".equals(f2.getStyleName())) { + f2.setStyleName(""); + } else { + f2.setStyleName("bold"); + } + })); fl.addComponent(f2); addComponent(fl); diff --git a/uitest/src/main/java/com/vaadin/tests/components/formlayout/FormLayoutClickListener.java b/uitest/src/main/java/com/vaadin/tests/components/formlayout/FormLayoutClickListener.java index a01da1d710..6a11b5a492 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/formlayout/FormLayoutClickListener.java +++ b/uitest/src/main/java/com/vaadin/tests/components/formlayout/FormLayoutClickListener.java @@ -27,8 +27,9 @@ public class FormLayoutClickListener extends AbstractTestUIWithLog { layout.addLayoutClickListener(event -> { log("Child component: " + (event.getChildComponent() == null ? null : event.getChildComponent().getId())); - log("Clicked component: " + (event.getClickedComponent() == null ? null - : event.getClickedComponent().getId())); + log("Clicked component: " + + (event.getClickedComponent() == null ? null + : event.getClickedComponent().getId())); log("Source component: " + event.getComponent().getId()); }); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridAssistiveCaption.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridAssistiveCaption.java index 3969673bd9..25e3478781 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridAssistiveCaption.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridAssistiveCaption.java @@ -16,7 +16,8 @@ public class GridAssistiveCaption extends AbstractTestUI { addComponent(grid); addComponent(new Button("addAssistiveCaption", event -> { - grid.getColumns().get(0).setAssistiveCaption("Press Enter to sort."); + grid.getColumns().get(0) + .setAssistiveCaption("Press Enter to sort."); })); addComponent(new Button("removeAssistiveCaption", event -> { grid.getColumns().get(0).setAssistiveCaption(null); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridClientMemoryLeak.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridClientMemoryLeak.java index 73296e627e..3626a01404 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridClientMemoryLeak.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridClientMemoryLeak.java @@ -11,8 +11,7 @@ import com.vaadin.ui.VerticalLayout; public class GridClientMemoryLeak extends AbstractTestUI { private static final String INSTRUCTIONS = "This UI is for manually testing that the client side grid does not leak memory. " - + "Steps to take:\n" - + "\t1. Click the newGrid button 1-n times\n" + + "Steps to take:\n" + "\t1. Click the newGrid button 1-n times\n" + "\t2. Capture a JS heap dump in your browser\n" + "\t3. The heap dump should only contain 1 instance of each of the following:\n" + "\t\tGrid, GridKeyDownEvent, GridKeyPressEvent, GridKeyUpEvent, GridClickEvent, GridDoubleClickEvent"; diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsLocation.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsLocation.java index 74e8f44b1f..f463e3ce13 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsLocation.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsLocation.java @@ -62,7 +62,8 @@ public class GridDetailsLocation extends AbstractTestUI { } private void toggle() { - Person itemId = testData.get(Integer.parseInt(numberTextField.getValue())); + Person itemId = testData + .get(Integer.parseInt(numberTextField.getValue())); boolean isVisible = grid.isDetailsVisible(itemId); grid.setDetailsVisible(itemId, !isVisible); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsReattach.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsReattach.java index a5dba81e47..8146edfffe 100755 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsReattach.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsReattach.java @@ -26,8 +26,8 @@ public class GridDetailsReattach extends AbstractTestUI { Button addCaptionToLayoutWithGridButton = new Button( "Add caption to 'layoutWithGrid' layout"); addCaptionToLayoutWithGridButton - .addClickListener(event -> layoutWithGrid - .setCaption("Caption added to 'layoutWithGrid' layout")); + .addClickListener(event -> layoutWithGrid.setCaption( + "Caption added to 'layoutWithGrid' layout")); layoutWithGrid.addComponent(addCaptionToLayoutWithGridButton); verticalMain.addComponent(layoutWithGrid); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragAndDrop.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragAndDrop.java index 8b73f26799..c84fb2e10f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragAndDrop.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragAndDrop.java @@ -99,7 +99,8 @@ public class GridDragAndDrop extends AbstractGridDnD { if (event.getDropTargetRow().isPresent()) { index = items.indexOf(event.getDropTargetRow().get()) + (event.getDropLocation() == DropLocation.BELOW - ? 1 : 0); + ? 1 + : 0); } // Add dragged items to the target Grid @@ -110,11 +111,12 @@ public class GridDragAndDrop extends AbstractGridDnD { + ", dragDataJson=" + event.getDataTransferData("application/json") + ", target=" - + (event.getDropTargetRow().isPresent() ? event - .getDropTargetRow().get().getFirstName() - + " " - + event.getDropTargetRow().get() - .getLastName() + + (event.getDropTargetRow().isPresent() + ? event.getDropTargetRow().get() + .getFirstName() + + " " + + event.getDropTargetRow().get() + .getLastName() : "[BODY]") + ", location=" + event.getDropLocation() + ", mouseEventDetails=" diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridRefreshRow.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridRefreshRow.java index e99372ff1b..b2e2eae195 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridRefreshRow.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridRefreshRow.java @@ -59,13 +59,13 @@ public class GridRefreshRow extends AbstractTestUIWithLog { addComponent(grid); addComponents(new HorizontalLayout(update(0), update(1), update(2))); - Button refresh10 = new Button("Refresh 0-9", - event -> grid - .refreshRows(container.getItemIds(0, 9).toArray())); + Button refresh10 = new Button("Refresh 0-9", event -> grid + .refreshRows(container.getItemIds(0, 9).toArray())); refresh10.setId("refresh10"); - addComponents(new HorizontalLayout(refresh(0), refresh(1), refresh(2), - new Button("Refresh non-existant", - event -> grid.refreshRows("foobar"))), + addComponents( + new HorizontalLayout(refresh(0), refresh(1), refresh(2), + new Button("Refresh non-existant", + event -> grid.refreshRows("foobar"))), refresh10); addComponents(new HorizontalLayout(style(0), style(1), style(2))); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridRowDraggerTwoGrids.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridRowDraggerTwoGrids.java index 8e8015563f..360fca10d4 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridRowDraggerTwoGrids.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridRowDraggerTwoGrids.java @@ -28,8 +28,9 @@ public class GridRowDraggerTwoGrids extends AbstractGridDnD { CheckBox addItemsToEnd = new CheckBox("Add Items To End", false); addItemsToEnd.addValueChangeListener( - event -> gridDragger.setDropIndexCalculator(event.getValue() - ? DropIndexCalculator.alwaysDropToEnd() : null)); + event -> gridDragger.setDropIndexCalculator( + event.getValue() ? DropIndexCalculator.alwaysDropToEnd() + : null)); CheckBox removeItemsFromSource = new CheckBox( "Remove items from source grid", true); removeItemsFromSource.addValueChangeListener(event -> gridDragger diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSidebarPosition.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSidebarPosition.java index 64c6521997..a869a8b559 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSidebarPosition.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSidebarPosition.java @@ -23,10 +23,9 @@ public class GridSidebarPosition extends AbstractTestUI { grid.setId(POPUP_WINDOW_HEIGHT); grid.setWidth("100px"); for (int i = 0; i < 30; i++) { - grid.addColumn(ValueProvider.identity()) - .setCaption( - "This is a really really really really long column name " - + i) + grid.addColumn(ValueProvider.identity()).setCaption( + "This is a really really really really long column name " + + i) .setHidable(true); } hl.addComponent(grid); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSortIndicator.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSortIndicator.java index eb8dfa73b5..ecdf9de74a 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSortIndicator.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSortIndicator.java @@ -22,7 +22,7 @@ public class GridSortIndicator extends AbstractTestUI { addComponent(new Button("Sort both", event -> grid .setSortOrder(GridSortOrder.asc(grid.getColumn("name")) - .thenAsc(grid.getColumn("age"))))); + .thenAsc(grid.getColumn("age"))))); } private final Grid<Person> getGrid() { diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSvgInCell.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSvgInCell.java index fbe59b8a88..5c8fd0e6b2 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSvgInCell.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSvgInCell.java @@ -29,10 +29,10 @@ public class GridSvgInCell extends AbstractTestUI { DataObject data = new DataObject(); data.setSvg( - "<svg width=\"100%\" height=\"20px\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">" - + "<polygon id=\"bar_background_blue\" stroke=\"gray\" fill=\"#D6D6D6\" points=\"0 0,59 0,66 7,59 14,0 14\"></polygon>" - + "<rect id=\"bar_blue\" x=\"1\" y=\"1\" width=\"0px\" height=\"13\" fill=\"#7298C0\"></rect>" - + "</svg>"); + "<svg width=\"100%\" height=\"20px\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">" + + "<polygon id=\"bar_background_blue\" stroke=\"gray\" fill=\"#D6D6D6\" points=\"0 0,59 0,66 7,59 14,0 14\"></polygon>" + + "<rect id=\"bar_blue\" x=\"1\" y=\"1\" width=\"0px\" height=\"13\" fill=\"#7298C0\"></rect>" + + "</svg>"); grid.setItems(data); addComponent(grid); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridUndefinedHeight.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridUndefinedHeight.java index d63a1d2340..35ca7a0624 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridUndefinedHeight.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridUndefinedHeight.java @@ -28,9 +28,9 @@ public class GridUndefinedHeight extends AbstractTestUI { layout.addComponents(grid, oldGrid, new Button("Add header row", event -> { - grid.appendHeaderRow(); - oldGrid.appendHeaderRow(); - })); + grid.appendHeaderRow(); + oldGrid.appendHeaderRow(); + })); layout.setHeight("600px"); layout.setExpandRatio(grid, 1.0f); layout.setExpandRatio(oldGrid, 1.0f); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java b/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java index 7391cbf4ff..0e196b46ed 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java @@ -259,7 +259,8 @@ public class GridBasics extends AbstractTestUIWithLog { private void onSingleSelect(SingleSelectionEvent<DataObject> event) { log("SingleSelectionEvent: Selected: " + (event.getSelectedItem().isPresent() - ? event.getSelectedItem().get().toString() : "none")); + ? event.getSelectedItem().get().toString() + : "none")); } private void onMultiSelect(MultiSelectionEvent<DataObject> event) { @@ -270,7 +271,8 @@ public class GridBasics extends AbstractTestUIWithLog { String addedRow = firstAdded.isPresent() ? firstAdded.get().toString() : "none"; String removedRow = firstRemoved.isPresent() - ? firstRemoved.get().toString() : "none"; + ? firstRemoved.get().toString() + : "none"; log("SelectionEvent: Added " + addedRow + ", Removed " + removedRow); } @@ -364,18 +366,19 @@ public class GridBasics extends AbstractTestUIWithLog { } columnsMenu.addItem("Clear sort", item -> grid.clearSortOrder()); - columnsMenu.addItem("Simple resize mode", - item -> grid.setColumnResizeMode(item.isChecked() - ? ColumnResizeMode.SIMPLE : ColumnResizeMode.ANIMATED)) + columnsMenu + .addItem("Simple resize mode", + item -> grid.setColumnResizeMode( + item.isChecked() ? ColumnResizeMode.SIMPLE + : ColumnResizeMode.ANIMATED)) .setCheckable(true); columnsMenu.addItem("Add resize listener", item -> { if (item.isChecked()) { columnResizeListenerRegistration = grid.addColumnResizeListener( - event -> log( - "Column resized: caption=" + event.getColumn() - .getCaption() + ", width=" + event - .getColumn().getWidth())); + event -> log("Column resized: caption=" + + event.getColumn().getCaption() + ", width=" + + event.getColumn().getWidth())); } else { if (columnResizeListenerRegistration != null) { columnResizeListenerRegistration.remove(); @@ -435,7 +438,8 @@ public class GridBasics extends AbstractTestUIWithLog { !grid.isDetailsVisible(event.getItem())); log("Item click on row " + event.getItem().getRowNumber() + ", Column '" - + event.getColumn().getCaption() + "' Index " + event.getRowIndex()); + + event.getColumn().getCaption() + "' Index " + + event.getRowIndex()); }); log("Registered an item click listener."); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/gridlayout/GridLayoutHideMiddleCells.java b/uitest/src/main/java/com/vaadin/tests/components/gridlayout/GridLayoutHideMiddleCells.java index 07cafa18b4..bdd475ac56 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/gridlayout/GridLayoutHideMiddleCells.java +++ b/uitest/src/main/java/com/vaadin/tests/components/gridlayout/GridLayoutHideMiddleCells.java @@ -53,53 +53,49 @@ public class GridLayoutHideMiddleCells extends AbstractReindeerTestUI { horLayout.addComponent(gridLayout); horLayout.addComponent(gridLayout2); - mainLayout - .addComponent(new Button("Hide/show both middle Column and row", - event -> { - for (int i = 0; i < ROWS; i++) { - for (int j = 0; j < COLS; j++) { - if (j == 2 || i == 2) { - if (labels[i][j].isVisible()) { - labels[i][j].setVisible(false); - } else { - labels[i][j].setVisible(true); - } - } + mainLayout.addComponent( + new Button("Hide/show both middle Column and row", event -> { + for (int i = 0; i < ROWS; i++) { + for (int j = 0; j < COLS; j++) { + if (j == 2 || i == 2) { + if (labels[i][j].isVisible()) { + labels[i][j].setVisible(false); + } else { + labels[i][j].setVisible(true); } } - })); - mainLayout.addComponent(new Button("Hide/show middle Column", - event -> { - for (int i = 0; i < ROWS; i++) { - if (labels[i][2].isVisible()) { - labels[i][2].setVisible(false); - } else { - labels[i][2].setVisible(true); - } - } - })); - mainLayout.addComponent( - new Button("Hide/show middle Row", event -> { - for (int j = 0; j < COLS; j++) { - if (labels[2][j].isVisible()) { - labels[2][j].setVisible(false); - } else { - labels[2][j].setVisible(true); } } })); - mainLayout.addComponent( - new Button("Hide Random button", event -> { - // TODO Auto-generated method stub - Random rand = new Random(); - int i = rand.nextInt(ROWS); - int j = rand.nextInt(COLS); - if (labels[i][j].isVisible()) { - labels[i][j].setVisible(false); - } else { - labels[i][j].setVisible(true); - } - })); + mainLayout.addComponent(new Button("Hide/show middle Column", event -> { + for (int i = 0; i < ROWS; i++) { + if (labels[i][2].isVisible()) { + labels[i][2].setVisible(false); + } else { + labels[i][2].setVisible(true); + } + } + })); + mainLayout.addComponent(new Button("Hide/show middle Row", event -> { + for (int j = 0; j < COLS; j++) { + if (labels[2][j].isVisible()) { + labels[2][j].setVisible(false); + } else { + labels[2][j].setVisible(true); + } + } + })); + mainLayout.addComponent(new Button("Hide Random button", event -> { + // TODO Auto-generated method stub + Random rand = new Random(); + int i = rand.nextInt(ROWS); + int j = rand.nextInt(COLS); + if (labels[i][j].isVisible()) { + labels[i][j].setVisible(false); + } else { + labels[i][j].setVisible(true); + } + })); } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/label/HundredPercentWideLabelResize.java b/uitest/src/main/java/com/vaadin/tests/components/label/HundredPercentWideLabelResize.java index c4c5d7c5af..cee699ce62 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/label/HundredPercentWideLabelResize.java +++ b/uitest/src/main/java/com/vaadin/tests/components/label/HundredPercentWideLabelResize.java @@ -24,14 +24,13 @@ public class HundredPercentWideLabelResize extends TestBase { text.setWidth("100%"); getLayout().addComponent(text); - getLayout().addComponent( - new Button("toggle width", event -> { - if (getLayout().getWidth() == 500) { - getLayout().setWidth("100px"); - } else { - getLayout().setWidth("500px"); - } - })); + getLayout().addComponent(new Button("toggle width", event -> { + if (getLayout().getWidth() == 500) { + getLayout().setWidth("100px"); + } else { + getLayout().setWidth("500px"); + } + })); } } diff --git a/uitest/src/main/java/com/vaadin/tests/components/nativebutton/NativeButtonClick.java b/uitest/src/main/java/com/vaadin/tests/components/nativebutton/NativeButtonClick.java index bf7d8b19ea..eb534b7630 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/nativebutton/NativeButtonClick.java +++ b/uitest/src/main/java/com/vaadin/tests/components/nativebutton/NativeButtonClick.java @@ -27,12 +27,10 @@ public class NativeButtonClick extends AbstractReindeerTestUI { final Label label1 = new Label("0,0"); final Label label2 = new Label("0,0"); - Button button1 = new NativeButton("Button1", - event -> label1.setValue( - event.getClientX() + "," + event.getClientY())); - Button button2 = new NativeButton("Button2", - event -> label2.setValue( - event.getClientX() + "," + event.getClientY())); + Button button1 = new NativeButton("Button1", event -> label1 + .setValue(event.getClientX() + "," + event.getClientY())); + Button button2 = new NativeButton("Button2", event -> label2 + .setValue(event.getClientX() + "," + event.getClientY())); HorizontalLayout layout = new HorizontalLayout(); layout.addComponents(button1, button2, label1, label2); diff --git a/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java b/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java index cb02ccfed2..9e9363e9ef 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java @@ -110,32 +110,29 @@ public class BoxLayoutTest extends AbstractReindeerTestUI { }); header.addComponent(vertical); - Button addComponent = new Button("Add Component", - event -> { - GridLayout grid = new GridLayout(2, 2); - Button grow = new Button("Grow Me", - event2 -> { - if (event2.getButton().getWidth() == -1) { - event2.getButton().setHeight("50px"); - event2.getButton().setWidth("200px"); - } else { - event2.getButton().setSizeUndefined(); - } - }); - grid.addComponent(new Label("Grid cell 1")); - grid.addComponent(new Label("Grid cell 2")); - grid.addComponent(grow); - grid.addComponent(new Label("Grid cell 4")); - l.addComponent(grid); - // l.addComponent(new TextField("Some field")); - }); + Button addComponent = new Button("Add Component", event -> { + GridLayout grid = new GridLayout(2, 2); + Button grow = new Button("Grow Me", event2 -> { + if (event2.getButton().getWidth() == -1) { + event2.getButton().setHeight("50px"); + event2.getButton().setWidth("200px"); + } else { + event2.getButton().setSizeUndefined(); + } + }); + grid.addComponent(new Label("Grid cell 1")); + grid.addComponent(new Label("Grid cell 2")); + grid.addComponent(grow); + grid.addComponent(new Label("Grid cell 4")); + l.addComponent(grid); + // l.addComponent(new TextField("Some field")); + }); header.addComponent(addComponent); - Button removeComponent = new Button("Remove Component", - event -> { - Component last = l.getComponent(l.getComponentCount() - 1); - l.removeComponent(last); - }); + Button removeComponent = new Button("Remove Component", event -> { + Component last = l.getComponent(l.getComponentCount() - 1); + l.removeComponent(last); + }); header.addComponent(removeComponent); // Second row diff --git a/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/ExpandChangeReattach.java b/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/ExpandChangeReattach.java index 4bf99c7d9b..0974360c0a 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/ExpandChangeReattach.java +++ b/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/ExpandChangeReattach.java @@ -16,14 +16,13 @@ public class ExpandChangeReattach extends AbstractReindeerTestUI { Table table = new Table("Table", TestUtils.getISO3166Container()); verticalLayout.addComponent(table); - verticalLayout.addComponent( - new Button("Toggle expand logic", event -> { - if (verticalLayout.getHeight() == -1) { - verticalLayout.setHeight("900px"); - } else { - verticalLayout.setHeight(null); - } - })); + verticalLayout.addComponent(new Button("Toggle expand logic", event -> { + if (verticalLayout.getHeight() == -1) { + verticalLayout.setHeight("900px"); + } else { + verticalLayout.setHeight(null); + } + })); addComponent(verticalLayout); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/HorizontalLayoutFullsizeContentWithErrorMsg.java b/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/HorizontalLayoutFullsizeContentWithErrorMsg.java index efea634afd..ea748a9d3e 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/HorizontalLayoutFullsizeContentWithErrorMsg.java +++ b/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/HorizontalLayoutFullsizeContentWithErrorMsg.java @@ -40,10 +40,8 @@ public class HorizontalLayoutFullsizeContentWithErrorMsg Button toggleError = new Button("Toggle error"); toggleError.setId(BUTTON_ID); - toggleError.addClickListener(event -> - tf.setComponentError(tf.getComponentError() == null - ? new UserError("foo") - : null)); + toggleError.addClickListener(event -> tf.setComponentError( + tf.getComponentError() == null ? new UserError("foo") : null)); hl.addComponent(toggleError); addComponent(hl); diff --git a/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java b/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java index 19be078406..d089f65eb1 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java @@ -34,15 +34,14 @@ public class LayoutResizeTest extends TestBase { left.addComponent( new Label("<h2>Layout resize test</h2>", ContentMode.HTML)); - Button resize = new Button("Resize to 700x400", - event -> event.getButton().getUI().getPage().getJavaScript() - .execute( - "setTimeout(function() {window.resizeTo(700,400)}, 500)")); + Button resize = new Button("Resize to 700x400", event -> event + .getButton().getUI().getPage().getJavaScript().execute( + "setTimeout(function() {window.resizeTo(700,400)}, 500)")); left.addComponent(resize); - resize = new Button("Resize to 900x600", event -> - event.getButton().getUI().getPage().getJavaScript().execute( - "setTimeout(function() {window.resizeTo(900,600)}, 500)")); + resize = new Button("Resize to 900x600", event -> event.getButton() + .getUI().getPage().getJavaScript().execute( + "setTimeout(function() {window.resizeTo(900,600)}, 500)")); left.addComponent(resize); left.addComponent(new Label( diff --git a/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java b/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java index a52a3b4361..41a6cc6538 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java +++ b/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java @@ -33,34 +33,30 @@ public class OrderedLayoutCases extends AbstractReindeerTestUI { event.getProperty().getValue().toString()), dimensionValues)); addComponent(createSimpleSelector("Child height", - event ->setHeight( - event.getProperty().getValue().toString()) - , dimensionValues)); - addComponent( - createSimpleSelector("Caption", event -> { - String value = event.getProperty().getValue() - .toString(); - if (value.isEmpty()) { - setCaption(null); - } else if (value.equals("Long")) { - setCaption( - "A rather long caption just to see what happens"); - } else { - setCaption(value); - } - }, "", "Short", "Long")); - - addComponent(createSimpleSelector("Expand ratio", - event -> { - AbstractOrderedLayout parent = (AbstractOrderedLayout) getParent(); - if (parent == null) { - return; - } - String value = event.getProperty().getValue() - .toString(); - parent.setExpandRatio(SampleChild.this, - Float.parseFloat(value)); - }, "0", "1", "2")); + event -> setHeight( + event.getProperty().getValue().toString()), + dimensionValues)); + addComponent(createSimpleSelector("Caption", event -> { + String value = event.getProperty().getValue().toString(); + if (value.isEmpty()) { + setCaption(null); + } else if (value.equals("Long")) { + setCaption( + "A rather long caption just to see what happens"); + } else { + setCaption(value); + } + }, "", "Short", "Long")); + + addComponent(createSimpleSelector("Expand ratio", event -> { + AbstractOrderedLayout parent = (AbstractOrderedLayout) getParent(); + if (parent == null) { + return; + } + String value = event.getProperty().getValue().toString(); + parent.setExpandRatio(SampleChild.this, + Float.parseFloat(value)); + }, "0", "1", "2")); // Why is Alignment not an enum? Now we have to use reflection just // to get the different values as hardcoding is never an option! ;) @@ -71,25 +67,20 @@ public class OrderedLayoutCases extends AbstractReindeerTestUI { alignmentValues.add(field.getName()); } } - addComponent(createSimpleSelector("Alignment", - event -> { - String value = event.getProperty().getValue() - .toString(); - AlignmentHandler parent = (AlignmentHandler) getParent(); - if (parent == null) { - return; - } - try { - Field field = Alignment.class - .getDeclaredField(value); - Alignment alignment = (Alignment) field - .get(null); - parent.setComponentAlignment(SampleChild.this, - alignment); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, alignmentValues, "TOP_LEFT")); // Sorry for not using + addComponent(createSimpleSelector("Alignment", event -> { + String value = event.getProperty().getValue().toString(); + AlignmentHandler parent = (AlignmentHandler) getParent(); + if (parent == null) { + return; + } + try { + Field field = Alignment.class.getDeclaredField(value); + Alignment alignment = (Alignment) field.get(null); + parent.setComponentAlignment(SampleChild.this, alignment); + } catch (Exception e) { + throw new RuntimeException(e); + } + }, alignmentValues, "TOP_LEFT")); // Sorry for not using // more reflection magic // just to find the // default value... @@ -116,151 +107,140 @@ public class OrderedLayoutCases extends AbstractReindeerTestUI { sizeBar = new HorizontalLayout(); sizeBar.setSpacing(true); - sizeBar.addComponent( - createSimpleSelector("Layout width", - event -> currentLayout.setWidth( - event.getProperty().getValue().toString()), - dimensionValues)); + sizeBar.addComponent(createSimpleSelector("Layout width", + event -> currentLayout + .setWidth(event.getProperty().getValue().toString()), + dimensionValues)); sizeBar.addComponent(createSimpleSelector("Layout height", event -> currentLayout .setHeight(event.getProperty().getValue().toString()), dimensionValues)); - sizeBar.addComponent( - createSimpleSelector("Spacing", event -> - currentLayout.setSpacing(Boolean.parseBoolean( - event.getProperty().getValue().toString())), "false", - "true")); - sizeBar.addComponent( - createSimpleSelector("Margin", event -> - currentLayout.setMargin(Boolean.parseBoolean( - event.getProperty().getValue().toString())), "false", - "true")); - sizeBar.addComponent( - createSimpleSelector("Direction", event -> { - Object value = event.getProperty().getValue(); - - AbstractOrderedLayout newLayout; - if (value.equals("Horizontal")) { - newLayout = new HorizontalLayout(); - } else { - newLayout = new VerticalLayout(); - } - - while (currentLayout.getComponentCount() > 0) { - Component child = currentLayout.getComponent(0); - Alignment alignment = currentLayout - .getComponentAlignment(child); - float expRatio = currentLayout.getExpandRatio(child); - newLayout.addComponent(child); - newLayout.setExpandRatio(child, expRatio); - newLayout.setComponentAlignment(child, alignment); - - } - newLayout.setStyleName("theLayout"); - - newLayout.setHeight(currentLayout.getHeight(), - currentLayout.getHeightUnits()); - newLayout.setWidth(currentLayout.getWidth(), - currentLayout.getWidthUnits()); - - newLayout.setMargin(currentLayout.getMargin()); - newLayout.setSpacing(currentLayout.isSpacing()); - - getLayout().replaceComponent(currentLayout, newLayout); - getLayout().setExpandRatio(newLayout, 1); - currentLayout = newLayout; - }, "Horizontal", "Vertical")); + sizeBar.addComponent(createSimpleSelector("Spacing", + event -> currentLayout.setSpacing(Boolean.parseBoolean( + event.getProperty().getValue().toString())), + "false", "true")); + sizeBar.addComponent(createSimpleSelector("Margin", + event -> currentLayout.setMargin(Boolean.parseBoolean( + event.getProperty().getValue().toString())), + "false", "true")); + sizeBar.addComponent(createSimpleSelector("Direction", event -> { + Object value = event.getProperty().getValue(); + + AbstractOrderedLayout newLayout; + if (value.equals("Horizontal")) { + newLayout = new HorizontalLayout(); + } else { + newLayout = new VerticalLayout(); + } - HorizontalLayout caseBar = new HorizontalLayout(); - caseBar.addComponent( - new Button("Undefined without relative", event -> { - resetState(); - setState(sizeBar, 2, 1); - // width: 350px to middle child - setChildState(1, 0, 2); - // middle center allign to middle child - setChildState(1, 4, 5); - // long captions to right child - setChildState(2, 2, 2); - })); - caseBar.addComponent( - new Button("Undefined with relative", event -> { - resetState(); - // width: 100% to middle child - setChildState(1, 0, 4); - })); - caseBar.addComponent( - new Button("Fixed with overflow", event -> { - resetState(); - // layout width: 350px - setState(sizeBar, 0, 2); - // layout margin enabled - setState(sizeBar, 3, 1); - })); - caseBar.addComponent( - new Button("Fixed with extra space", event -> { - resetState(); - // Layout width: 800px - setState(sizeBar, 0, 3); - // layout margin enabled - setState(sizeBar, 3, 1); - // width: 350px to middle child - setChildState(1, 0, 2); - // short caption for middle child - setChildState(1, 2, 1); - // top center align for middle child - setChildState(1, 4, 2); - })); + while (currentLayout.getComponentCount() > 0) { + Component child = currentLayout.getComponent(0); + Alignment alignment = currentLayout + .getComponentAlignment(child); + float expRatio = currentLayout.getExpandRatio(child); + newLayout.addComponent(child); + newLayout.setExpandRatio(child, expRatio); + newLayout.setComponentAlignment(child, alignment); - caseBar.addComponent( - new Button("Expand with alignment", event -> { - resetState(); - // Layout width: 800px - setState(sizeBar, 0, 3); - // Layout height: 350px - setState(sizeBar, 1, 2); - // Expand: 1 to middle child - setChildState(1, 3, 1); - // Align bottom left to middle child - setChildState(1, 4, 6); - // Long caption to middle child - setChildState(1, 2, 2); - })); + } + newLayout.setStyleName("theLayout"); - caseBar.addComponent( - new Button("Multiple expands", event -> { - resetState(); - // Layout width: 800px - setState(sizeBar, 0, 3); - // Layout height: 350px - setState(sizeBar, 1, 2); - // Long caption to left child - setChildState(0, 2, 2); - // Width 350px to middle child - setChildState(1, 0, 2); - // Apply to left and middle child - for (int i = 0; i < 2; i++) { - // Expand: 1 - setChildState(i, 3, 1); - // Align: middle center - setChildState(i, 4, 5); - } - })); + newLayout.setHeight(currentLayout.getHeight(), + currentLayout.getHeightUnits()); + newLayout.setWidth(currentLayout.getWidth(), + currentLayout.getWidthUnits()); - caseBar.addComponent( - new Button("Fixed + relative height", event -> { - resetState(); - // Layout height: 100% - setState(sizeBar, 1, 4); - // Height: 350px to left child - setChildState(0, 1, 2); - // Height: 100% to middle child - setChildState(1, 1, 4); - // Short caption to middle child - setChildState(1, 2, 1); - // Alignment: bottom left to right child - setChildState(2, 4, 7); - })); + newLayout.setMargin(currentLayout.getMargin()); + newLayout.setSpacing(currentLayout.isSpacing()); + + getLayout().replaceComponent(currentLayout, newLayout); + getLayout().setExpandRatio(newLayout, 1); + currentLayout = newLayout; + }, "Horizontal", "Vertical")); + + HorizontalLayout caseBar = new HorizontalLayout(); + caseBar.addComponent(new Button("Undefined without relative", event -> { + resetState(); + setState(sizeBar, 2, 1); + // width: 350px to middle child + setChildState(1, 0, 2); + // middle center allign to middle child + setChildState(1, 4, 5); + // long captions to right child + setChildState(2, 2, 2); + })); + caseBar.addComponent(new Button("Undefined with relative", event -> { + resetState(); + // width: 100% to middle child + setChildState(1, 0, 4); + })); + caseBar.addComponent(new Button("Fixed with overflow", event -> { + resetState(); + // layout width: 350px + setState(sizeBar, 0, 2); + // layout margin enabled + setState(sizeBar, 3, 1); + })); + caseBar.addComponent(new Button("Fixed with extra space", event -> { + resetState(); + // Layout width: 800px + setState(sizeBar, 0, 3); + // layout margin enabled + setState(sizeBar, 3, 1); + // width: 350px to middle child + setChildState(1, 0, 2); + // short caption for middle child + setChildState(1, 2, 1); + // top center align for middle child + setChildState(1, 4, 2); + })); + + caseBar.addComponent(new Button("Expand with alignment", event -> { + resetState(); + // Layout width: 800px + setState(sizeBar, 0, 3); + // Layout height: 350px + setState(sizeBar, 1, 2); + // Expand: 1 to middle child + setChildState(1, 3, 1); + // Align bottom left to middle child + setChildState(1, 4, 6); + // Long caption to middle child + setChildState(1, 2, 2); + })); + + caseBar.addComponent(new Button("Multiple expands", event -> { + resetState(); + // Layout width: 800px + setState(sizeBar, 0, 3); + // Layout height: 350px + setState(sizeBar, 1, 2); + // Long caption to left child + setChildState(0, 2, 2); + // Width 350px to middle child + setChildState(1, 0, 2); + // Apply to left and middle child + for (int i = 0; i < 2; i++) { + // Expand: 1 + setChildState(i, 3, 1); + // Align: middle center + setChildState(i, 4, 5); + } + })); + + caseBar.addComponent(new Button("Fixed + relative height", event -> { + resetState(); + // Layout height: 100% + setState(sizeBar, 1, 4); + // Height: 350px to left child + setChildState(0, 1, 2); + // Height: 100% to middle child + setChildState(1, 1, 4); + // Short caption to middle child + setChildState(1, 2, 1); + // Alignment: bottom left to right child + setChildState(2, 4, 7); + })); caseBar.addComponent( new Button("Undefined + relative height", event -> { @@ -273,18 +253,17 @@ public class OrderedLayoutCases extends AbstractReindeerTestUI { setChildState(1, 1, 4); })); + caseBar.addComponent(new Button("Undefined + alignments", event -> { + resetState(); + // Height: 350px to left child + setChildState(0, 1, 2); + // Short caption to left child + setChildState(0, 2, 1); + // Alignment: bottom left to right child + setChildState(2, 4, 7); + })); caseBar.addComponent( - new Button("Undefined + alignments", event -> { - resetState(); - // Height: 350px to left child - setChildState(0, 1, 2); - // Short caption to left child - setChildState(0, 2, 1); - // Alignment: bottom left to right child - setChildState(2, 4, 7); - })); - caseBar.addComponent(new Button("Relative child without expand", - event -> { + new Button("Relative child without expand", event -> { resetState(); // Width 800px setState(sizeBar, 0, 3); diff --git a/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/OrderedLayoutComponentOrdering.java b/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/OrderedLayoutComponentOrdering.java index 868995b167..414cc353c5 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/OrderedLayoutComponentOrdering.java +++ b/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/OrderedLayoutComponentOrdering.java @@ -41,8 +41,7 @@ public class OrderedLayoutComponentOrdering extends TestBase { addComponent(addThird); Button move = new Button("move last to first"); - move.addClickListener(event -> - hl.addComponentAsFirst( + move.addClickListener(event -> hl.addComponentAsFirst( hl.getComponent(hl.getComponentCount() - 1))); addComponent(move); diff --git a/uitest/src/main/java/com/vaadin/tests/components/panel/PanelConcurrentModificationException.java b/uitest/src/main/java/com/vaadin/tests/components/panel/PanelConcurrentModificationException.java index 5a56ff9b04..c30811e9d9 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/panel/PanelConcurrentModificationException.java +++ b/uitest/src/main/java/com/vaadin/tests/components/panel/PanelConcurrentModificationException.java @@ -18,10 +18,8 @@ public class PanelConcurrentModificationException extends TestBase { addComponent(new Button("Click here for exception", event -> panelLayout.addComponent(new Label("Label")))); - addComponent( - new Button("Or click here first", event -> - Notification.show( - "It is now safe to click the other button"))); + addComponent(new Button("Or click here first", event -> Notification + .show("It is now safe to click the other button"))); addComponent(panel); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/panel/PanelShouldRemoveActionHandler.java b/uitest/src/main/java/com/vaadin/tests/components/panel/PanelShouldRemoveActionHandler.java index fc4c1d638d..0c0b26cf87 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/panel/PanelShouldRemoveActionHandler.java +++ b/uitest/src/main/java/com/vaadin/tests/components/panel/PanelShouldRemoveActionHandler.java @@ -33,8 +33,7 @@ public class PanelShouldRemoveActionHandler extends TestBase { layout.setMargin(true); panel = new Panel("A panel", layout); layout.addComponent(new TextField()); - Button add = new Button("Add an action handler", - event -> add()); + Button add = new Button("Add an action handler", event -> add()); Button addAnother = new Button("Add another action handler", event -> addAnother()); Button remove = new Button("Remove an action handler", diff --git a/uitest/src/main/java/com/vaadin/tests/components/popupview/PopupViewAndFragment.java b/uitest/src/main/java/com/vaadin/tests/components/popupview/PopupViewAndFragment.java index 25dd765f33..7d24e0de31 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/popupview/PopupViewAndFragment.java +++ b/uitest/src/main/java/com/vaadin/tests/components/popupview/PopupViewAndFragment.java @@ -13,12 +13,11 @@ public class PopupViewAndFragment extends AbstractReindeerTestUI { final PopupView pw = new PopupView("Open", new Label("Oh, hi")); addComponent(pw); - final Button button = new Button("Open and change fragment", - event -> { - pw.setPopupVisible(true); - getPage().setUriFragment( - String.valueOf(System.currentTimeMillis())); - }); + final Button button = new Button("Open and change fragment", event -> { + pw.setPopupVisible(true); + getPage() + .setUriFragment(String.valueOf(System.currentTimeMillis())); + }); addComponent(button); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/progressindicator/ProgressBarTest.java b/uitest/src/main/java/com/vaadin/tests/components/progressindicator/ProgressBarTest.java index 2d9d561699..04cf362dd7 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/progressindicator/ProgressBarTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/progressindicator/ProgressBarTest.java @@ -42,9 +42,8 @@ public class ProgressBarTest extends AbstractReindeerTestUI { addComponent(new Button("Use ProgressBar", event -> useComponent(new ProgressBar()))); - addComponent( - new Button("Use ProgressIndicator", - event -> useComponent(new ProgressIndicator()))); + addComponent(new Button("Use ProgressIndicator", + event -> useComponent(new ProgressIndicator()))); addComponent(new Button("Stop background thread", event -> stopUpdateThread())); diff --git a/uitest/src/main/java/com/vaadin/tests/components/radiobuttongroup/RadioButtonGroupInGridLayout.java b/uitest/src/main/java/com/vaadin/tests/components/radiobuttongroup/RadioButtonGroupInGridLayout.java index dcd0ab08f2..75be640f09 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/radiobuttongroup/RadioButtonGroupInGridLayout.java +++ b/uitest/src/main/java/com/vaadin/tests/components/radiobuttongroup/RadioButtonGroupInGridLayout.java @@ -12,7 +12,8 @@ public class RadioButtonGroupInGridLayout extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - RadioButtonGroup<String> cbGroup = new RadioButtonGroup<>(null, DataProvider.ofItems("A", "B", "C")); + RadioButtonGroup<String> cbGroup = new RadioButtonGroup<>(null, + DataProvider.ofItems("A", "B", "C")); cbGroup.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL); GridLayout gridLayout = new GridLayout(2, 1); diff --git a/uitest/src/main/java/com/vaadin/tests/components/radiobuttongroup/RadioButtonGroupItemDisabled.java b/uitest/src/main/java/com/vaadin/tests/components/radiobuttongroup/RadioButtonGroupItemDisabled.java index 5a3a4674e4..0c484a08fc 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/radiobuttongroup/RadioButtonGroupItemDisabled.java +++ b/uitest/src/main/java/com/vaadin/tests/components/radiobuttongroup/RadioButtonGroupItemDisabled.java @@ -18,4 +18,4 @@ public class RadioButtonGroupItemDisabled extends AbstractTestUI { rbg.setItemEnabledProvider(ENABLED_PROVIDER); addComponent(rbg); } -}
\ No newline at end of file +} diff --git a/uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaDelegateToShortcutHandler.java b/uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaDelegateToShortcutHandler.java index ead2ebc4bd..4f208a05e6 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaDelegateToShortcutHandler.java +++ b/uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaDelegateToShortcutHandler.java @@ -7,7 +7,8 @@ import com.vaadin.ui.Button; import com.vaadin.ui.RichTextArea; import com.vaadin.ui.VerticalLayout; -public class RichTextAreaDelegateToShortcutHandler extends AbstractTestUIWithLog { +public class RichTextAreaDelegateToShortcutHandler + extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { @@ -17,7 +18,8 @@ public class RichTextAreaDelegateToShortcutHandler extends AbstractTestUIWithLog Button button = new Button("Click Me"); button.setClickShortcut(ShortcutAction.KeyCode.ENTER); - button.addClickListener(e -> log("ShortcutHandler invoked " + name.getValue())); + button.addClickListener( + e -> log("ShortcutHandler invoked " + name.getValue())); layout.addComponents(name, button); addComponent(layout); diff --git a/uitest/src/main/java/com/vaadin/tests/components/select/TwinColSelectCaptionStyles.java b/uitest/src/main/java/com/vaadin/tests/components/select/TwinColSelectCaptionStyles.java index b8f5e520b2..84d73bf092 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/select/TwinColSelectCaptionStyles.java +++ b/uitest/src/main/java/com/vaadin/tests/components/select/TwinColSelectCaptionStyles.java @@ -17,11 +17,10 @@ public class TwinColSelectCaptionStyles extends TestBase { sel.setWidth("300px"); addComponent(sel); - Button b = new Button("Set height and width to 500px", - event -> { - sel.setHeight("500px"); - sel.setWidth("500px"); - }); + Button b = new Button("Set height and width to 500px", event -> { + sel.setHeight("500px"); + sel.setWidth("500px"); + }); addComponent(b); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/slider/SliderPrimaryStyleName.java b/uitest/src/main/java/com/vaadin/tests/components/slider/SliderPrimaryStyleName.java index 064813d410..14146c16a6 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/slider/SliderPrimaryStyleName.java +++ b/uitest/src/main/java/com/vaadin/tests/components/slider/SliderPrimaryStyleName.java @@ -13,9 +13,8 @@ public class SliderPrimaryStyleName extends TestBase { slider.setPrimaryStyleName("my-slider"); addComponent(slider); - addComponent( - new Button("Change primary style", event -> slider - .setPrimaryStyleName("my-second-slider"))); + addComponent(new Button("Change primary style", + event -> slider.setPrimaryStyleName("my-second-slider"))); } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java b/uitest/src/main/java/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java index 812dd3e4ef..c39bbeafbe 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java +++ b/uitest/src/main/java/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java @@ -48,19 +48,18 @@ public class SplitPanelReversePosition extends TestBase { HorizontalLayout buttons = new HorizontalLayout(); buttons.setSpacing(true); - buttons.addComponent(new Button("Swap horizontal positioning", - event -> { + buttons.addComponent( + new Button("Swap horizontal positioning", event -> { hsplitReversed = !hsplitReversed; hsplit.setSplitPosition(100, Sizeable.UNITS_PIXELS, hsplitReversed); })); - buttons.addComponent(new Button("Swap vertical positioning", - event -> { - vsplitReversed = !vsplitReversed; - vsplit.setSplitPosition(10, Sizeable.UNITS_PERCENTAGE, - vsplitReversed); - })); + buttons.addComponent(new Button("Swap vertical positioning", event -> { + vsplitReversed = !vsplitReversed; + vsplit.setSplitPosition(10, Sizeable.UNITS_PERCENTAGE, + vsplitReversed); + })); addComponent(buttons); diff --git a/uitest/src/main/java/com/vaadin/tests/components/splitpanel/SplitPanelSplitterWidth.java b/uitest/src/main/java/com/vaadin/tests/components/splitpanel/SplitPanelSplitterWidth.java index ab774bbe1d..b642bbc049 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/splitpanel/SplitPanelSplitterWidth.java +++ b/uitest/src/main/java/com/vaadin/tests/components/splitpanel/SplitPanelSplitterWidth.java @@ -44,15 +44,14 @@ public class SplitPanelSplitterWidth extends TestBase { p.setSizeFull(); split2.addComponent(p); - getLayout() - .addComponent(new Button("Unlock", event -> { - split.setLocked(false); - split2.setLocked(false); - getMainWindow().showNotification( - "Try moving split. Then reload page.", - Notification.TYPE_WARNING_MESSAGE); - getLayout().removeComponent(event.getButton()); - })); + getLayout().addComponent(new Button("Unlock", event -> { + split.setLocked(false); + split2.setLocked(false); + getMainWindow().showNotification( + "Try moving split. Then reload page.", + Notification.TYPE_WARNING_MESSAGE); + getLayout().removeComponent(event.getButton()); + })); getLayout().addComponent(split); getLayout().addComponent(split2); diff --git a/uitest/src/main/java/com/vaadin/tests/components/splitpanel/SplitPositionChange.java b/uitest/src/main/java/com/vaadin/tests/components/splitpanel/SplitPositionChange.java index a7bd257643..ce3e1c19ba 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/splitpanel/SplitPositionChange.java +++ b/uitest/src/main/java/com/vaadin/tests/components/splitpanel/SplitPositionChange.java @@ -34,12 +34,10 @@ public class SplitPositionChange extends AbstractTestUIWithLog { splitPanel.setHeight("200px"); splitPanel.addComponent(buildPanel(firstCaption)); splitPanel.addComponent(buildPanel(secondCaption)); - splitPanel.addSplitPositionChangeListener( - event -> log(String.format( - "Split position changed: %s, position: %s %s", - (horizontal ? "horizontal" : "vertical"), - event.getSplitPosition(), - event.getSplitPositionUnit()))); + splitPanel.addSplitPositionChangeListener(event -> log(String.format( + "Split position changed: %s, position: %s %s", + (horizontal ? "horizontal" : "vertical"), + event.getSplitPosition(), event.getSplitPositionUnit()))); addComponent(splitPanel); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/AsyncPushUpdates.java b/uitest/src/main/java/com/vaadin/tests/components/table/AsyncPushUpdates.java index 87b7d829b4..f46697f8e6 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/AsyncPushUpdates.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/AsyncPushUpdates.java @@ -48,10 +48,11 @@ public class AsyncPushUpdates extends AbstractReindeerTestUI { ++id; container.removeAllItems(); for (int i = 0; i < 11; i++) { - container.getContainerProperty( - container.addItem(), VALUE_PROPERTY_ID) - .setValue(clickCount + " - " + id - + " - " + i); + container + .getContainerProperty(container.addItem(), + VALUE_PROPERTY_ID) + .setValue(clickCount + " - " + id + " - " + + i); } } catch (InterruptedException e) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java b/uitest/src/main/java/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java index 448dbf1c23..c32da28df8 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java @@ -49,10 +49,9 @@ public class ColumnCollapsingAndColumnExpansion "cell " + 2 + "-" + y, "cell " + 3 + "-" + y, }, new Object()); } - table.addColumnCollapseListener(event -> - log("Collapse state for " + event.getPropertyId() - + " changed to " - + table.isColumnCollapsed(event.getPropertyId()))); + table.addColumnCollapseListener(event -> log( + "Collapse state for " + event.getPropertyId() + " changed to " + + table.isColumnCollapsed(event.getPropertyId()))); addComponent(table); for (int i = 1; i <= 3; i++) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/EmptyRowsWhenScrolling.java b/uitest/src/main/java/com/vaadin/tests/components/table/EmptyRowsWhenScrolling.java index ce5f5ce651..c7a3bb7159 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/EmptyRowsWhenScrolling.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/EmptyRowsWhenScrolling.java @@ -88,8 +88,8 @@ public class EmptyRowsWhenScrolling extends UI { table.setContainerDataSource(container); table.setEditable(true); table.setColumnReorderingAllowed(true); - table.setVisibleColumns("image", "id", "col1", - "col2", "col3", "col4"); + table.setVisibleColumns("image", "id", "col1", "col2", "col3", + "col4"); table.addGeneratedColumn("image", new ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/ExpandingContainer.java b/uitest/src/main/java/com/vaadin/tests/components/table/ExpandingContainer.java index f09348e016..d7b70347e1 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/ExpandingContainer.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/ExpandingContainer.java @@ -16,8 +16,8 @@ import com.vaadin.v7.data.util.AbstractContainer; import com.vaadin.v7.data.util.BeanItem; @SuppressWarnings("serial") -public class ExpandingContainer extends AbstractContainer implements - Container.Indexed, Container.ItemSetChangeNotifier { +public class ExpandingContainer extends AbstractContainer + implements Container.Indexed, Container.ItemSetChangeNotifier { public static final List<String> PROPERTY_IDS = Arrays.asList("id", "column1", "column2"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/Footer.java b/uitest/src/main/java/com/vaadin/tests/components/table/Footer.java index d220c00e30..d9caa3a8a6 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/Footer.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/Footer.java @@ -50,10 +50,10 @@ public class Footer extends AbstractReindeerTestUI { options.addComponent(visible); final TextField footer1Value = new TextField(null, "Footer1"); - Button footer1Btn = new Button("Change", event -> - table.setColumnFooter("col1", footer1Value.getValue() == null - ? "" - : footer1Value.getValue())); + Button footer1Btn = new Button("Change", + event -> table.setColumnFooter("col1", + footer1Value.getValue() == null ? "" + : footer1Value.getValue())); HorizontalLayout footer1 = new HorizontalLayout(); footer1.setSpacing(false); footer1.addComponent(footer1Value); @@ -61,10 +61,10 @@ public class Footer extends AbstractReindeerTestUI { options.addComponent(footer1); final TextField footer2Value = new TextField(null, "Footer2"); - Button footer2Btn = new Button("Change", event -> - table.setColumnFooter("col2", footer2Value.getValue() == null - ? "" - : footer2Value.getValue())); + Button footer2Btn = new Button("Change", + event -> table.setColumnFooter("col2", + footer2Value.getValue() == null ? "" + : footer2Value.getValue())); HorizontalLayout footer2 = new HorizontalLayout(); footer2.setSpacing(false); footer2.addComponent(footer2Value); @@ -72,10 +72,10 @@ public class Footer extends AbstractReindeerTestUI { options.addComponent(footer2); final TextField footer3Value = new TextField(null, "Footer3"); - Button footer3Btn = new Button("Change", event -> - table.setColumnFooter("col3", footer3Value.getValue() == null - ? "" - : footer3Value.getValue())); + Button footer3Btn = new Button("Change", + event -> table.setColumnFooter("col3", + footer3Value.getValue() == null ? "" + : footer3Value.getValue())); HorizontalLayout footer3 = new HorizontalLayout(); footer3.setSpacing(false); footer3.addComponent(footer3Value); diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/HiddenColumnsExpandRatios.java b/uitest/src/main/java/com/vaadin/tests/components/table/HiddenColumnsExpandRatios.java index 98731954d6..1dfcd4b05d 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/HiddenColumnsExpandRatios.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/HiddenColumnsExpandRatios.java @@ -32,9 +32,9 @@ public class HiddenColumnsExpandRatios extends TestBase { item.getItemProperty("dfgh").setValue(genValue()); } - addComponent(new Button("All", event ->table.setVisibleColumns( - table.getContainerPropertyIds().toArray()))); - addComponent(new Button("Some", event ->{ + addComponent(new Button("All", event -> table + .setVisibleColumns(table.getContainerPropertyIds().toArray()))); + addComponent(new Button("Some", event -> { table.setWidth("100px"); table.setWidth("800px"); table.setVisibleColumns("foo", "bar", "baz"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/KeyboardNavigationWithChangingContent.java b/uitest/src/main/java/com/vaadin/tests/components/table/KeyboardNavigationWithChangingContent.java index 98cafa5bf2..8214966139 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/KeyboardNavigationWithChangingContent.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/KeyboardNavigationWithChangingContent.java @@ -29,8 +29,8 @@ public class KeyboardNavigationWithChangingContent extends TestBase { t.setMultiSelect(true); getLayout().addComponent(t); - getLayout().addComponent(new Button("Change elements and selection", - event -> { + getLayout().addComponent( + new Button("Change elements and selection", event -> { bic.removeAllItems(); ValueHolder<String> v4 = null; for (int i = 4; i < 30; i++) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java b/uitest/src/main/java/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java index 94296f42bd..6e7d6177ac 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java @@ -45,10 +45,9 @@ public class LabelEmbeddedClickThroughForTable extends AbstractReindeerTestUI { item = table.addItem("Item 2 (row 2)"); item.getItemProperty("Column 1").setValue("String B"); item.getItemProperty("Column 2").setValue(new Label("Label B")); - item.getItemProperty("Column 3") - .setValue(new Label( - "<a style=\"color: blue\" href=\"javascript:false\">Label B</a>", - ContentMode.HTML)); + item.getItemProperty("Column 3").setValue(new Label( + "<a style=\"color: blue\" href=\"javascript:false\">Label B</a>", + ContentMode.HTML)); item.getItemProperty("Column 4").setValue(new Embedded("", new ThemeResource("../runo/icons/32/cancel.png"))); diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/ModifyContainerProperty.java b/uitest/src/main/java/com/vaadin/tests/components/table/ModifyContainerProperty.java index f9fea18175..9714bb4e2a 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/ModifyContainerProperty.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/ModifyContainerProperty.java @@ -26,20 +26,19 @@ public class ModifyContainerProperty extends TestBase { table.setContainerDataSource(ic); addComponent(new Button("Remove container property", event -> ic.removeContainerProperty("one"))); - addComponent(new Button("Add container property", - event -> { - boolean added = ic.addContainerProperty("three", - String.class, "three"); - if (added) { - Object[] current = table.getVisibleColumns(); - Object[] vis = new Object[current.length + 1]; - for (int i = 0; i < current.length; i++) { - vis[i] = current[i]; - } - vis[current.length] = "three"; - table.setVisibleColumns(vis); - } - })); + addComponent(new Button("Add container property", event -> { + boolean added = ic.addContainerProperty("three", String.class, + "three"); + if (added) { + Object[] current = table.getVisibleColumns(); + Object[] vis = new Object[current.length + 1]; + for (int i = 0; i < current.length; i++) { + vis[i] = current[i]; + } + vis[current.length] = "three"; + table.setVisibleColumns(vis); + } + })); } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/MultiSelectWithRemovedRow.java b/uitest/src/main/java/com/vaadin/tests/components/table/MultiSelectWithRemovedRow.java index 0d262c8b4d..2d7b23cbb5 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/MultiSelectWithRemovedRow.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/MultiSelectWithRemovedRow.java @@ -61,14 +61,13 @@ public class MultiSelectWithRemovedRow extends TestBase { }); addComponent(removeButton); - addComponent(new Button("Remove first selected row", - event -> { - Collection<?> selection = (Collection<?>) table.getValue(); - if (!selection.isEmpty()) { - Object firstSelected = selection.iterator().next(); - container.removeItem(firstSelected); - } - })); + addComponent(new Button("Remove first selected row", event -> { + Collection<?> selection = (Collection<?>) table.getValue(); + if (!selection.isEmpty()) { + Object firstSelected = selection.iterator().next(); + container.removeItem(firstSelected); + } + })); } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/RowAdditionTest.java b/uitest/src/main/java/com/vaadin/tests/components/table/RowAdditionTest.java index 68093bbe46..b346ab4868 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/RowAdditionTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/RowAdditionTest.java @@ -35,16 +35,14 @@ public class RowAdditionTest extends TestBase { Item item = container.addItemAt(0, new Object()); item.getItemProperty("column1").setValue("0"); })); - hl.addComponent( - new Button("Add at position 50", event -> { - Item item = container.addItemAt(50, new Object()); - item.getItemProperty("column1").setValue("50"); - })); - hl.addComponent( - new Button("Add at position 100", event -> { - Item item = container.addItemAt(100, new Object()); - item.getItemProperty("column1").setValue("100"); - })); + hl.addComponent(new Button("Add at position 50", event -> { + Item item = container.addItemAt(50, new Object()); + item.getItemProperty("column1").setValue("50"); + })); + hl.addComponent(new Button("Add at position 100", event -> { + Item item = container.addItemAt(100, new Object()); + item.getItemProperty("column1").setValue("100"); + })); getLayout().addComponent(table); getLayout().addComponent(hl); diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/SetPageFirstItemLoadsNeededRowsOnly.java b/uitest/src/main/java/com/vaadin/tests/components/table/SetPageFirstItemLoadsNeededRowsOnly.java index 8027d5c572..ef32b22b6b 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/SetPageFirstItemLoadsNeededRowsOnly.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/SetPageFirstItemLoadsNeededRowsOnly.java @@ -10,7 +10,6 @@ import com.vaadin.ui.VerticalLayout; import com.vaadin.v7.data.util.BeanContainer; import com.vaadin.v7.ui.Table; - @SuppressWarnings("serial") public class SetPageFirstItemLoadsNeededRowsOnly extends AbstractReindeerTestUI { diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableAfterRemovingExpandRatios.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableAfterRemovingExpandRatios.java index 68d9107ae1..b648800435 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/TableAfterRemovingExpandRatios.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableAfterRemovingExpandRatios.java @@ -47,21 +47,19 @@ public class TableAfterRemovingExpandRatios extends AbstractReindeerTestUI { } private NativeButton createSetExpandRatiosButton(final Table table) { - NativeButton button = new NativeButton("Set expand", - event -> { - table.setColumnExpandRatio("column1", 1.0f); - table.setColumnExpandRatio("column2", 3.0f); - }); + NativeButton button = new NativeButton("Set expand", event -> { + table.setColumnExpandRatio("column1", 1.0f); + table.setColumnExpandRatio("column2", 3.0f); + }); button.setId("expand-button"); return button; } private NativeButton createUnsetExpandRatiosButton(final Table table) { - NativeButton button = new NativeButton("Unset expand", - event -> { - table.setColumnExpandRatio("column1", -1); - table.setColumnExpandRatio("column2", -1); - }); + NativeButton button = new NativeButton("Unset expand", event -> { + table.setColumnExpandRatio("column1", -1); + table.setColumnExpandRatio("column2", -1); + }); button.setId("unexpand-button"); return button; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableChildMeasurementHint.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableChildMeasurementHint.java index eabbe16bba..0792fb1f6a 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/TableChildMeasurementHint.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableChildMeasurementHint.java @@ -45,23 +45,20 @@ public class TableChildMeasurementHint extends AbstractReindeerTestUI { table3.setSizeFull(); table3.setChildMeasurementHint(ChildMeasurementHint.MEASURE_NEVER); - buttonLayout - .addComponent(new Button("Show table1", event -> { - layout.addComponent(table1); - table1.focus(); - })); - buttonLayout - .addComponent(new Button("Show table2", event -> { - layout.removeComponent(table1); - layout.addComponent(table2); - table2.focus(); - })); - buttonLayout - .addComponent(new Button("Show table3", event -> { - layout.removeComponent(table2); - layout.addComponent(table3); - table3.focus(); - })); + buttonLayout.addComponent(new Button("Show table1", event -> { + layout.addComponent(table1); + table1.focus(); + })); + buttonLayout.addComponent(new Button("Show table2", event -> { + layout.removeComponent(table1); + layout.addComponent(table2); + table2.focus(); + })); + buttonLayout.addComponent(new Button("Show table3", event -> { + layout.removeComponent(table2); + layout.addComponent(table3); + table3.focus(); + })); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java index 691d0d316d..d016f40b7e 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java @@ -61,9 +61,8 @@ public class TableClickValueChangeInteraction extends TestBase { }); } if (listenValueChanges) { - table.addValueChangeListener(event -> - valueChangeLabel.setValue( - "Value " + event.getProperty().getValue())); + table.addValueChangeListener(event -> valueChangeLabel + .setValue("Value " + event.getProperty().getValue())); } Layout result = new VerticalLayout(); diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableMatchesMouseDownMouseUpElement.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableMatchesMouseDownMouseUpElement.java index 344a0607da..2a2e9059d3 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/TableMatchesMouseDownMouseUpElement.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableMatchesMouseDownMouseUpElement.java @@ -50,10 +50,9 @@ public class TableMatchesMouseDownMouseUpElement item = table.addItem("Item 2 (row 2)"); item.getItemProperty("Column 1").setValue("String B"); item.getItemProperty("Column 2").setValue(new Label("Label B")); - item.getItemProperty("Column 3") - .setValue(new Label( - "<a style=\"color: blue\" href=\"javascript:false\">Label B</a>", - ContentMode.HTML)); + item.getItemProperty("Column 3").setValue(new Label( + "<a style=\"color: blue\" href=\"javascript:false\">Label B</a>", + ContentMode.HTML)); l = new VerticalLayout(); l.setId("row-2"); l.setSizeFull(); diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableMoveFocusWithSelection.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableMoveFocusWithSelection.java index f3b69ec11f..58651846eb 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/TableMoveFocusWithSelection.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableMoveFocusWithSelection.java @@ -50,8 +50,9 @@ public class TableMoveFocusWithSelection extends AbstractReindeerTestUI { addComponent(t); // Select mode - Button toggleSelectMode = new Button(t.isMultiSelect() - ? "Press to use single select" : "Press to use multi select"); + Button toggleSelectMode = new Button( + t.isMultiSelect() ? "Press to use single select" + : "Press to use multi select"); toggleSelectMode.setId("toggle-mode"); toggleSelectMode.addClickListener(event -> { t.setMultiSelect(!t.isMultiSelect()); diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableRepairsScrollPositionOnReAddingAllRows.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableRepairsScrollPositionOnReAddingAllRows.java index 56b4e52ee4..fc98997505 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/TableRepairsScrollPositionOnReAddingAllRows.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableRepairsScrollPositionOnReAddingAllRows.java @@ -53,59 +53,55 @@ public class TableRepairsScrollPositionOnReAddingAllRows "Replace by another items (via addAll())"); buttonReplaceByAnotherCollectionViaAddAll .setId("buttonReplaceByAnotherCollectionViaAddAll"); - buttonReplaceByAnotherCollectionViaAddAll - .addClickListener(event -> { - cont.removeAllItems(); - // create new collection (of different items) with other - // size - List<TableItem> itemList = new ArrayList<>(); - for (int i = 0; i < 79; i++) { - TableItem ti = new TableItem(); - ti.setName("AnotherItem1_" + i); - itemList.add(ti); - } - cont.addAll(itemList); - }); + buttonReplaceByAnotherCollectionViaAddAll.addClickListener(event -> { + cont.removeAllItems(); + // create new collection (of different items) with other + // size + List<TableItem> itemList = new ArrayList<>(); + for (int i = 0; i < 79; i++) { + TableItem ti = new TableItem(); + ti.setName("AnotherItem1_" + i); + itemList.add(ti); + } + cont.addAll(itemList); + }); Button buttonReplaceByAnotherCollectionViaAdd = new Button( "Replace by another items (via add(), add()..)"); buttonReplaceByAnotherCollectionViaAdd .setId("buttonReplaceByAnotherCollectionViaAdd"); - buttonReplaceByAnotherCollectionViaAdd - .addClickListener(event -> { - cont.removeAllItems(); - for (int i = 0; i < 81; i++) { - TableItem ti = new TableItem(); - ti.setName("AnotherItem2_" + i); - // add one by one in container - cont.addBean(ti); - } - }); + buttonReplaceByAnotherCollectionViaAdd.addClickListener(event -> { + cont.removeAllItems(); + for (int i = 0; i < 81; i++) { + TableItem ti = new TableItem(); + ti.setName("AnotherItem2_" + i); + // add one by one in container + cont.addBean(ti); + } + }); Button buttonReplaceBySubsetOfSmallerSize = new Button( "Replace rows by sub-set of smaller size (size not enought for restoring scroll position)"); buttonReplaceBySubsetOfSmallerSize .setId("buttonReplaceBySubsetOfSmallerSize"); - buttonReplaceBySubsetOfSmallerSize - .addClickListener(event -> { - cont.removeAllItems(); - cont.addAll(restoringItemList.subList(0, 20)); - }); + buttonReplaceBySubsetOfSmallerSize.addClickListener(event -> { + cont.removeAllItems(); + cont.addAll(restoringItemList.subList(0, 20)); + }); Button buttonReplaceByWholeSubsetPlusOneNew = new Button( "Replace rows by whole subset plus one new item"); buttonReplaceByWholeSubsetPlusOneNew .setId("buttonReplaceByWholeSubsetPlusOneNew"); - buttonReplaceByWholeSubsetPlusOneNew - .addClickListener(event -> { - cont.removeAllItems(); - - List<TableItem> list = new ArrayList<>(restoringItemList); - TableItem ti = new TableItem(); - ti.setName("AnotherItem3_" + 80); - list.add(ti); - cont.addAll(list); - }); + buttonReplaceByWholeSubsetPlusOneNew.addClickListener(event -> { + cont.removeAllItems(); + + List<TableItem> list = new ArrayList<>(restoringItemList); + TableItem ti = new TableItem(); + ti.setName("AnotherItem3_" + 80); + list.add(ti); + cont.addAll(list); + }); Button buttonRemoveAllAddOne = new Button( "Remove all items and add only one new item"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableScrollAfterAddRow.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableScrollAfterAddRow.java index 1da19b6a6c..920ab4dcc4 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/TableScrollAfterAddRow.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableScrollAfterAddRow.java @@ -50,9 +50,8 @@ public class TableScrollAfterAddRow extends AbstractReindeerTestUI { "Jump to first row", event -> jumpToFirstRow(table)); NativeButton updateLabelButton = new NativeButton("UpdateLabel", - event -> - label.setValue(Integer.toString( - table.getCurrentPageFirstItemIndex()))); + event -> label.setValue(Integer + .toString(table.getCurrentPageFirstItemIndex()))); layout.addComponent(addRowButton); layout.addComponent(jumpToLastRowButton); layout.addComponent(jumpTo15thRowButton); diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableSetUndefinedSize.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableSetUndefinedSize.java index 5d9a127650..67da05cd40 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/TableSetUndefinedSize.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableSetUndefinedSize.java @@ -35,9 +35,8 @@ public class TableSetUndefinedSize extends AbstractReindeerTestUI { new Button("width 500px", event -> table.setWidth("500px"))); layout.addComponent( new Button("width 100%", event -> table.setWidth("100%"))); - layout.addComponent( - new Button("undefined width", - event -> table.setWidthUndefined())); + layout.addComponent(new Button("undefined width", + event -> table.setWidthUndefined())); return layout; } @@ -51,9 +50,8 @@ public class TableSetUndefinedSize extends AbstractReindeerTestUI { new Button("height 300px", event -> table.setHeight("300px"))); layout.addComponent( new Button("height 100%", event -> table.setHeight("100%"))); - layout.addComponent( - new Button("undefined height", - event -> table.setHeightUndefined())); + layout.addComponent(new Button("undefined height", + event -> table.setHeightUndefined())); return layout; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.java index db9298cdaa..3056a6e540 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.java @@ -24,8 +24,8 @@ public class TableShouldNotEatValueChanges extends TestBase { final TextField tf = new TextField(); tf.setTabIndex(1); - ItemClickListener l = event -> - Notification.show("TF Value on the server:" + tf.getValue(), + ItemClickListener l = event -> Notification.show( + "TF Value on the server:" + tf.getValue(), Notification.TYPE_WARNING_MESSAGE); t.addListener(l); addComponent(tf); diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableUndefinedSize.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableUndefinedSize.java index 441730c101..6c39850274 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/TableUndefinedSize.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableUndefinedSize.java @@ -33,25 +33,22 @@ public class TableUndefinedSize extends TestBase { log = new Log(5); - controls.addComponent( - new Button("Fixed size (200x200)", event -> { - tbl.setWidth("200px"); - tbl.setHeight("200px"); - log.log("Size 200x200 pixels"); - })); - - controls.addComponent( - new Button("Fixed size (600x200)", event -> { - tbl.setWidth("600px"); - tbl.setHeight("200px"); - log.log("Size 600x200 pixels"); - })); - - controls.addComponent( - new Button("Undefined size", event -> { - tbl.setSizeUndefined(); - log.log("Size undefined"); - })); + controls.addComponent(new Button("Fixed size (200x200)", event -> { + tbl.setWidth("200px"); + tbl.setHeight("200px"); + log.log("Size 200x200 pixels"); + })); + + controls.addComponent(new Button("Fixed size (600x200)", event -> { + tbl.setWidth("600px"); + tbl.setHeight("200px"); + log.log("Size 600x200 pixels"); + })); + + controls.addComponent(new Button("Undefined size", event -> { + tbl.setSizeUndefined(); + log.log("Size undefined"); + })); NativeSelect pageLength = new NativeSelect("PageLength", Arrays.asList(0, 1, 2, 4, 8, 10)); diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableUnregisterComponent.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableUnregisterComponent.java index 166dcd2cea..8d852e5438 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/TableUnregisterComponent.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableUnregisterComponent.java @@ -74,9 +74,8 @@ public class TableUnregisterComponent extends TestBase { addComponent(log); addComponent(table); - addComponent(new Button("Switch column collapse", - event -> table.setColumnCollapsed(COL_A, - !table.isColumnCollapsed(COL_A)))); + addComponent(new Button("Switch column collapse", event -> table + .setColumnCollapsed(COL_A, !table.isColumnCollapsed(COL_A)))); addComponent(new Button("Switch editable", event -> table.setEditable(!table.isEditable()))); diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableWidthItemRemove.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableWidthItemRemove.java index 0a9bc1752b..0b60786e3b 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/TableWidthItemRemove.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableWidthItemRemove.java @@ -30,9 +30,10 @@ public class TableWidthItemRemove extends AbstractReindeerTestUI { addButton("Clean", event -> table.removeAllItems()); - addButton("Populate", event -> - table.addItem(new Object[] { "John", "Doe", new Integer(1980) }, - Math.random() * 1000)); + addButton("Populate", + event -> table.addItem( + new Object[] { "John", "Doe", new Integer(1980) }, + Math.random() * 1000)); addComponent(table); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.java index 501757a281..04713ccd06 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.java @@ -82,11 +82,10 @@ public class TableWithBrokenGeneratorAndContainer extends TestBase { table.addGeneratedColumn("Gen", new BrokenColumnGenerator(4)); table.setPageLength(20); - Button refreshTableCache = new Button("Refresh table cache", - event -> { - table.markAsDirty(); - table.refreshRowCache(); - }); + Button refreshTableCache = new Button("Refresh table cache", event -> { + table.markAsDirty(); + table.refreshRowCache(); + }); addComponent(refreshTableCache); addComponent(brokenContainer); addComponent(brokenGenerator); diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableWithContainerRequiringEqualsForItemId.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableWithContainerRequiringEqualsForItemId.java index faa58789d6..15dff13397 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/TableWithContainerRequiringEqualsForItemId.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableWithContainerRequiringEqualsForItemId.java @@ -55,9 +55,8 @@ public class TableWithContainerRequiringEqualsForItemId public Component generateCell(final Table source, final Object itemId, final Object columnId) { Button tripFolderLink = new Button("Button" + itemId); - tripFolderLink.addClickListener(event -> - log.log("Button " + event.getButton().getCaption() - + " clicked")); + tripFolderLink.addClickListener(event -> log.log("Button " + + event.getButton().getCaption() + " clicked")); tripFolderLink.setStyleName(Reindeer.BUTTON_SMALL); return tripFolderLink; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableWithNoncollapsibleColumns.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableWithNoncollapsibleColumns.java index e9a649a1b9..df27be3e3f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/TableWithNoncollapsibleColumns.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableWithNoncollapsibleColumns.java @@ -30,23 +30,21 @@ public class TableWithNoncollapsibleColumns extends TestBase { final Button button1 = new Button("Column 1: collapse/show", event -> table.setColumnCollapsed("Column 1 - noncollapsible", - !table.isColumnCollapsed( - "Column 1 - noncollapsible"))); + !table.isColumnCollapsed("Column 1 - noncollapsible"))); final Button button2 = new Button("Column 2: collapse/show", event -> table.setColumnCollapsed("Column 2 - collapsible", - !table.isColumnCollapsed( - "Column 2 - collapsible"))); + !table.isColumnCollapsed("Column 2 - collapsible"))); final Button button3 = new Button("Column 3: collapse/show", event -> table.setColumnCollapsed( "Column 3 - toggle collapsing", - !table.isColumnCollapsed( + !table.isColumnCollapsed( "Column 3 - toggle collapsing"))); final Button button4 = new Button( "Column 3: make noncollapsible/collapsible", event -> table.setColumnCollapsible( - "Column 3 - toggle collapsing", - !table.isColumnCollapsible( + "Column 3 - toggle collapsing", + !table.isColumnCollapsible( "Column 3 - toggle collapsing"))); layout.addComponent(button1); diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/Tables.java b/uitest/src/main/java/com/vaadin/tests/components/table/Tables.java index 3f7b2837a1..7083fbba7e 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/Tables.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/Tables.java @@ -854,8 +854,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T> "Multi - ctrl/shift", new Command<T, SelectMode>() { @Override - public void execute(T t, SelectMode value, - Object data) { + public void execute(T t, SelectMode value, Object data) { switch (value) { case NONE: t.setSelectable(false); diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/ValueAfterClearingContainer.java b/uitest/src/main/java/com/vaadin/tests/components/table/ValueAfterClearingContainer.java index e8807a6d7d..eec32c802f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/ValueAfterClearingContainer.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/ValueAfterClearingContainer.java @@ -33,18 +33,16 @@ public class ValueAfterClearingContainer extends TestBase { table.setMultiSelect(value == null ? false : value); }); addComponent(multiselect); - Button addItemsButton = new Button("Add table items", - event -> { - if (!table.getItemIds().isEmpty()) { - Notification - .show("Only possible when the table is empty"); - return; - } - for (int i = 0; i < 5; i++) { - table.addItem(new Object[] { Integer.valueOf(i) }, - Integer.valueOf(i)); - } - }); + Button addItemsButton = new Button("Add table items", event -> { + if (!table.getItemIds().isEmpty()) { + Notification.show("Only possible when the table is empty"); + return; + } + for (int i = 0; i < 5; i++) { + table.addItem(new Object[] { Integer.valueOf(i) }, + Integer.valueOf(i)); + } + }); addItemsButton.setId("addItemsButton"); addComponent(addItemsButton); @@ -64,8 +62,7 @@ public class ValueAfterClearingContainer extends TestBase { removeItemsFromContainerButton.setId("removeItemsFromContainerButton"); addComponent(removeItemsFromContainerButton); Button removeItemsFromContainerAndSanitizeButton = new Button( - "Remove items from container and sanitize", - event -> { + "Remove items from container and sanitize", event -> { table.getContainerDataSource().removeAllItems(); table.sanitizeSelection(); }); @@ -84,8 +81,7 @@ public class ValueAfterClearingContainer extends TestBase { removeSelectedFromTableButton.setId("removeSelectedFromTableButton"); addComponent(removeSelectedFromTableButton); Button removeSelectedFromContainer = new Button( - "Remove selected item from container", - event -> { + "Remove selected item from container", event -> { Object selection = table.getValue(); if (selection == null) { Notification.show("There is no selection"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/AddAndRemoveTabs.java b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/AddAndRemoveTabs.java index 758f5c4cf8..b04b476e59 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/AddAndRemoveTabs.java +++ b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/AddAndRemoveTabs.java @@ -16,8 +16,7 @@ public class AddAndRemoveTabs extends TestBase { addTab(); addComponent(tabSheet); - Button addTabBtn = new Button("Add new tab", - event -> addTab()); + Button addTabBtn = new Button("Add new tab", event -> addTab()); addComponent(addTabBtn); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheet.java b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheet.java index d93d18e7d6..76a3ec10a2 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheet.java +++ b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheet.java @@ -24,9 +24,8 @@ public class FirstTabNotVisibleInTabsheet extends AbstractReindeerTestUI { tabSheet.addTab(new Label("visible tab " + i), "visible tab " + i); } - addComponent(new VerticalLayout(tabSheet, - new Button("Toggle first tab", - event -> firstTab.setVisible(!firstTab.isVisible())))); + addComponent(new VerticalLayout(tabSheet, new Button("Toggle first tab", + event -> firstTab.setVisible(!firstTab.isVisible())))); } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabBarWidth.java b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabBarWidth.java index 079e6a098d..ceb331ff5c 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabBarWidth.java +++ b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabBarWidth.java @@ -67,8 +67,9 @@ public class TabBarWidth extends AbstractReindeerTestUI { String originalWidth = (String) ((TabSheet) component) .getData(); component.setWidth(originalWidth); - component.setCaption("Width: " + (originalWidth == null - ? "undefined" : originalWidth)); + component.setCaption( + "Width: " + (originalWidth == null ? "undefined" + : originalWidth)); } } } diff --git a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabDescriptionContentMode.java b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabDescriptionContentMode.java index e398532f3e..4ccc864474 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabDescriptionContentMode.java +++ b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabDescriptionContentMode.java @@ -34,10 +34,9 @@ public class TabDescriptionContentMode extends AbstractTestUI { Button changeFourthTabDescription = new Button( "Change fourth tab description"); - changeFourthTabDescription.addClickListener( - event -> fourthTab.setDescription( - "Fourth tab description, changed", - ContentMode.TEXT)); + changeFourthTabDescription + .addClickListener(event -> fourthTab.setDescription( + "Fourth tab description, changed", ContentMode.TEXT)); addComponents(tabSheet, changeFourthTabDescription); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabGetAndReplaceComponent.java b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabGetAndReplaceComponent.java index 268ed70df2..0f22044af1 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabGetAndReplaceComponent.java +++ b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabGetAndReplaceComponent.java @@ -22,18 +22,17 @@ public class TabGetAndReplaceComponent extends TestBase { tabs.addTab(new Label("Content 5"), "Content 5", null); addComponent(tabs); - Button replace2 = new Button("Replace Content 2", - event -> { - Iterator<Component> iter = tabs.getComponentIterator(); - iter.next(); - - Component content2 = iter.next(); - Tab tab = tabs.getTab(content2); - - // Replace content - tabs.replaceComponent(tab.getComponent(), - new Label("Replacement 2")); - }); + Button replace2 = new Button("Replace Content 2", event -> { + Iterator<Component> iter = tabs.getComponentIterator(); + iter.next(); + + Component content2 = iter.next(); + Tab tab = tabs.getTab(content2); + + // Replace content + tabs.replaceComponent(tab.getComponent(), + new Label("Replacement 2")); + }); addComponent(replace2); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabSheetCaptions.java b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabSheetCaptions.java index 4d43020496..75940e6bee 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabSheetCaptions.java +++ b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabSheetCaptions.java @@ -44,14 +44,12 @@ public class TabSheetCaptions extends TestBase { tabSheet.addTab(panel1); Button button = new Button("Update tab caption"); - button.addClickListener(event -> tabSheet.getTab(panel1) - .setCaption("This is a new tab caption " - + dateFormatter.format(date))); + button.addClickListener(event -> tabSheet.getTab(panel1).setCaption( + "This is a new tab caption " + dateFormatter.format(date))); Button button2 = new Button("Update panel caption"); button2.addClickListener(event -> panel1.setCaption( - "This is a new panel caption " - + dateFormatter.format(date))); + "This is a new panel caption " + dateFormatter.format(date))); addComponent(tabSheet); addComponent(button); diff --git a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabSheetDisabling.java b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabSheetDisabling.java index 3669808b6e..238c419e7a 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabSheetDisabling.java +++ b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabSheetDisabling.java @@ -15,11 +15,10 @@ public class TabSheetDisabling extends TestBase { tabSheet = new TabSheet(); for (int i = 0; i < NR_BUTTONS; i++) { if (i % 2 == 0) { - buttons[i] = new Button("Disable this tab", - event -> { - Button b = event.getButton(); - tabSheet.getTab(b).setEnabled(false); - }); + buttons[i] = new Button("Disable this tab", event -> { + Button b = event.getButton(); + tabSheet.getTab(b).setEnabled(false); + }); } else { buttons[i] = new Button("Hide this tab", event -> { Button b = event.getButton(); diff --git a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabSheetIndexOperations.java b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabSheetIndexOperations.java index d23b85b60a..1acb0a980b 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabSheetIndexOperations.java +++ b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabSheetIndexOperations.java @@ -21,12 +21,11 @@ public class TabSheetIndexOperations extends TestBase { addComponent(tabs); - Button addTab = new Button("Add tab at index 2", - event -> { - tabs.addTab(new Label("Content " + tabCounter), - "Added Tab " + tabCounter, null, 2); - tabCounter++; - }); + Button addTab = new Button("Add tab at index 2", event -> { + tabs.addTab(new Label("Content " + tabCounter), + "Added Tab " + tabCounter, null, 2); + tabCounter++; + }); addComponent(addTab); Button setCaption = new Button("Invert tab caption at index 2", @@ -37,9 +36,8 @@ public class TabSheetIndexOperations extends TestBase { }); addComponent(setCaption); - Button move = new Button("Move selected tab to index 2", - event -> tabs.setTabPosition(tabs.getTab(tabs.getSelectedTab()), - 2)); + Button move = new Button("Move selected tab to index 2", event -> tabs + .setTabPosition(tabs.getTab(tabs.getSelectedTab()), 2)); addComponent(move); Button getIndex = new Button("Get selected tab index", diff --git a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabsheetScrollIntoView.java b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabsheetScrollIntoView.java index 2fe29817dc..8edc0fdda6 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabsheetScrollIntoView.java +++ b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabsheetScrollIntoView.java @@ -27,11 +27,10 @@ public class TabsheetScrollIntoView extends AbstractReindeerTestUI { Layout buttonLayout = new VerticalLayout(); - buttonLayout - .addComponent(new Button("Hide TabSheet", event -> { - panel.setSplitPosition(100, Unit.PERCENTAGE); - panel.removeComponent(tabSheetInSplitPanel); - })); + buttonLayout.addComponent(new Button("Hide TabSheet", event -> { + panel.setSplitPosition(100, Unit.PERCENTAGE); + panel.removeComponent(tabSheetInSplitPanel); + })); Button showLast = new Button("Show TabSheet and select last tab", event -> { @@ -43,8 +42,8 @@ public class TabsheetScrollIntoView extends AbstractReindeerTestUI { showLast.setId(BTN_SELECT_LAST_TAB); buttonLayout.addComponent(showLast); - buttonLayout.addComponent(new Button( - "Show TabSheet and select first tab", event -> { + buttonLayout.addComponent( + new Button("Show TabSheet and select first tab", event -> { panel.setSecondComponent(tabSheetInSplitPanel); panel.setSplitPosition(250, Unit.PIXELS); tabSheetInSplitPanel.setSelectedTab(0); diff --git a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java index 8131fa8c01..8397f1d257 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java +++ b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java @@ -22,11 +22,10 @@ public class TabsheetShouldUpdateHeight extends TestBase { tabsOuter.addTab(tabsInner, "Inner tabs"); tabsOuter.addTab(getLayoutWithComponents(10, "tab1"), "Tab 1"); - final Button btnSwitch = new Button("switch to Tab2", - event -> { - tabsOuter.setSelectedTab(tabsInner); - tabsInner.setSelectedTab(tab2); - }); + final Button btnSwitch = new Button("switch to Tab2", event -> { + tabsOuter.setSelectedTab(tabsInner); + tabsInner.setSelectedTab(tab2); + }); addComponent(tabsOuter); addComponent(btnSwitch); diff --git a/uitest/src/main/java/com/vaadin/tests/components/textfield/AutomaticImmediate.java b/uitest/src/main/java/com/vaadin/tests/components/textfield/AutomaticImmediate.java index c30468004d..4bda8ee248 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/textfield/AutomaticImmediate.java +++ b/uitest/src/main/java/com/vaadin/tests/components/textfield/AutomaticImmediate.java @@ -14,7 +14,11 @@ import com.vaadin.v7.ui.TextField; * @since 7.2 * @author Vaadin Ltd */ -public class AutomaticImmediate extends AbstractTestUIWithLog { static final String BUTTON = "button"; static final String EXPLICIT_FALSE = "explicit-false"; static final String FIELD = "field"; static final String LISTENER_TOGGLE = "listener-toggle"; +public class AutomaticImmediate extends AbstractTestUIWithLog { + static final String BUTTON = "button"; + static final String EXPLICIT_FALSE = "explicit-false"; + static final String FIELD = "field"; + static final String LISTENER_TOGGLE = "listener-toggle"; /* * (non-Javadoc) @@ -58,9 +62,8 @@ public class AutomaticImmediate extends AbstractTestUIWithLog { static final event -> textField.setImmediate(false)); b.setId(EXPLICIT_FALSE); - Button b2 = new Button("Hit server, causes server roundtrip", - event -> { - }); + Button b2 = new Button("Hit server, causes server roundtrip", event -> { + }); b2.setId(BUTTON); addComponent(textField); diff --git a/uitest/src/main/java/com/vaadin/tests/components/textfield/TextFieldTruncatesUnderscoresInModalDialogs.java b/uitest/src/main/java/com/vaadin/tests/components/textfield/TextFieldTruncatesUnderscoresInModalDialogs.java index 8205c24852..1464601bef 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/textfield/TextFieldTruncatesUnderscoresInModalDialogs.java +++ b/uitest/src/main/java/com/vaadin/tests/components/textfield/TextFieldTruncatesUnderscoresInModalDialogs.java @@ -20,9 +20,8 @@ public class TextFieldTruncatesUnderscoresInModalDialogs FormLayout formLayout = new FormLayout(); formLayout.setSpacing(true); - formLayout.addComponent( - new Button("Disappear", - event -> event.getButton().setVisible(false))); + formLayout.addComponent(new Button("Disappear", + event -> event.getButton().setVisible(false))); formLayout.addComponent(new TextField(null, "____pqjgy____")); diff --git a/uitest/src/main/java/com/vaadin/tests/components/treegrid/LazyHierarchicalDataProvider.java b/uitest/src/main/java/com/vaadin/tests/components/treegrid/LazyHierarchicalDataProvider.java index 014ee7d1f0..ddf9eb35ba 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/treegrid/LazyHierarchicalDataProvider.java +++ b/uitest/src/main/java/com/vaadin/tests/components/treegrid/LazyHierarchicalDataProvider.java @@ -44,7 +44,8 @@ public class LazyHierarchicalDataProvider extends protected Stream<HierarchicalTestBean> fetchChildrenFromBackEnd( HierarchicalQuery<HierarchicalTestBean, Void> query) { final int depth = query.getParentOptional().isPresent() - ? query.getParent().getDepth() + 1 : 0; + ? query.getParent().getDepth() + 1 + : 0; final Optional<String> parentKey = query.getParentOptional() .flatMap(parent -> Optional.of(parent.getId())); diff --git a/uitest/src/main/java/com/vaadin/tests/components/treegrid/TreeGridExpandCollapseRecursively.java b/uitest/src/main/java/com/vaadin/tests/components/treegrid/TreeGridExpandCollapseRecursively.java index f85eba5815..ce9fa66922 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/treegrid/TreeGridExpandCollapseRecursively.java +++ b/uitest/src/main/java/com/vaadin/tests/components/treegrid/TreeGridExpandCollapseRecursively.java @@ -39,8 +39,7 @@ public class TreeGridExpandCollapseRecursively extends AbstractTestUI { return parent; } - public void setParent( - Directory parent) { + public void setParent(Directory parent) { this.parent = parent; } @@ -72,8 +71,8 @@ public class TreeGridExpandCollapseRecursively extends AbstractTestUI { depthSelector.setValue(3); HorizontalLayout buttons = new HorizontalLayout(); - buttons.addComponent(new Button("Expand recursively", e -> grid - .expandRecursively(roots, depthSelector.getValue()))); + buttons.addComponent(new Button("Expand recursively", + e -> grid.expandRecursively(roots, depthSelector.getValue()))); buttons.addComponent(new Button("Collapse recursively", e -> grid .collapseRecursively(roots, depthSelector.getValue()))); @@ -89,8 +88,7 @@ public class TreeGridExpandCollapseRecursively extends AbstractTestUI { Collection<Directory> dirs = new ArrayList<>(); if (depth >= 0) { for (int i = 0; i < childCount; i++) { - String name = parent != null - ? parent.getName() + "-" + i + String name = parent != null ? parent.getName() + "-" + i : "-" + i; Directory dir = new Directory(name, parent); if (parent != null) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/treegrid/TreeGridHugeTree.java b/uitest/src/main/java/com/vaadin/tests/components/treegrid/TreeGridHugeTree.java index e2eb2a1c78..396fc2cf0a 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/treegrid/TreeGridHugeTree.java +++ b/uitest/src/main/java/com/vaadin/tests/components/treegrid/TreeGridHugeTree.java @@ -11,8 +11,7 @@ import com.vaadin.ui.TreeGrid; @Theme("valo") @Widgetset("com.vaadin.DefaultWidgetSet") -public class TreeGridHugeTree - extends AbstractTestUI { +public class TreeGridHugeTree extends AbstractTestUI { private TreeGrid<String> treeGrid; private TreeDataProvider<String> inMemoryDataProvider; diff --git a/uitest/src/main/java/com/vaadin/tests/components/treegrid/TreeGridHugeTreeNavigation.java b/uitest/src/main/java/com/vaadin/tests/components/treegrid/TreeGridHugeTreeNavigation.java index 02bfd65a28..92b933406f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/treegrid/TreeGridHugeTreeNavigation.java +++ b/uitest/src/main/java/com/vaadin/tests/components/treegrid/TreeGridHugeTreeNavigation.java @@ -9,7 +9,8 @@ import com.vaadin.ui.TreeGrid; @Theme("valo") @Widgetset("com.vaadin.DefaultWidgetSet") -public class TreeGridHugeTreeNavigation extends AbstractComponentTest<TreeGrid> { +public class TreeGridHugeTreeNavigation + extends AbstractComponentTest<TreeGrid> { private TreeGrid<String> treeGrid; private TreeDataProvider<String> inMemoryDataProvider; diff --git a/uitest/src/main/java/com/vaadin/tests/components/treetable/ProgrammaticCollapse.java b/uitest/src/main/java/com/vaadin/tests/components/treetable/ProgrammaticCollapse.java index 78d96b974e..a5e52664fe 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/treetable/ProgrammaticCollapse.java +++ b/uitest/src/main/java/com/vaadin/tests/components/treetable/ProgrammaticCollapse.java @@ -29,18 +29,16 @@ public class ProgrammaticCollapse extends TestBase { } } layout.addComponent(table); - layout.addComponent( - new Button("Expand / Collapse", event -> { - boolean collapsed = !table.isCollapsed(1); - Notification.show("set collapsed: " + collapsed); - table.setCollapsed(1, collapsed); - })); - layout.addComponent( - new Button("Expand / Collapse last", event -> { - boolean collapsed = !table.isCollapsed(100); - Notification.show("set collapsed: " + collapsed); - table.setCollapsed(100, collapsed); - })); + layout.addComponent(new Button("Expand / Collapse", event -> { + boolean collapsed = !table.isCollapsed(1); + Notification.show("set collapsed: " + collapsed); + table.setCollapsed(1, collapsed); + })); + layout.addComponent(new Button("Expand / Collapse last", event -> { + boolean collapsed = !table.isCollapsed(100); + Notification.show("set collapsed: " + collapsed); + table.setCollapsed(100, collapsed); + })); layout.addComponent( new Button("Expand / Collapse multiple", new ClickListener() { private boolean collapsed = true; diff --git a/uitest/src/main/java/com/vaadin/tests/components/treetable/ProgrammaticSelect.java b/uitest/src/main/java/com/vaadin/tests/components/treetable/ProgrammaticSelect.java index 7882ddeb20..1bb3ba2f8b 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/treetable/ProgrammaticSelect.java +++ b/uitest/src/main/java/com/vaadin/tests/components/treetable/ProgrammaticSelect.java @@ -19,11 +19,10 @@ public class ProgrammaticSelect extends TestBase { tt.setSelectable(true); addComponent(tt); - Button selectItem = new Button("Select first row", - event -> { - Object id = tt.getItemIds().iterator().next(); - tt.select(id); - }); + Button selectItem = new Button("Select first row", event -> { + Object id = tt.getItemIds().iterator().next(); + tt.select(id); + }); addComponent(selectItem); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java b/uitest/src/main/java/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java index 88fc371764..3571cf9efa 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java +++ b/uitest/src/main/java/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java @@ -54,7 +54,8 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { @Override public String toString() { - return "HierarchicalTestBean [col1=" + col1 + ", col2=" + col2 + "]"; + return "HierarchicalTestBean [col1=" + col1 + ", col2=" + col2 + + "]"; } } @@ -68,10 +69,9 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { Button btnCol3 = new NativeButton(identifier); btnCol3.setId( "cacheTestButton-" + tb.getCol1() + "-" + tb.getCol2()); - btnCol3.addClickListener( - event -> log.log("Button " + event.getButton().getCaption() - + " clicked. Row index: " - + indexOfId(source, itemId))); + btnCol3.addClickListener(event -> log.log("Button " + + event.getButton().getCaption() + " clicked. Row index: " + + indexOfId(source, itemId))); return btnCol3; } @@ -105,10 +105,8 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { private TreeTable treeTable; private BeanItemContainer<TestBean> testBeanContainer; - private static String[] columnHeaders = { "Col1", "Col2", - "Col3", "Col4" }; - private static Object[] visibleColumns = { "col1", "col2", - "col3", "col4" }; + private static String[] columnHeaders = { "Col1", "Col2", "Col3", "Col4" }; + private static Object[] visibleColumns = { "col1", "col2", "col3", "col4" }; @Override public void setup() { diff --git a/uitest/src/main/java/com/vaadin/tests/components/ui/InitialFragmentEvent.java b/uitest/src/main/java/com/vaadin/tests/components/ui/InitialFragmentEvent.java index 78badb61ff..e12621afd2 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/ui/InitialFragmentEvent.java +++ b/uitest/src/main/java/com/vaadin/tests/components/ui/InitialFragmentEvent.java @@ -9,13 +9,12 @@ public class InitialFragmentEvent extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { - getPage().addUriFragmentChangedListener( - event -> { - String newFragment = event.getUriFragment(); - log("Fragment changed from " + lastKnownFragment + " to " - + newFragment); - lastKnownFragment = newFragment; - }); + getPage().addUriFragmentChangedListener(event -> { + String newFragment = event.getUriFragment(); + log("Fragment changed from " + lastKnownFragment + " to " + + newFragment); + lastKnownFragment = newFragment; + }); addButton("Set fragment to 'foo'", event -> setFragment("foo")); addButton("Set fragment to 'bar'", event -> setFragment("bar")); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/ui/RpcInvocationHandlerToString.java b/uitest/src/main/java/com/vaadin/tests/components/ui/RpcInvocationHandlerToString.java index b6459d4ff9..1e9ac7ce10 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/ui/RpcInvocationHandlerToString.java +++ b/uitest/src/main/java/com/vaadin/tests/components/ui/RpcInvocationHandlerToString.java @@ -12,12 +12,10 @@ public class RpcInvocationHandlerToString extends AbstractTestUIWithLog { protected void setup(VaadinRequest request) { addButton("Exec toString() for an invocation proxy", event -> log("An invoation proxy: " + dummyProxy)); - addButton("Exec hashCode() for an invocation proxy", - event -> log("Invocation proxy.hashCode(): " - + dummyProxy.hashCode())); - addButton("Exec equals(false) for an invocation proxy", - event -> log("Invocation proxy.equals(false): " - + dummyProxy.equals(false))); + addButton("Exec hashCode() for an invocation proxy", event -> log( + "Invocation proxy.hashCode(): " + dummyProxy.hashCode())); + addButton("Exec equals(false) for an invocation proxy", event -> log( + "Invocation proxy.equals(false): " + dummyProxy.equals(false))); } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/ui/UIAccess.java b/uitest/src/main/java/com/vaadin/tests/components/ui/UIAccess.java index c21fc59493..6bf0abc1f9 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/ui/UIAccess.java +++ b/uitest/src/main/java/com/vaadin/tests/components/ui/UIAccess.java @@ -35,135 +35,127 @@ public class UIAccess extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { - addComponent( - new Button("Access from UI thread", event -> { - log.clear(); - // Ensure beforeClientResponse is invoked - markAsDirty(); - checkFromBeforeClientResponse = access( - () -> log("Access from UI thread is run")); - log("Access from UI thread future is done? " - + checkFromBeforeClientResponse.isDone()); - })); - addComponent(new Button("Access from background thread", - event -> { - log.clear(); - final CountDownLatch latch = new CountDownLatch(1); + addComponent(new Button("Access from UI thread", event -> { + log.clear(); + // Ensure beforeClientResponse is invoked + markAsDirty(); + checkFromBeforeClientResponse = access( + () -> log("Access from UI thread is run")); + log("Access from UI thread future is done? " + + checkFromBeforeClientResponse.isDone()); + })); + addComponent(new Button("Access from background thread", event -> { + log.clear(); + final CountDownLatch latch = new CountDownLatch(1); - new Thread() { - @Override - public void run() { - final boolean threadHasCurrentResponse = VaadinService - .getCurrentResponse() != null; - // session is locked by request thread at this - // point - final Future<Void> initialFuture = access( - () -> { - log("Initial background message"); - log("Thread has current response? " - + threadHasCurrentResponse); - }); + new Thread() { + @Override + public void run() { + final boolean threadHasCurrentResponse = VaadinService + .getCurrentResponse() != null; + // session is locked by request thread at this + // point + final Future<Void> initialFuture = access(() -> { + log("Initial background message"); + log("Thread has current response? " + + threadHasCurrentResponse); + }); - // Let request thread continue - latch.countDown(); + // Let request thread continue + latch.countDown(); - // Wait until thread can be locked - while (!getSession().getLockInstance().tryLock()) { - try { - Thread.sleep(100); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - } - try { - log("Thread got lock, inital future done? " - + initialFuture.isDone()); - setPollInterval(-1); - } finally { - getSession().unlock(); - } + // Wait until thread can be locked + while (!getSession().getLockInstance().tryLock()) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + throw new RuntimeException(e); } - }.start(); + } + try { + log("Thread got lock, inital future done? " + + initialFuture.isDone()); + setPollInterval(-1); + } finally { + getSession().unlock(); + } + } + }.start(); + + // Wait for thread to do initialize before continuing + try { + latch.await(); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + + setPollInterval(3000); + })); + addComponent(new Button("Access throwing exception", event -> { + log.clear(); + final Future<Void> firstFuture = access(() -> { + log("Throwing exception in access"); + throw new RuntimeException("Catch me if you can"); + }); + access(() -> { + log("firstFuture is done? " + firstFuture.isDone()); + try { + firstFuture.get(); + log("Should not get here"); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } catch (ExecutionException e) { + log("Got exception from firstFuture: " + e.getMessage()); + } + }); + })); + addComponent(new Button("Cancel future before started", event -> { + log.clear(); + Future<Void> future = access(() -> log("Should not get here")); + future.cancel(false); + log("future was cancelled, should not start"); + })); + addComponent(new Button("Cancel running future", event -> { + log.clear(); + final ReentrantLock interruptLock = new ReentrantLock(); - // Wait for thread to do initialize before continuing + final Future<Void> future = access(() -> { + log("Waiting for thread to start"); + while (!interruptLock.isLocked()) { try { - latch.await(); + Thread.sleep(100); } catch (InterruptedException e) { + log("Premature interruption"); throw new RuntimeException(e); } + } - setPollInterval(3000); - })); - addComponent(new Button("Access throwing exception", - event -> { - log.clear(); - final Future<Void> firstFuture = access(() -> { - log("Throwing exception in access"); - throw new RuntimeException("Catch me if you can"); - }); - access(() -> { - log("firstFuture is done? " + firstFuture.isDone()); - try { - firstFuture.get(); - log("Should not get here"); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } catch (ExecutionException e) { - log("Got exception from firstFuture: " - + e.getMessage()); - } - }); - })); - addComponent(new Button("Cancel future before started", - event -> { - log.clear(); - Future<Void> future = access( - () -> log("Should not get here")); - future.cancel(false); - log("future was cancelled, should not start"); - })); - addComponent( - new Button("Cancel running future", event -> { - log.clear(); - final ReentrantLock interruptLock = new ReentrantLock(); - - final Future<Void> future = access(() -> { - log("Waiting for thread to start"); - while (!interruptLock.isLocked()) { - try { - Thread.sleep(100); - } catch (InterruptedException e) { - log("Premature interruption"); - throw new RuntimeException(e); - } - } + log("Thread started, waiting for interruption"); + try { + interruptLock.lockInterruptibly(); + } catch (InterruptedException e) { + log("I was interrupted"); + } + }); - log("Thread started, waiting for interruption"); + new Thread() { + @Override + public void run() { + interruptLock.lock(); + // Wait until UI thread has started waiting for + // the lock + while (!interruptLock.hasQueuedThreads()) { try { - interruptLock.lockInterruptibly(); + Thread.sleep(100); } catch (InterruptedException e) { - log("I was interrupted"); + throw new RuntimeException(e); } - }); - - new Thread() { - @Override - public void run() { - interruptLock.lock(); - // Wait until UI thread has started waiting for - // the lock - while (!interruptLock.hasQueuedThreads()) { - try { - Thread.sleep(100); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - } + } - future.cancel(true); - } - }.start(); - })); + future.cancel(true); + } + }.start(); + })); addComponent(new Button("CurrentInstance accessSynchronously values", event -> { log.clear(); @@ -187,66 +179,61 @@ public class UIAccess extends AbstractTestUIWithLog { + CurrentInstance .get(CurrentInstanceTestType.class)); })); - addComponent(new Button("CurrentInstance access values", - event -> { - log.clear(); - // accessSynchronously should maintain values - CurrentInstance.set(CurrentInstanceTestType.class, - new CurrentInstanceTestType("Set before access")); - access(() -> { - log.log("access has request? " - + (VaadinService.getCurrentRequest() != null)); - log.log("Test value in access: " + CurrentInstance - .get(CurrentInstanceTestType.class)); - CurrentInstance.set(CurrentInstanceTestType.class, - new CurrentInstanceTestType("Set in access")); - }); - CurrentInstance.set(CurrentInstanceTestType.class, - new CurrentInstanceTestType( - "Set before run pending")); + addComponent(new Button("CurrentInstance access values", event -> { + log.clear(); + // accessSynchronously should maintain values + CurrentInstance.set(CurrentInstanceTestType.class, + new CurrentInstanceTestType("Set before access")); + access(() -> { + log.log("access has request? " + + (VaadinService.getCurrentRequest() != null)); + log.log("Test value in access: " + + CurrentInstance.get(CurrentInstanceTestType.class)); + CurrentInstance.set(CurrentInstanceTestType.class, + new CurrentInstanceTestType("Set in access")); + }); + CurrentInstance.set(CurrentInstanceTestType.class, + new CurrentInstanceTestType("Set before run pending")); - getSession().getService() - .runPendingAccessTasks(getSession()); + getSession().getService().runPendingAccessTasks(getSession()); - log.log("has request after access? " - + (VaadinService.getCurrentRequest() != null)); - log("Test value after access: " + CurrentInstance - .get(CurrentInstanceTestType.class)); - })); + log.log("has request after access? " + + (VaadinService.getCurrentRequest() != null)); + log("Test value after access: " + + CurrentInstance.get(CurrentInstanceTestType.class)); + })); - addComponent(new Button("CurrentInstance when pushing", - event -> { - log.clear(); - if (getPushConfiguration() - .getPushMode() != PushMode.AUTOMATIC) { - log("Can only test with automatic push enabled"); - return; - } + addComponent(new Button("CurrentInstance when pushing", event -> { + log.clear(); + if (getPushConfiguration().getPushMode() != PushMode.AUTOMATIC) { + log("Can only test with automatic push enabled"); + return; + } - final VaadinSession session = getSession(); - new Thread() { - @Override - public void run() { - // Pretend this isn't a Vaadin thread - CurrentInstance.clearAll(); + final VaadinSession session = getSession(); + new Thread() { + @Override + public void run() { + // Pretend this isn't a Vaadin thread + CurrentInstance.clearAll(); - /* - * Get explicit lock to ensure the (implicit) push - * does not happen during normal request handling. - */ - session.lock(); - try { - access(() -> { - checkCurrentInstancesBeforeResponse = true; - // Trigger beforeClientResponse - markAsDirty(); - }); - } finally { - session.unlock(); - } - } - }.start(); - })); + /* + * Get explicit lock to ensure the (implicit) push does not + * happen during normal request handling. + */ + session.lock(); + try { + access(() -> { + checkCurrentInstancesBeforeResponse = true; + // Trigger beforeClientResponse + markAsDirty(); + }); + } finally { + session.unlock(); + } + } + }.start(); + })); } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/ui/UIAccessExceptionHandling.java b/uitest/src/main/java/com/vaadin/tests/components/ui/UIAccessExceptionHandling.java index 5f08bdbc62..bb229aa13c 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/ui/UIAccessExceptionHandling.java +++ b/uitest/src/main/java/com/vaadin/tests/components/ui/UIAccessExceptionHandling.java @@ -22,8 +22,8 @@ public class UIAccessExceptionHandling extends AbstractTestUIWithLog protected void setup(VaadinRequest request) { getSession().setErrorHandler(this); - addComponent(new Button("Throw RuntimeException on UI.access", - event -> { + addComponent( + new Button("Throw RuntimeException on UI.access", event -> { log.clear(); // Ensure beforeClientResponse is invoked @@ -48,29 +48,27 @@ public class UIAccessExceptionHandling extends AbstractTestUIWithLog }); })); - addComponent( - new Button("Throw RuntimeException after removing instances", - event -> { - log.clear(); + addComponent(new Button( + "Throw RuntimeException after removing instances", event -> { + log.clear(); - // Ensure beforeClientResponse is invoked - markAsDirty(); + // Ensure beforeClientResponse is invoked + markAsDirty(); - assert UI - .getCurrent() == UIAccessExceptionHandling.this; + assert UI.getCurrent() == UIAccessExceptionHandling.this; - Map<Class<?>, CurrentInstance> instances = CurrentInstance - .getInstances(); - CurrentInstance.clearAll(); + Map<Class<?>, CurrentInstance> instances = CurrentInstance + .getInstances(); + CurrentInstance.clearAll(); - assert UI.getCurrent() == null; + assert UI.getCurrent() == null; - future = access(() -> { - throw new RuntimeException(); - }); + future = access(() -> { + throw new RuntimeException(); + }); - CurrentInstance.restoreInstances(instances); - })); + CurrentInstance.restoreInstances(instances); + })); addComponent(new Button("Clear", event -> log.clear())); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/uitest/BackButtonTest.java b/uitest/src/main/java/com/vaadin/tests/components/uitest/BackButtonTest.java index 6c56d250f7..7961a683b5 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/uitest/BackButtonTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/uitest/BackButtonTest.java @@ -26,17 +26,16 @@ public class BackButtonTest extends AbstractReindeerTestUI { addComponent(p1); p2 = new Page2(); - getPage().addUriFragmentChangedListener( - event -> { - String f = event.getUriFragment(); - if ("page2".equals(f)) { - showPage2(); - } - - if ("page1".equals(f)) { - showPage1(); - } - }); + getPage().addUriFragmentChangedListener(event -> { + String f = event.getUriFragment(); + if ("page2".equals(f)) { + showPage2(); + } + + if ("page1".equals(f)) { + showPage1(); + } + }); } class Page1 extends VerticalLayout { diff --git a/uitest/src/main/java/com/vaadin/tests/components/uitest/UIScrolling.java b/uitest/src/main/java/com/vaadin/tests/components/uitest/UIScrolling.java index 89f84e5ae1..e9f3d97f1f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/uitest/UIScrolling.java +++ b/uitest/src/main/java/com/vaadin/tests/components/uitest/UIScrolling.java @@ -17,8 +17,7 @@ public class UIScrolling extends AbstractReindeerTestUI { addComponent(new Button( "This button is halfway down. Click to report scroll position.", event -> Notification.show("Scrolled to " - + event.getButton().getUI().getScrollTop() - + " px"))); + + event.getButton().getUI().getScrollTop() + " px"))); } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/DatesCssTest.java b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/DatesCssTest.java index 39d9544c53..ec35e282c6 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/DatesCssTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/DatesCssTest.java @@ -29,7 +29,8 @@ public class DatesCssTest extends GridLayout { createDateFieldWith("Small", ChameleonTheme.DATEFIELD_SMALL, null); createDateFieldWith("Big", ChameleonTheme.DATEFIELD_BIG, null); - AbstractDateField<LocalDate, DateResolution> df = new DateField("Popup date field"); + AbstractDateField<LocalDate, DateResolution> df = new DateField( + "Popup date field"); df.setId("datefield" + debugIdCounter++); df.setValue(date); addComponent(df); @@ -48,7 +49,8 @@ public class DatesCssTest extends GridLayout { private void createDateFieldWith(String caption, String primaryStyleName, String width) { - AbstractDateField<LocalDate, DateResolution> df = new TestDateField("Date field"); + AbstractDateField<LocalDate, DateResolution> df = new TestDateField( + "Date field"); df.setId("datefield" + debugIdCounter++); df.setValue(date); diff --git a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/TablesCssTest.java b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/TablesCssTest.java index 2ccb8a821a..c29bb4be8a 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/TablesCssTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/TablesCssTest.java @@ -19,10 +19,8 @@ public class TablesCssTest extends GridLayout { private final Action ACTION_MARK = new Action("Mark"); private final Action ACTION_UNMARK = new Action("Unmark"); private final Action ACTION_LOG = new Action("Save"); - private final Action[] ACTIONS_UNMARKED = { ACTION_MARK, - ACTION_LOG }; - private final Action[] ACTIONS_MARKED = { ACTION_UNMARK, - ACTION_LOG }; + private final Action[] ACTIONS_UNMARKED = { ACTION_MARK, ACTION_LOG }; + private final Action[] ACTIONS_MARKED = { ACTION_UNMARK, ACTION_LOG }; public TablesCssTest(TestSampler parent) { super(); diff --git a/uitest/src/main/java/com/vaadin/tests/components/upload/TestUploadAndDisableOnSuccess.java b/uitest/src/main/java/com/vaadin/tests/components/upload/TestUploadAndDisableOnSuccess.java index 00c99a6dc1..6247b524f3 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/upload/TestUploadAndDisableOnSuccess.java +++ b/uitest/src/main/java/com/vaadin/tests/components/upload/TestUploadAndDisableOnSuccess.java @@ -70,9 +70,8 @@ public class TestUploadAndDisableOnSuccess extends ComponentTestCase<Upload> @Override protected List<Component> createActions() { List<Component> actions = new ArrayList<>(); - actions.add(createButtonAction("Toggle Enabled", - (upload, value, data) -> upload - .setEnabled(!upload.isEnabled()))); + actions.add(createButtonAction("Toggle Enabled", (upload, value, + data) -> upload.setEnabled(!upload.isEnabled()))); return actions; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/upload/UploadInTabsheet.java b/uitest/src/main/java/com/vaadin/tests/components/upload/UploadInTabsheet.java index e1dd458a27..dfbc7ea322 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/upload/UploadInTabsheet.java +++ b/uitest/src/main/java/com/vaadin/tests/components/upload/UploadInTabsheet.java @@ -19,12 +19,12 @@ public class UploadInTabsheet extends AbstractReindeerTestUI { @Override protected void setup(VaadinRequest request) { TabSheet t = new TabSheet(); - Upload upload = new Upload("Upload", (filename, mimeType) -> new - ByteArrayOutputStream()); + Upload upload = new Upload("Upload", + (filename, mimeType) -> new ByteArrayOutputStream()); upload.setImmediateMode(false); - upload.addSucceededListener(event -> upload.getUI().access(()->{ - t.setSelectedTab(1); - })); + upload.addSucceededListener(event -> upload.getUI().access(() -> { + t.setSelectedTab(1); + })); upload.setWidthUndefined(); t.addComponent(upload); diff --git a/uitest/src/main/java/com/vaadin/tests/components/upload/UploadInTabsheetV7.java b/uitest/src/main/java/com/vaadin/tests/components/upload/UploadInTabsheetV7.java index 64de1cde1d..f93ecc9964 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/upload/UploadInTabsheetV7.java +++ b/uitest/src/main/java/com/vaadin/tests/components/upload/UploadInTabsheetV7.java @@ -19,12 +19,12 @@ public class UploadInTabsheetV7 extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { TabSheet t = new TabSheet(); - Upload upload = new Upload("Upload", (filename, mimeType) -> new - ByteArrayOutputStream()); + Upload upload = new Upload("Upload", + (filename, mimeType) -> new ByteArrayOutputStream()); upload.setImmediate(false); - upload.addSucceededListener(event -> upload.getUI().access(()->{ - t.setSelectedTab(1); - })); + upload.addSucceededListener(event -> upload.getUI().access(() -> { + t.setSelectedTab(1); + })); upload.setWidthUndefined(); t.addComponent(upload); diff --git a/uitest/src/main/java/com/vaadin/tests/components/window/BackspaceKeyWithModalOpened.java b/uitest/src/main/java/com/vaadin/tests/components/window/BackspaceKeyWithModalOpened.java index b5a4cbce4c..52de27e279 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/window/BackspaceKeyWithModalOpened.java +++ b/uitest/src/main/java/com/vaadin/tests/components/window/BackspaceKeyWithModalOpened.java @@ -44,27 +44,26 @@ public class BackspaceKeyWithModalOpened extends AbstractTestUI { @Override public void enter(ViewChangeEvent event) { - Button btnOpenModal = new Button("Open modal", - clickEvent -> { - Window window = new Window("Caption"); - window.setId(MODAL_ID); + Button btnOpenModal = new Button("Open modal", clickEvent -> { + Window window = new Window("Caption"); + window.setId(MODAL_ID); - VerticalLayout layout = new VerticalLayout(); - layout.setWidth("300px"); - layout.setHeight("300px"); + VerticalLayout layout = new VerticalLayout(); + layout.setWidth("300px"); + layout.setHeight("300px"); - TextField textField = new TextField(); - textField.setId(TEXT_FIELD_IN_MODAL); + TextField textField = new TextField(); + textField.setId(TEXT_FIELD_IN_MODAL); - layout.addComponent(textField); - window.setContent(layout); + layout.addComponent(textField); + window.setContent(layout); - addWindow(window); + addWindow(window); - window.setModal(true); + window.setModal(true); - setFocusedComponent(window); - }); + setFocusedComponent(window); + }); btnOpenModal.setId(BTN_OPEN_MODAL_ID); addComponent(btnOpenModal); diff --git a/uitest/src/main/java/com/vaadin/tests/components/window/DownloadAndUpdate.java b/uitest/src/main/java/com/vaadin/tests/components/window/DownloadAndUpdate.java index 5659cae7ae..107e30904d 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/window/DownloadAndUpdate.java +++ b/uitest/src/main/java/com/vaadin/tests/components/window/DownloadAndUpdate.java @@ -9,9 +9,8 @@ public class DownloadAndUpdate extends TestBase { @Override protected void setup() { - addComponent( - new Button("Download and update", - event -> downloadAndUpdate())); + addComponent(new Button("Download and update", + event -> downloadAndUpdate())); } protected void downloadAndUpdate() { diff --git a/uitest/src/main/java/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.java b/uitest/src/main/java/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.java index 75267a5762..86e87e2801 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.java +++ b/uitest/src/main/java/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.java @@ -31,95 +31,87 @@ public class ExtraWindowShownWaiAria extends AbstractReindeerTestUI { final TextField bottomTabStopMessage = new TextField( "Bottom Tab Stop Message"); - Button simple = new Button("Open Alert Dialog", - event -> { - CssLayout layout = new CssLayout(); - - final Window w = new Window("Sub window", layout); - w.center(); - w.setModal(modal.getValue()); - w.setAssistiveRole(WindowRole.ALERTDIALOG); - w.setAssistivePrefix(prefix.getValue()); - w.setAssistivePostfix(postfix.getValue()); - - Label description1 = new Label("Simple alert dialog."); - layout.addComponent(description1); - - if (!additionalDescription.getValue()) { - w.setAssistiveDescription(description1); - } else { - Label description2 = new Label( - "Please select what to do!"); - layout.addComponent(description2); - - w.setAssistiveDescription(description1, description2); - } - - w.setTabStopEnabled(tabStop.getValue()); - w.setTabStopTopAssistiveText(topTabStopMessage.getValue()); - w.setTabStopBottomAssistiveText( - bottomTabStopMessage.getValue()); - - Button close = new Button("Close", clickEvent -> w.close()); - layout.addComponent(close); - Button iconButton = new Button("A button with icon"); - iconButton.setIcon( - new ThemeResource("../runo/icons/16/ok.png")); - layout.addComponent(iconButton); - - event.getButton().getUI().addWindow(w); - iconButton.focus(); - - if (tabOrder.getValue()) { - close.setTabIndex(5); - } - }); + Button simple = new Button("Open Alert Dialog", event -> { + CssLayout layout = new CssLayout(); + + final Window w = new Window("Sub window", layout); + w.center(); + w.setModal(modal.getValue()); + w.setAssistiveRole(WindowRole.ALERTDIALOG); + w.setAssistivePrefix(prefix.getValue()); + w.setAssistivePostfix(postfix.getValue()); + + Label description1 = new Label("Simple alert dialog."); + layout.addComponent(description1); + + if (!additionalDescription.getValue()) { + w.setAssistiveDescription(description1); + } else { + Label description2 = new Label("Please select what to do!"); + layout.addComponent(description2); + + w.setAssistiveDescription(description1, description2); + } + + w.setTabStopEnabled(tabStop.getValue()); + w.setTabStopTopAssistiveText(topTabStopMessage.getValue()); + w.setTabStopBottomAssistiveText(bottomTabStopMessage.getValue()); + + Button close = new Button("Close", clickEvent -> w.close()); + layout.addComponent(close); + Button iconButton = new Button("A button with icon"); + iconButton.setIcon(new ThemeResource("../runo/icons/16/ok.png")); + layout.addComponent(iconButton); + + event.getButton().getUI().addWindow(w); + iconButton.focus(); + + if (tabOrder.getValue()) { + close.setTabIndex(5); + } + }); getLayout().addComponent(simple); - Button complex = new Button("Open Entry Dialog", - event -> { - FormLayout form = new FormLayout(); + Button complex = new Button("Open Entry Dialog", event -> { + FormLayout form = new FormLayout(); - final Window w = new Window("Form Window", form); - w.center(); - w.setModal(modal.getValue()); - w.setAssistivePrefix(prefix.getValue()); - w.setAssistivePostfix(postfix.getValue()); + final Window w = new Window("Form Window", form); + w.center(); + w.setModal(modal.getValue()); + w.setAssistivePrefix(prefix.getValue()); + w.setAssistivePostfix(postfix.getValue()); - Label description1 = new Label("Please fill in your data"); - form.addComponent(description1); + Label description1 = new Label("Please fill in your data"); + form.addComponent(description1); - if (!additionalDescription.getValue()) { - w.setAssistiveDescription(description1); - } else { - Label description2 = new Label( - "and press the button save."); - form.addComponent(description2); + if (!additionalDescription.getValue()) { + w.setAssistiveDescription(description1); + } else { + Label description2 = new Label("and press the button save."); + form.addComponent(description2); - w.setAssistiveDescription(description1, description2); - } + w.setAssistiveDescription(description1, description2); + } - w.setTabStopEnabled(tabStop.getValue()); - w.setTabStopTopAssistiveText(topTabStopMessage.getValue()); - w.setTabStopBottomAssistiveText( - bottomTabStopMessage.getValue()); + w.setTabStopEnabled(tabStop.getValue()); + w.setTabStopTopAssistiveText(topTabStopMessage.getValue()); + w.setTabStopBottomAssistiveText(bottomTabStopMessage.getValue()); - TextField name = new TextField("Name:"); - form.addComponent(name); + TextField name = new TextField("Name:"); + form.addComponent(name); - form.addComponent(new TextField("Address")); + form.addComponent(new TextField("Address")); - Button saveButton = new Button("Save", - clickEvent -> w.close()); - form.addComponent(saveButton); + Button saveButton = new Button("Save", clickEvent -> w.close()); + form.addComponent(saveButton); - event.getButton().getUI().addWindow(w); - name.focus(); + event.getButton().getUI().addWindow(w); + name.focus(); - if (tabOrder.getValue()) { - name.setTabIndex(5); - } - }); + if (tabOrder.getValue()) { + name.setTabIndex(5); + } + }); getLayout().addComponent(complex); getLayout().addComponent(modal); diff --git a/uitest/src/main/java/com/vaadin/tests/components/window/GridInWindow.java b/uitest/src/main/java/com/vaadin/tests/components/window/GridInWindow.java index 86970ff47b..9467ae376a 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/window/GridInWindow.java +++ b/uitest/src/main/java/com/vaadin/tests/components/window/GridInWindow.java @@ -15,14 +15,13 @@ public class GridInWindow extends AbstractTestUIWithLog { grid.addColumn("Hidable column").setHidable(true); grid.addRow("Close and reopen and it vanishes"); - Button popupButton = new Button("Open PopUp", - event -> { - Window subWindow = new Window("Sub-window"); - subWindow.setContent(grid); - subWindow.setWidth(600, Unit.PIXELS); - subWindow.setWidth(400, Unit.PIXELS); - getUI().addWindow(subWindow); - }); + Button popupButton = new Button("Open PopUp", event -> { + Window subWindow = new Window("Sub-window"); + subWindow.setContent(grid); + subWindow.setWidth(600, Unit.PIXELS); + subWindow.setWidth(400, Unit.PIXELS); + getUI().addWindow(subWindow); + }); addComponent(popupButton); diff --git a/uitest/src/main/java/com/vaadin/tests/components/window/LegacyWindowOpenTest.java b/uitest/src/main/java/com/vaadin/tests/components/window/LegacyWindowOpenTest.java index 50dea6ab0f..a8eefdc0ac 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/window/LegacyWindowOpenTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/window/LegacyWindowOpenTest.java @@ -33,7 +33,7 @@ public class LegacyWindowOpenTest extends TestBase { "window.open(\"http://www.google.com\", \"_blank\");"))); addComponent(new Button( "Window execute Javascript window.open(www.google.com, _blank, resizable=yes,menubar=yes,toolbar=yes,directories=yes,location=yes,scrollbars=yes,status=yes)", - event-> win.executeJavaScript( + event -> win.executeJavaScript( "window.open(\"http://www.google.com\", \"_blank\", \"resizable=yes,menubar=yes,toolbar=yes,directories=yes,location=yes,scrollbars=yes,status=yes\");"))); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/window/WindowOrder.java b/uitest/src/main/java/com/vaadin/tests/components/window/WindowOrder.java index f6fda7bdaf..efd0df722e 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/window/WindowOrder.java +++ b/uitest/src/main/java/com/vaadin/tests/components/window/WindowOrder.java @@ -57,12 +57,11 @@ public class WindowOrder extends AbstractTestUI { addComponent(first); getLayout().setComponentAlignment(first, Alignment.MIDDLE_RIGHT); - Button all = new Button("Bring to front all windows", - event -> { - w3.bringToFront(); - w1.bringToFront(); - w2.bringToFront(); - }); + Button all = new Button("Bring to front all windows", event -> { + w3.bringToFront(); + w1.bringToFront(); + w2.bringToFront(); + }); all.addStyleName("bring-to-front-all"); addComponent(all); getLayout().setComponentAlignment(all, Alignment.MIDDLE_RIGHT); diff --git a/uitest/src/main/java/com/vaadin/tests/components/window/WindowScrollingComponentIntoView.java b/uitest/src/main/java/com/vaadin/tests/components/window/WindowScrollingComponentIntoView.java index 4005725841..9a51c813fc 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/window/WindowScrollingComponentIntoView.java +++ b/uitest/src/main/java/com/vaadin/tests/components/window/WindowScrollingComponentIntoView.java @@ -58,12 +58,10 @@ public class WindowScrollingComponentIntoView extends AbstractTestCase { window.setPositionX(200); window.setPositionY(200); - layout.addComponent( - new Button("Scroll mainwin to X9", - event -> getMainWindow().scrollIntoView(x9))); - layout.addComponent( - new Button("Scroll mainwin to Y9", - event -> getMainWindow().scrollIntoView(y9))); + layout.addComponent(new Button("Scroll mainwin to X9", + event -> getMainWindow().scrollIntoView(x9))); + layout.addComponent(new Button("Scroll mainwin to Y9", + event -> getMainWindow().scrollIntoView(y9))); VerticalLayout panelLayout = new VerticalLayout(); panelLayout.setMargin(true); @@ -92,13 +90,13 @@ public class WindowScrollingComponentIntoView extends AbstractTestCase { panelLayout.addComponent(horizontalLayout); final Component y29 = l; - ((VerticalLayout) getMainWindow().getContent()).addComponent( - new Button("Scroll win to X9", event -> { + ((VerticalLayout) getMainWindow().getContent()) + .addComponent(new Button("Scroll win to X9", event -> { throw new RuntimeException("Currently not implemented"); // window.scrollIntoView(x29); }), 0); - ((VerticalLayout) getMainWindow().getContent()).addComponent( - new Button("Scroll win to Y9", event -> { + ((VerticalLayout) getMainWindow().getContent()) + .addComponent(new Button("Scroll win to Y9", event -> { throw new RuntimeException("Currently not implemented"); // window.scrollIntoView(y29); }), 0); diff --git a/uitest/src/main/java/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.java b/uitest/src/main/java/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.java index da0d09ee5d..f88f879e39 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.java +++ b/uitest/src/main/java/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.java @@ -9,7 +9,7 @@ public class WindowWithInvalidCloseListener extends AbstractReindeerTestUI { @Override protected void setup(VaadinRequest request) { Window w = new Window("Close me"); - w.addCloseListener(event-> { + w.addCloseListener(event -> { throw new RuntimeException("Close listener intentionally failed"); }); addWindow(w); diff --git a/uitest/src/main/java/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java b/uitest/src/main/java/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java index 2b908859a6..b8a884143a 100644 --- a/uitest/src/main/java/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java +++ b/uitest/src/main/java/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java @@ -99,13 +99,12 @@ public class BeanItemContainerFilteringTest extends TestBase { // addItemAt(idx), addItemAfter(selection), addItem() - final Button addItemButton = new Button("addItem()", - event -> { - container.addItem(new TestBean("addItem() " + nextToAdd, - "value " + nextToAdd)); - nextToAdd++; - nextLabel.setCaption("Next id: " + nextToAdd); - }); + final Button addItemButton = new Button("addItem()", event -> { + container.addItem(new TestBean("addItem() " + nextToAdd, + "value " + nextToAdd)); + nextToAdd++; + nextLabel.setCaption("Next id: " + nextToAdd); + }); vl.addComponent(addItemButton); final Button addItemAfterButton = new Button("addItemAfter()", @@ -131,20 +130,18 @@ public class BeanItemContainerFilteringTest extends TestBase { position = new TextField("Position:", "0"); vl.addComponent(position); - final Button addItemAtButton = new Button("addItemAt()", - event -> { - int index = Integer.parseInt(position.getValue()); - TestBean bean = new TestBean("addItemAt() " + nextToAdd, - "value " + nextToAdd); - Item item = container.addItemAt(index, bean); - if (item == null) { - getMainWindow() - .showNotification("Adding item at index " - + position.getValue() + " failed"); - } - nextToAdd++; - nextLabel.setCaption("Next id: " + nextToAdd); - }); + final Button addItemAtButton = new Button("addItemAt()", event -> { + int index = Integer.parseInt(position.getValue()); + TestBean bean = new TestBean("addItemAt() " + nextToAdd, + "value " + nextToAdd); + Item item = container.addItemAt(index, bean); + if (item == null) { + getMainWindow().showNotification("Adding item at index " + + position.getValue() + " failed"); + } + nextToAdd++; + nextLabel.setCaption("Next id: " + nextToAdd); + }); vl.addComponent(addItemAtButton); getLayout().addComponent(table); diff --git a/uitest/src/main/java/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java b/uitest/src/main/java/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java index f573985ad9..d6312b8507 100644 --- a/uitest/src/main/java/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java +++ b/uitest/src/main/java/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java @@ -88,19 +88,18 @@ public class HierarchicalWrapperOrdering extends TestBase { l.addComponent(tree1); // This contains a bug, changes not reflected back to client - Button modify = new Button("Modify and sort (has a bug)", - event -> { - // Get first item - Object itemId = indexedContainer.getIdByIndex(0); - Item item = indexedContainer.getItem(itemId); - Property<String> property = item.getItemProperty("name"); - // Prepend with Z so item should get sorted later - property.setValue("Z " + property.getValue()); - // this does not work alone, requires extraneous - // setContainerDataSource for server-side changes to be - // reflected back to client-side - sort(indexedContainer); - }); + Button modify = new Button("Modify and sort (has a bug)", event -> { + // Get first item + Object itemId = indexedContainer.getIdByIndex(0); + Item item = indexedContainer.getItem(itemId); + Property<String> property = item.getItemProperty("name"); + // Prepend with Z so item should get sorted later + property.setValue("Z " + property.getValue()); + // this does not work alone, requires extraneous + // setContainerDataSource for server-side changes to be + // reflected back to client-side + sort(indexedContainer); + }); l.addComponent(modify); Table t = new Table("Table with indexed container", indexedContainer); diff --git a/uitest/src/main/java/com/vaadin/tests/containers/IndexedContainerFilteringTest.java b/uitest/src/main/java/com/vaadin/tests/containers/IndexedContainerFilteringTest.java index d2daffdabe..a9583c4763 100644 --- a/uitest/src/main/java/com/vaadin/tests/containers/IndexedContainerFilteringTest.java +++ b/uitest/src/main/java/com/vaadin/tests/containers/IndexedContainerFilteringTest.java @@ -66,16 +66,15 @@ public class IndexedContainerFilteringTest extends TestBase { // addItemAt(idx), addItemAfter(selection), addItem() - final Button addItemButton = new Button("addItem()", - event -> { - Item item = container.addItem("addItem() " + nextToAdd); - if (item != null) { - item.getItemProperty("column1") - .setValue("addItem() " + nextToAdd); - } - nextToAdd++; - nextLabel.setCaption("Next id: " + nextToAdd); - }); + final Button addItemButton = new Button("addItem()", event -> { + Item item = container.addItem("addItem() " + nextToAdd); + if (item != null) { + item.getItemProperty("column1") + .setValue("addItem() " + nextToAdd); + } + nextToAdd++; + nextLabel.setCaption("Next id: " + nextToAdd); + }); vl.addComponent(addItemButton); final Button addItemAfterButton = new Button("addItemAfter()", @@ -101,21 +100,20 @@ public class IndexedContainerFilteringTest extends TestBase { position = new TextField("Position:", "0"); vl.addComponent(position); - final Button addItemAtButton = new Button("addItemAt()", - event -> { - int index = Integer.parseInt(position.getValue()); - String id = "addItemAt() " + nextToAdd; - Item item = container.addItemAt(index, id); - if (item != null) { - item.getItemProperty("column1").setValue(id); - table.setValue(id); - } else { - getMainWindow().showNotification("Adding item at index " - + position.getValue() + " failed"); - } - nextToAdd++; - nextLabel.setCaption("Next id: " + nextToAdd); - }); + final Button addItemAtButton = new Button("addItemAt()", event -> { + int index = Integer.parseInt(position.getValue()); + String id = "addItemAt() " + nextToAdd; + Item item = container.addItemAt(index, id); + if (item != null) { + item.getItemProperty("column1").setValue(id); + table.setValue(id); + } else { + getMainWindow().showNotification("Adding item at index " + + position.getValue() + " failed"); + } + nextToAdd++; + nextLabel.setCaption("Next id: " + nextToAdd); + }); vl.addComponent(addItemAtButton); getLayout().addComponent(table); diff --git a/uitest/src/main/java/com/vaadin/tests/containers/filesystemcontainer/FileSystemContainerInTreeTable.java b/uitest/src/main/java/com/vaadin/tests/containers/filesystemcontainer/FileSystemContainerInTreeTable.java index 131dc4db93..f7b4e647aa 100644 --- a/uitest/src/main/java/com/vaadin/tests/containers/filesystemcontainer/FileSystemContainerInTreeTable.java +++ b/uitest/src/main/java/com/vaadin/tests/containers/filesystemcontainer/FileSystemContainerInTreeTable.java @@ -55,16 +55,14 @@ public class FileSystemContainerInTreeTable extends TestBase { HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setSpacing(true); - buttonLayout.addComponent( - new Button("Create dir11", event -> { - new File(folder, "dir11").mkdir(); - log.log("Row dir11 created"); - })); - buttonLayout.addComponent( - new Button("Delete dir11", event -> { - new File(folder, "dir11").delete(); - log.log("Row dir11 deleted"); - })); + buttonLayout.addComponent(new Button("Create dir11", event -> { + new File(folder, "dir11").mkdir(); + log.log("Row dir11 created"); + })); + buttonLayout.addComponent(new Button("Delete dir11", event -> { + new File(folder, "dir11").delete(); + log.log("Row dir11 deleted"); + })); // to clean up explicitly before ending an automated test buttonLayout.addComponent( new Button("Clean all files", event -> folder.delete())); diff --git a/uitest/src/main/java/com/vaadin/tests/contextclick/GridContextClick.java b/uitest/src/main/java/com/vaadin/tests/contextclick/GridContextClick.java index f783ddf72d..eb778c1e08 100644 --- a/uitest/src/main/java/com/vaadin/tests/contextclick/GridContextClick.java +++ b/uitest/src/main/java/com/vaadin/tests/contextclick/GridContextClick.java @@ -73,9 +73,8 @@ public class GridContextClick extends @Override protected HorizontalLayout createContextClickControls() { HorizontalLayout controls = super.createContextClickControls(); - controls.addComponent( - new Button("Remove all content", event -> testComponent - .setItems(Collections.emptyList()))); + controls.addComponent(new Button("Remove all content", + event -> testComponent.setItems(Collections.emptyList()))); return controls; } } diff --git a/uitest/src/main/java/com/vaadin/tests/contextclick/TreeV8ContextClick.java b/uitest/src/main/java/com/vaadin/tests/contextclick/TreeV8ContextClick.java index 699dc443d6..c4e7f44a9f 100644 --- a/uitest/src/main/java/com/vaadin/tests/contextclick/TreeV8ContextClick.java +++ b/uitest/src/main/java/com/vaadin/tests/contextclick/TreeV8ContextClick.java @@ -40,11 +40,10 @@ public class TreeV8ContextClick extends @Override protected HorizontalLayout createContextClickControls() { HorizontalLayout controls = super.createContextClickControls(); - controls.addComponent( - new Button("Remove all content", event -> { - testComponent.setItems(Collections.emptyList()); - testComponent.setHeight("200px"); - })); + controls.addComponent(new Button("Remove all content", event -> { + testComponent.setItems(Collections.emptyList()); + testComponent.setHeight("200px"); + })); return controls; } diff --git a/uitest/src/main/java/com/vaadin/tests/dd/DDTest1.java b/uitest/src/main/java/com/vaadin/tests/dd/DDTest1.java index f800ac906b..c1e5bea221 100644 --- a/uitest/src/main/java/com/vaadin/tests/dd/DDTest1.java +++ b/uitest/src/main/java/com/vaadin/tests/dd/DDTest1.java @@ -57,7 +57,8 @@ public class DDTest1 extends TestBase { DragDropPane pane2 = new DragDropPane(); pane2.setCaption( "Pane2 (accept needs server side visit, check for \"Bar\")"); - final AcceptCriterion crit = new ServerSideCriterion() { private static final long serialVersionUID = 1L; + final AcceptCriterion crit = new ServerSideCriterion() { + private static final long serialVersionUID = 1L; @Override public boolean accept(DragAndDropEvent dragEvent) { diff --git a/uitest/src/main/java/com/vaadin/tests/dd/DDTest6.java b/uitest/src/main/java/com/vaadin/tests/dd/DDTest6.java index dd4f840b2e..8ecd1480c5 100644 --- a/uitest/src/main/java/com/vaadin/tests/dd/DDTest6.java +++ b/uitest/src/main/java/com/vaadin/tests/dd/DDTest6.java @@ -146,7 +146,7 @@ public class DDTest6 extends TestBase { }; tree1.addActionHandler(actionHandler); - tree1.addValueChangeListener(event->{ + tree1.addValueChangeListener(event -> { Object value = event.getProperty().getValue(); if (value != null && !(value instanceof Folder)) { value = tree1.getParent(value); diff --git a/uitest/src/main/java/com/vaadin/tests/dd/DragDropPane.java b/uitest/src/main/java/com/vaadin/tests/dd/DragDropPane.java index 3ed35af72e..f4581a05fe 100644 --- a/uitest/src/main/java/com/vaadin/tests/dd/DragDropPane.java +++ b/uitest/src/main/java/com/vaadin/tests/dd/DragDropPane.java @@ -35,7 +35,9 @@ public class DragDropPane extends DragAndDropWrapper implements DropHandler { public void addComponent(Component c) { root.addComponent(c); - } private static final long serialVersionUID = 1L; + } + + private static final long serialVersionUID = 1L; public void addComponent(Component l, String string) { root.addComponent(l, string); diff --git a/uitest/src/main/java/com/vaadin/tests/dnd/DragAndDropPayload.java b/uitest/src/main/java/com/vaadin/tests/dnd/DragAndDropPayload.java index 050317358e..25d1bb01a7 100644 --- a/uitest/src/main/java/com/vaadin/tests/dnd/DragAndDropPayload.java +++ b/uitest/src/main/java/com/vaadin/tests/dnd/DragAndDropPayload.java @@ -38,13 +38,11 @@ public class DragAndDropPayload extends AbstractTestUIWithLog { DropTargetExtension<Label> dropTarget = new DropTargetExtension<>( targetLabel); - dropTarget.addDropListener(event -> - event.getDataTransferData().entrySet().stream() - .filter(entry -> entry.getKey() - .startsWith(Payload.ITEM_PREFIX)).forEach( - entry -> log.log(entry.getKey() + " -> " + entry - .getValue())) - ); + dropTarget.addDropListener(event -> event.getDataTransferData() + .entrySet().stream() + .filter(entry -> entry.getKey().startsWith(Payload.ITEM_PREFIX)) + .forEach(entry -> log + .log(entry.getKey() + " -> " + entry.getValue()))); VerticalLayout dragSources = new VerticalLayout(stringLabel, integerLabel, doubleLabel); diff --git a/uitest/src/main/java/com/vaadin/tests/dnd/Html5FileDragAndDropUpload.java b/uitest/src/main/java/com/vaadin/tests/dnd/Html5FileDragAndDropUpload.java index 4bfbc68294..53264a760d 100644 --- a/uitest/src/main/java/com/vaadin/tests/dnd/Html5FileDragAndDropUpload.java +++ b/uitest/src/main/java/com/vaadin/tests/dnd/Html5FileDragAndDropUpload.java @@ -71,7 +71,8 @@ public class Html5FileDragAndDropUpload extends AbstractTestUIWithLog { @Override public void streamingFinished(StreamingEndEvent event) { - gridItems.add(new FileParameters(event.getFileName(), + gridItems + .add(new FileParameters(event.getFileName(), event.getContentLength(), event.getMimeType())); grid.setItems(gridItems); diff --git a/uitest/src/main/java/com/vaadin/tests/elements/ComponentElementGetValue.java b/uitest/src/main/java/com/vaadin/tests/elements/ComponentElementGetValue.java index 2b00ca7d1d..505f278137 100644 --- a/uitest/src/main/java/com/vaadin/tests/elements/ComponentElementGetValue.java +++ b/uitest/src/main/java/com/vaadin/tests/elements/ComponentElementGetValue.java @@ -24,7 +24,6 @@ import com.vaadin.ui.TextField; import com.vaadin.ui.TwinColSelect; import com.vaadin.ui.RichTextArea; - /** * UI test for getValue() method of components: TextField, TextArea, * PasswordField, ComboBox, ListSelect, NativeSelect, OptionGroup, CheckBox, diff --git a/uitest/src/main/java/com/vaadin/tests/elements/combobox/ComboBoxInputNotAllowed.java b/uitest/src/main/java/com/vaadin/tests/elements/combobox/ComboBoxInputNotAllowed.java index 79beafd4fb..f750e063c2 100644 --- a/uitest/src/main/java/com/vaadin/tests/elements/combobox/ComboBoxInputNotAllowed.java +++ b/uitest/src/main/java/com/vaadin/tests/elements/combobox/ComboBoxInputNotAllowed.java @@ -27,9 +27,8 @@ public class ComboBoxInputNotAllowed extends AbstractTestUI { protected void setup(VaadinRequest request) { ComboBox<String> comboBox = new ComboBox<>("", ITEMS); comboBox.setTextInputAllowed(false); - comboBox.addValueChangeListener( - event -> addComponent( - new Label("Value is now: " + event.getValue()))); + comboBox.addValueChangeListener(event -> addComponent( + new Label("Value is now: " + event.getValue()))); addComponent(comboBox); } diff --git a/uitest/src/main/java/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java b/uitest/src/main/java/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java index 6a3f19566d..66d39ad9ca 100644 --- a/uitest/src/main/java/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java +++ b/uitest/src/main/java/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java @@ -84,10 +84,8 @@ public class SimpleJavaScriptExtensionTest extends AbstractReindeerTestUI { final SimpleJavascriptExtension simpleJavascriptExtension = new SimpleJavascriptExtension(); simpleJavascriptExtension.setPrefix("Prefix: "); addExtension(simpleJavascriptExtension); - addComponent( - new Button("Send rpc greeting", - event -> simpleJavascriptExtension - .greetRpc("Rpc greeting"))); + addComponent(new Button("Send rpc greeting", + event -> simpleJavascriptExtension.greetRpc("Rpc greeting"))); addComponent(new Button("Send callback greeting", event -> simpleJavascriptExtension .greetCallback("Callback greeting"))); diff --git a/uitest/src/main/java/com/vaadin/tests/fieldgroup/AbstractBasicCrud.java b/uitest/src/main/java/com/vaadin/tests/fieldgroup/AbstractBasicCrud.java index 83c3bb4c5a..23c5de5477 100644 --- a/uitest/src/main/java/com/vaadin/tests/fieldgroup/AbstractBasicCrud.java +++ b/uitest/src/main/java/com/vaadin/tests/fieldgroup/AbstractBasicCrud.java @@ -31,8 +31,8 @@ import com.vaadin.v7.ui.TextField; public abstract class AbstractBasicCrud extends AbstractTestUIWithLog { protected AbstractForm form; - protected static String[] columns = { "firstName", "lastName", - "gender", "birthDate", "age", "alive", "address.streetAddress", + protected static String[] columns = { "firstName", "lastName", "gender", + "birthDate", "age", "alive", "address.streetAddress", "address.postalCode", "address.city", "address.country" }; protected BeanItemContainer<ComplexPerson> container = ComplexPerson .createContainer(100);; diff --git a/uitest/src/main/java/com/vaadin/tests/fieldgroup/AbstractBeanFieldGroupTest.java b/uitest/src/main/java/com/vaadin/tests/fieldgroup/AbstractBeanFieldGroupTest.java index 8016eb44e4..a2dd12d74e 100644 --- a/uitest/src/main/java/com/vaadin/tests/fieldgroup/AbstractBeanFieldGroupTest.java +++ b/uitest/src/main/java/com/vaadin/tests/fieldgroup/AbstractBeanFieldGroupTest.java @@ -33,9 +33,8 @@ public abstract class AbstractBeanFieldGroupTest<T> extends TestBase { protected Button getShowBeanButton() { if (showBeanButton == null) { - showBeanButton = new Button("Show bean values", - event -> log.log(getFieldBinder().getItemDataSource() - .getBean().toString())); + showBeanButton = new Button("Show bean values", event -> log.log( + getFieldBinder().getItemDataSource().getBean().toString())); } return showBeanButton; } diff --git a/uitest/src/main/java/com/vaadin/tests/fieldgroup/BasicPersonForm.java b/uitest/src/main/java/com/vaadin/tests/fieldgroup/BasicPersonForm.java index 63370fad56..799ffc258d 100644 --- a/uitest/src/main/java/com/vaadin/tests/fieldgroup/BasicPersonForm.java +++ b/uitest/src/main/java/com/vaadin/tests/fieldgroup/BasicPersonForm.java @@ -133,11 +133,10 @@ public class BasicPersonForm extends AbstractTestUIWithLog { notification.show(getPage()); log(msg); }); - Button discardButton = new Button("Discard", - event -> { - fieldGroup.discard(); - log("Discarded changes"); - }); + Button discardButton = new Button("Discard", event -> { + fieldGroup.discard(); + log("Discarded changes"); + }); Button showBean = new Button("Show bean values", event -> log(getPerson(fieldGroup).toString())); addComponent(commitButton); diff --git a/uitest/src/main/java/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java b/uitest/src/main/java/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java index f8d0eb7eae..f95e9e3eb2 100644 --- a/uitest/src/main/java/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java +++ b/uitest/src/main/java/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java @@ -51,11 +51,10 @@ public class FieldBinderWithBeanValidation extends TestBase { Notification.show(msg); log.log(msg); }); - Button discardButton = new Button("Discard", - event -> { - fieldGroup.discard(); - log.log("Discarded changes"); - }); + Button discardButton = new Button("Discard", event -> { + fieldGroup.discard(); + log.log("Discarded changes"); + }); Button showBean = new Button("Show bean values", event -> log.log(getPerson(fieldGroup).toString())); addComponent(commitButton); diff --git a/uitest/src/main/java/com/vaadin/tests/fieldgroup/FormWithNestedProperties.java b/uitest/src/main/java/com/vaadin/tests/fieldgroup/FormWithNestedProperties.java index dfbb7c33f8..7c63be9314 100644 --- a/uitest/src/main/java/com/vaadin/tests/fieldgroup/FormWithNestedProperties.java +++ b/uitest/src/main/java/com/vaadin/tests/fieldgroup/FormWithNestedProperties.java @@ -11,7 +11,8 @@ import com.vaadin.v7.data.fieldgroup.BeanFieldGroup; import com.vaadin.v7.ui.NativeSelect; import com.vaadin.v7.ui.TextField; -public class FormWithNestedProperties extends AbstractBeanFieldGroupTest<Person> { +public class FormWithNestedProperties + extends AbstractBeanFieldGroupTest<Person> { private Log log = new Log(5); 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 931af555df..d4b37335b9 100644 --- a/uitest/src/main/java/com/vaadin/tests/fonticon/FontIcons.java +++ b/uitest/src/main/java/com/vaadin/tests/fonticon/FontIcons.java @@ -60,11 +60,10 @@ public class FontIcons extends AbstractReindeerTestUI { layout.setIcon(icon); - layout.addComponent( - new Button("Switch icon type", - event -> buildUI(icon instanceof FontIcon - ? new ThemeResource("../runo/icons/16/user.png") - : FontAwesome.ANDROID))); + layout.addComponent(new Button("Switch icon type", + event -> buildUI(icon instanceof FontIcon + ? new ThemeResource("../runo/icons/16/user.png") + : FontAwesome.ANDROID))); Handler actionHandler = new Handler() { Action[] actions = { new Action("Do it!", icon) }; diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/GridLayoutSpanExpansion.java b/uitest/src/main/java/com/vaadin/tests/layouts/GridLayoutSpanExpansion.java index 814a3f128f..dfd73d2cdb 100644 --- a/uitest/src/main/java/com/vaadin/tests/layouts/GridLayoutSpanExpansion.java +++ b/uitest/src/main/java/com/vaadin/tests/layouts/GridLayoutSpanExpansion.java @@ -14,19 +14,17 @@ public class GridLayoutSpanExpansion extends TestBase { heightSpan.setWidth("200px"); heightSpan.addComponent(new Label("1"), 0, 0); heightSpan.addComponent(new Label("2"), 0, 1); - heightSpan.addComponent( - new Label( - "This is a somewhat long text that spans over a few lines."), - 1, 0, 1, 1); + heightSpan.addComponent(new Label( + "This is a somewhat long text that spans over a few lines."), 1, + 0, 1, 1); heightSpan.setRowExpandRatio(1, 1); addComponent(heightSpan); GridLayout widthSpan = new GridLayout(2, 2); widthSpan.setHeight("100px"); widthSpan.setWidth("200px"); - widthSpan.addComponent( - new Label( - "This is a somewhat long text that spans over both columns."), + widthSpan.addComponent(new Label( + "This is a somewhat long text that spans over both columns."), 0, 0, 1, 0); Label label1 = new Label("1"); label1.setSizeUndefined(); diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/LayoutPerformanceTests.java b/uitest/src/main/java/com/vaadin/tests/layouts/LayoutPerformanceTests.java index e28dc0b8ff..215cd723ad 100644 --- a/uitest/src/main/java/com/vaadin/tests/layouts/LayoutPerformanceTests.java +++ b/uitest/src/main/java/com/vaadin/tests/layouts/LayoutPerformanceTests.java @@ -82,7 +82,8 @@ public class LayoutPerformanceTests extends TestBase { protected AbstractOrderedLayout createOrderedLayout(int depth, boolean fullHeight) { AbstractOrderedLayout layout = (depth % 2) == 0 - ? new VerticalLayout() : new HorizontalLayout(); + ? new VerticalLayout() + : new HorizontalLayout(); layout.setWidth("100%"); if (fullHeight) { layout.setHeight("100%"); diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/OrderedLayoutBasics.java b/uitest/src/main/java/com/vaadin/tests/layouts/OrderedLayoutBasics.java index 482ece0562..3f4978abe4 100644 --- a/uitest/src/main/java/com/vaadin/tests/layouts/OrderedLayoutBasics.java +++ b/uitest/src/main/java/com/vaadin/tests/layouts/OrderedLayoutBasics.java @@ -1030,9 +1030,10 @@ public class OrderedLayoutBasics extends TestBase { } private Button createAddButton(AbstractOrderedLayout ol) { - Button b = new Button("Add before", event -> - addBefore((AbstractOrderedLayout) event.getButton().getData(), - event.getButton().getParent(), "")); + Button b = new Button("Add before", + event -> addBefore( + (AbstractOrderedLayout) event.getButton().getData(), + event.getButton().getParent(), "")); b.setData(ol); return b; diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/gridlayout/GridLayoutMoveComponent.java b/uitest/src/main/java/com/vaadin/tests/layouts/gridlayout/GridLayoutMoveComponent.java index a46448eb03..b38ed3c407 100644 --- a/uitest/src/main/java/com/vaadin/tests/layouts/gridlayout/GridLayoutMoveComponent.java +++ b/uitest/src/main/java/com/vaadin/tests/layouts/gridlayout/GridLayoutMoveComponent.java @@ -28,27 +28,24 @@ public class GridLayoutMoveComponent extends AbstractReindeerTestUI { grid.addComponent(b, 0, 1); grid.addComponent(tf, 0, 2); - addComponent( - new Button("Shift label right", event -> { - // Moving component from 0,0 -> 1,0 - grid.removeComponent(l); - grid.addComponent(l, 1, 0); - })); - - addComponent( - new Button("Shift button right", event -> { - grid.removeComponent(b); - grid.addComponent(b, 1, 1); - })); - - addComponent(new Button("Shift text field right", - event -> { - grid.removeComponent(tf); - Label label = new Label("I'm on left"); - label.setWidth("100%"); - grid.addComponent(label, 0, 2); - grid.addComponent(tf, 1, 2); - })); + addComponent(new Button("Shift label right", event -> { + // Moving component from 0,0 -> 1,0 + grid.removeComponent(l); + grid.addComponent(l, 1, 0); + })); + + addComponent(new Button("Shift button right", event -> { + grid.removeComponent(b); + grid.addComponent(b, 1, 1); + })); + + addComponent(new Button("Shift text field right", event -> { + grid.removeComponent(tf); + Label label = new Label("I'm on left"); + label.setWidth("100%"); + grid.addComponent(label, 0, 2); + grid.addComponent(tf, 1, 2); + })); } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridAddReplaceMove.java b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridAddReplaceMove.java index 028fe41aea..11d10aa40a 100644 --- a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridAddReplaceMove.java +++ b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridAddReplaceMove.java @@ -9,7 +9,6 @@ import com.vaadin.ui.Label; import com.vaadin.v7.ui.Table; import com.vaadin.v7.ui.TextField; - public class GridAddReplaceMove extends GridBaseLayoutTestUI { /* diff --git a/uitest/src/main/java/com/vaadin/tests/navigator/NavigatorTest.java b/uitest/src/main/java/com/vaadin/tests/navigator/NavigatorTest.java index e726580cff..8fbf3fdce2 100644 --- a/uitest/src/main/java/com/vaadin/tests/navigator/NavigatorTest.java +++ b/uitest/src/main/java/com/vaadin/tests/navigator/NavigatorTest.java @@ -37,8 +37,9 @@ public class NavigatorTest extends UI { @Override public void enter(ViewChangeEvent event) { String params = event.getParameters(); - log.log("Navigated to ListView " + (params.isEmpty() - ? "without params" : "with params " + params)); + log.log("Navigated to ListView " + + (params.isEmpty() ? "without params" + : "with params " + params)); removeAllItems(); for (String arg : params.split(",")) { addItem(arg.split("=|$", 2), arg); @@ -51,8 +52,9 @@ public class NavigatorTest extends UI { @Override public void enter(ViewChangeEvent event) { String params = event.getParameters(); - log.log("Navigated to EditView " + (params.isEmpty() - ? "without params" : "with params " + params)); + log.log("Navigated to EditView " + + (params.isEmpty() ? "without params" + : "with params " + params)); setValue("Displaying edit view with parameters " + params); } } @@ -73,8 +75,9 @@ public class NavigatorTest extends UI { @Override public void enter(ViewChangeEvent event) { String params = event.getParameters(); - log.log("Navigated to DefaultView " + (params.isEmpty() - ? "without params" : "with params " + params)); + log.log("Navigated to DefaultView " + + (params.isEmpty() ? "without params" + : "with params " + params)); setValue("Default view: " + event.getParameters()); } } diff --git a/uitest/src/main/java/com/vaadin/tests/navigator/NavigatorViewBlocksBackButtonAction.java b/uitest/src/main/java/com/vaadin/tests/navigator/NavigatorViewBlocksBackButtonAction.java index 2e1c7b8abb..7178b572b8 100644 --- a/uitest/src/main/java/com/vaadin/tests/navigator/NavigatorViewBlocksBackButtonAction.java +++ b/uitest/src/main/java/com/vaadin/tests/navigator/NavigatorViewBlocksBackButtonAction.java @@ -87,8 +87,8 @@ public class NavigatorViewBlocksBackButtonAction confirmationWindowLayout.setSpacing(true); confirmationWindowLayout .addComponent(new Label("Really exit this view?")); - confirmationWindowLayout.addComponent( - new Button("Yeah, sure!", clickEvent -> { + confirmationWindowLayout + .addComponent(new Button("Yeah, sure!", clickEvent -> { okToLeave = true; getUI().removeWindow(confirmationWindow); event.getNavigator().navigateTo(event.getViewName() diff --git a/uitest/src/main/java/com/vaadin/tests/performance/BasicPerformanceTest.java b/uitest/src/main/java/com/vaadin/tests/performance/BasicPerformanceTest.java index dbefe115e9..0e3dd73615 100644 --- a/uitest/src/main/java/com/vaadin/tests/performance/BasicPerformanceTest.java +++ b/uitest/src/main/java/com/vaadin/tests/performance/BasicPerformanceTest.java @@ -68,74 +68,68 @@ public class BasicPerformanceTest extends UI { leftBar.addComponent(performanceReportArea); leftBar.addComponent(reportPerformanceButton); - leftBar.addComponent(new Button("Set 20 panels as content", - event -> { - popupateContent(contentLayout, 20, true); - updatePerformanceReporting("20 panels", 100, 100); - })); - leftBar.addComponent(new Button("Set 40 panels as content", - event -> { - popupateContent(contentLayout, 40, true); - updatePerformanceReporting("40 panels", 100, 100); - })); - leftBar.addComponent(new Button("Set 40 layouts as content", - event -> { - popupateContent(contentLayout, 40, false); - updatePerformanceReporting("40 layouts", 100, 100); - })); - - leftBar.addComponent( - new Button("Update all labels", event -> { - Iterator<Component> componentIterator = contentLayout + leftBar.addComponent(new Button("Set 20 panels as content", event -> { + popupateContent(contentLayout, 20, true); + updatePerformanceReporting("20 panels", 100, 100); + })); + leftBar.addComponent(new Button("Set 40 panels as content", event -> { + popupateContent(contentLayout, 40, true); + updatePerformanceReporting("40 panels", 100, 100); + })); + leftBar.addComponent(new Button("Set 40 layouts as content", event -> { + popupateContent(contentLayout, 40, false); + updatePerformanceReporting("40 layouts", 100, 100); + })); + + leftBar.addComponent(new Button("Update all labels", event -> { + Iterator<Component> componentIterator = contentLayout + .getComponentIterator(); + while (componentIterator.hasNext()) { + + Iterator<Component> columHolderIterator; + Component child = componentIterator.next(); + if (child instanceof Panel) { + columHolderIterator = ((ComponentContainer) ((Panel) child) + .getContent()).getComponentIterator(); + } else { + columHolderIterator = ((ComponentContainer) child) .getComponentIterator(); - while (componentIterator.hasNext()) { - - Iterator<Component> columHolderIterator; - Component child = componentIterator.next(); - if (child instanceof Panel) { - columHolderIterator = ((ComponentContainer) ((Panel) child) - .getContent()).getComponentIterator(); - } else { - columHolderIterator = ((ComponentContainer) child) - .getComponentIterator(); - } - while (columHolderIterator.hasNext()) { - VerticalLayout column = (VerticalLayout) columHolderIterator - .next(); - Iterator<Component> columnIterator = column - .getComponentIterator(); - while (columnIterator.hasNext()) { - Label label = (Label) columnIterator.next(); - label.setValue("New value"); - } - } - } - updatePerformanceReporting("Update labels", 100, 100); - })); - - leftBar.addComponent( - new Button("Update one label", event -> { - Component child = contentLayout.getComponent(0); - if (child instanceof Panel) { - Panel panel = (Panel) child; - child = panel.getContent(); + } + while (columHolderIterator.hasNext()) { + VerticalLayout column = (VerticalLayout) columHolderIterator + .next(); + Iterator<Component> columnIterator = column + .getComponentIterator(); + while (columnIterator.hasNext()) { + Label label = (Label) columnIterator.next(); + label.setValue("New value"); } + } + } + updatePerformanceReporting("Update labels", 100, 100); + })); + + leftBar.addComponent(new Button("Update one label", event -> { + Component child = contentLayout.getComponent(0); + if (child instanceof Panel) { + Panel panel = (Panel) child; + child = panel.getContent(); + } - AbstractOrderedLayout layout = (AbstractOrderedLayout) ((AbstractOrderedLayout) child) - .getComponent(0); - Label label = (Label) layout.getComponent(0); + AbstractOrderedLayout layout = (AbstractOrderedLayout) ((AbstractOrderedLayout) child) + .getComponent(0); + Label label = (Label) layout.getComponent(0); - label.setValue("New value " + updateOneCount++); + label.setValue("New value " + updateOneCount++); - updatePerformanceReporting("Update one", 10, 10); - })); + updatePerformanceReporting("Update one", 10, 10); + })); - leftBar.addComponent( - new Button("Clear content", event -> { - contentLayout.removeAllComponents(); - contentLayout.addComponent(new Label("No content")); - updatePerformanceReporting("No content", 100, 100); - })); + leftBar.addComponent(new Button("Clear content", event -> { + contentLayout.removeAllComponents(); + contentLayout.addComponent(new Label("No content")); + updatePerformanceReporting("No content", 100, 100); + })); HorizontalLayout intermediateLayout = new HorizontalLayout(); intermediateLayout.setSizeFull(); diff --git a/uitest/src/main/java/com/vaadin/tests/performance/TreeGridMemory.java b/uitest/src/main/java/com/vaadin/tests/performance/TreeGridMemory.java index 3f4047e457..f09be5f667 100644 --- a/uitest/src/main/java/com/vaadin/tests/performance/TreeGridMemory.java +++ b/uitest/src/main/java/com/vaadin/tests/performance/TreeGridMemory.java @@ -55,8 +55,7 @@ public class TreeGridMemory extends AbstractBeansMemoryTest<TreeGrid<Person>> { protected void setInMemoryContainer(TreeGrid<Person> treeGrid, List<Person> data) { TreeData<Person> treeData = new TreeData<>(); - treeGrid.setDataProvider( - new TreeDataProvider<>(treeData)); + treeGrid.setDataProvider(new TreeDataProvider<>(treeData)); List<Person> toExpand = new ArrayList<>(); if (data.size() != 0 && data.size() % 2 == 0) { // treat list as if it were a balanced binary tree diff --git a/uitest/src/main/java/com/vaadin/tests/push/BasicPush.java b/uitest/src/main/java/com/vaadin/tests/push/BasicPush.java index b1f9ad6200..3bac95cf71 100644 --- a/uitest/src/main/java/com/vaadin/tests/push/BasicPush.java +++ b/uitest/src/main/java/com/vaadin/tests/push/BasicPush.java @@ -43,11 +43,10 @@ public class BasicPush extends AbstractReindeerTestUI { lbl.setId(CLIENT_COUNTER_ID); addComponent(lbl); - Button incrementButton = new Button("Increment", - event -> { - clientCounter++; - lbl.setValue(String.valueOf(clientCounter)); - }); + Button incrementButton = new Button("Increment", event -> { + clientCounter++; + lbl.setValue(String.valueOf(clientCounter)); + }); incrementButton.setId(INCREMENT_BUTTON_ID); addComponent(incrementButton); diff --git a/uitest/src/main/java/com/vaadin/tests/push/EnableDisablePush.java b/uitest/src/main/java/com/vaadin/tests/push/EnableDisablePush.java index 3202e86bf9..c74d303843 100644 --- a/uitest/src/main/java/com/vaadin/tests/push/EnableDisablePush.java +++ b/uitest/src/main/java/com/vaadin/tests/push/EnableDisablePush.java @@ -79,16 +79,14 @@ public class EnableDisablePush extends AbstractReindeerTestUI { log.log("Poll enabled"); })); - addComponent( - new Button("Disable push, re-enable from background thread", - event -> { - log.log("Disabling push, enabling polling"); - getPushConfiguration() - .setPushMode(PushMode.DISABLED); - setPollInterval(1000); - timer.schedule(new CounterTask(), new Date()); - log.log("Push disabled, polling enabled"); - })); + addComponent(new Button( + "Disable push, re-enable from background thread", event -> { + log.log("Disabling push, enabling polling"); + getPushConfiguration().setPushMode(PushMode.DISABLED); + setPollInterval(1000); + timer.schedule(new CounterTask(), new Date()); + log.log("Push disabled, polling enabled"); + })); addComponent(log); } diff --git a/uitest/src/main/java/com/vaadin/tests/push/ManualLongPollingPushUI.java b/uitest/src/main/java/com/vaadin/tests/push/ManualLongPollingPushUI.java index 8f53aca0c0..53f14f452b 100644 --- a/uitest/src/main/java/com/vaadin/tests/push/ManualLongPollingPushUI.java +++ b/uitest/src/main/java/com/vaadin/tests/push/ManualLongPollingPushUI.java @@ -17,38 +17,36 @@ public class ManualLongPollingPushUI extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { - Button b = new Button("Manual push after 1s", - event -> { - executor.submit(() -> { - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - access(() -> { - log("Logged after 1s, followed by manual push"); - push(); - }); - }); + Button b = new Button("Manual push after 1s", event -> { + executor.submit(() -> { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + access(() -> { + log("Logged after 1s, followed by manual push"); + push(); }); + }); + }); addComponent(b); - b = new Button("Double manual push after 1s", - event -> { - executor.submit(() -> { - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - access(() -> { - log("First message logged after 1s, followed by manual push"); - push(); - log("Second message logged after 1s, followed by manual push"); - push(); - }); - }); + b = new Button("Double manual push after 1s", event -> { + executor.submit(() -> { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + access(() -> { + log("First message logged after 1s, followed by manual push"); + push(); + log("Second message logged after 1s, followed by manual push"); + push(); }); + }); + }); addComponent(b); } diff --git a/uitest/src/main/java/com/vaadin/tests/push/PushConfiguration.java b/uitest/src/main/java/com/vaadin/tests/push/PushConfiguration.java index 86c54a6a91..c2e491a577 100644 --- a/uitest/src/main/java/com/vaadin/tests/push/PushConfiguration.java +++ b/uitest/src/main/java/com/vaadin/tests/push/PushConfiguration.java @@ -51,7 +51,7 @@ public class PushConfiguration extends AbstractReindeerTestUI { "Server counter (updates each 1s by server thread) :"); addComponent(serverCounterLabel); - addComponent(new Button("Reset", event ->{ + addComponent(new Button("Reset", event -> { counter2 = 0; serverCounterLabel.setValue("0"); })); diff --git a/uitest/src/main/java/com/vaadin/tests/push/PushErrorHandling.java b/uitest/src/main/java/com/vaadin/tests/push/PushErrorHandling.java index a94c3c0698..f4e1ea9729 100644 --- a/uitest/src/main/java/com/vaadin/tests/push/PushErrorHandling.java +++ b/uitest/src/main/java/com/vaadin/tests/push/PushErrorHandling.java @@ -21,16 +21,15 @@ public class PushErrorHandling extends AbstractReindeerTestUI { getPushConfiguration().setPushMode(PushMode.AUTOMATIC); VaadinSession.getCurrent().setErrorHandler(event -> { - addComponent( - new Label( - "An error! " + event.getThrowable().getMessage())); + addComponent(new Label( + "An error! " + event.getThrowable().getMessage())); System.err .println("An error! " + event.getThrowable().getMessage()); }); final Button button = new Button("Click for NPE!", event -> { - ((String) null).length(); // Null-pointer exception - }); + ((String) null).length(); // Null-pointer exception + }); button.setId("npeButton"); addComponent(button); diff --git a/uitest/src/main/java/com/vaadin/tests/push/PushWebsocketDeadlockUI.java b/uitest/src/main/java/com/vaadin/tests/push/PushWebsocketDeadlockUI.java index b8163e09c8..20d4877896 100644 --- a/uitest/src/main/java/com/vaadin/tests/push/PushWebsocketDeadlockUI.java +++ b/uitest/src/main/java/com/vaadin/tests/push/PushWebsocketDeadlockUI.java @@ -30,9 +30,8 @@ public class PushWebsocketDeadlockUI extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { WrappedSession wrappedSession = getSession().getSession(); - request.getService() - .addSessionDestroyListener(event -> System.out.println( - "Session " + event.getSession() + " destroyed")); + request.getService().addSessionDestroyListener(event -> System.out + .println("Session " + event.getSession() + " destroyed")); final Label l = new Label("Session timeout is " + wrappedSession.getMaxInactiveInterval() + "s"); addComponents(l); diff --git a/uitest/src/main/java/com/vaadin/tests/push/TablePushStreaming.java b/uitest/src/main/java/com/vaadin/tests/push/TablePushStreaming.java index 0217810b28..caaf87afc3 100644 --- a/uitest/src/main/java/com/vaadin/tests/push/TablePushStreaming.java +++ b/uitest/src/main/java/com/vaadin/tests/push/TablePushStreaming.java @@ -32,10 +32,8 @@ public class TablePushStreaming extends AbstractReindeerTestUI { } catch (InterruptedException e) { e.printStackTrace(); } - access(() -> - t.setContainerDataSource( - generateContainer(t.getVisibleColumns().length, - t.size(), iteration++))); + access(() -> t.setContainerDataSource(generateContainer( + t.getVisibleColumns().length, t.size(), iteration++))); } }; Thread tr = new Thread(r); diff --git a/uitest/src/main/java/com/vaadin/tests/push/TogglePush.java b/uitest/src/main/java/com/vaadin/tests/push/TogglePush.java index 7115e2f24d..15da3eca28 100644 --- a/uitest/src/main/java/com/vaadin/tests/push/TogglePush.java +++ b/uitest/src/main/java/com/vaadin/tests/push/TogglePush.java @@ -21,7 +21,8 @@ public class TogglePush extends AbstractReindeerTestUI { getPushConfiguration() .setPushMode("disabled".equals(request.getParameter("push")) - ? PushMode.DISABLED : PushMode.AUTOMATIC); + ? PushMode.DISABLED + : PushMode.AUTOMATIC); CheckBox pushSetting = new CheckBox("Push enabled"); pushSetting.setValue(Boolean @@ -38,15 +39,14 @@ public class TogglePush extends AbstractReindeerTestUI { addComponent( new Button("Update counter now", event -> updateCounter())); - addComponent(new Button("Update counter in 1 sec", - event -> { - new Timer().schedule(new TimerTask() { - @Override - public void run() { - access(() -> updateCounter()); - } - }, 1000); - })); + addComponent(new Button("Update counter in 1 sec", event -> { + new Timer().schedule(new TimerTask() { + @Override + public void run() { + access(() -> updateCounter()); + } + }, 1000); + })); } public void updateCounter() { diff --git a/uitest/src/main/java/com/vaadin/tests/requesthandlers/CommunicationError.java b/uitest/src/main/java/com/vaadin/tests/requesthandlers/CommunicationError.java index d96ca6619a..f722b2b057 100644 --- a/uitest/src/main/java/com/vaadin/tests/requesthandlers/CommunicationError.java +++ b/uitest/src/main/java/com/vaadin/tests/requesthandlers/CommunicationError.java @@ -51,20 +51,19 @@ public class CommunicationError extends UIProvider { @Override protected void setup(VaadinRequest request) { - Button button = new Button("Send bad request", - event -> { - try { - // An unparseable response will cause - // communication error - PrintWriter writer = VaadinService - .getCurrentResponse().getWriter(); - writer.write("for(;;)[{FOOBAR}]"); - writer.flush(); - writer.close(); - } catch (IOException e) { - e.printStackTrace(); - } - }); + Button button = new Button("Send bad request", event -> { + try { + // An unparseable response will cause + // communication error + PrintWriter writer = VaadinService.getCurrentResponse() + .getWriter(); + writer.write("for(;;)[{FOOBAR}]"); + writer.flush(); + writer.close(); + } catch (IOException e) { + e.printStackTrace(); + } + }); addComponent(button); } diff --git a/uitest/src/main/java/com/vaadin/tests/serialization/ChangeStateWhenReattaching.java b/uitest/src/main/java/com/vaadin/tests/serialization/ChangeStateWhenReattaching.java index a9fb5a3690..3e1cf07098 100644 --- a/uitest/src/main/java/com/vaadin/tests/serialization/ChangeStateWhenReattaching.java +++ b/uitest/src/main/java/com/vaadin/tests/serialization/ChangeStateWhenReattaching.java @@ -8,13 +8,12 @@ public class ChangeStateWhenReattaching extends AbstractReindeerTestUI { @Override protected void setup(VaadinRequest request) { - Button button = new Button("Reattach and remove caption", - event -> { - Button b = event.getButton(); - removeComponent(b); - addComponent(b); - b.setCaption(null); - }); + Button button = new Button("Reattach and remove caption", event -> { + Button b = event.getButton(); + removeComponent(b); + addComponent(b); + b.setCaption(null); + }); addComponent(button); } diff --git a/uitest/src/main/java/com/vaadin/tests/serialization/NoLayout.java b/uitest/src/main/java/com/vaadin/tests/serialization/NoLayout.java index 23a4232540..3601737e7c 100644 --- a/uitest/src/main/java/com/vaadin/tests/serialization/NoLayout.java +++ b/uitest/src/main/java/com/vaadin/tests/serialization/NoLayout.java @@ -27,10 +27,9 @@ public class NoLayout extends AbstractReindeerTestUI { }); addComponent(uiPolling); - addComponent( - new Button("Change regular state", - event -> event.getButton().setCaption( - String.valueOf(System.currentTimeMillis())))); + addComponent(new Button("Change regular state", + event -> event.getButton().setCaption( + String.valueOf(System.currentTimeMillis())))); addComponent(new Button("Change @NoLayout state", event -> event.getButton().setDescription( String.valueOf(System.currentTimeMillis())))); @@ -40,11 +39,10 @@ public class NoLayout extends AbstractReindeerTestUI { addComponent(new Button("Do @NoLayout RPC", event -> layoutDetector.doNoLayoutRpc())); - addComponent(new Button("Update LegacyComponent", - event -> { - // Assumes UI is a LegacyComponent - markAsDirty(); - })); + addComponent(new Button("Update LegacyComponent", event -> { + // Assumes UI is a LegacyComponent + markAsDirty(); + })); } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/themes/CSSInjectTest.java b/uitest/src/main/java/com/vaadin/tests/themes/CSSInjectTest.java index 8ed4ad92c3..ddd812a08c 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/CSSInjectTest.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/CSSInjectTest.java @@ -47,27 +47,24 @@ public class CSSInjectTest extends TestBase { }); addComponent(inject); - Button injectRandom = new Button("Inject as resource!", - event -> { - final String css = cssToInject.getValue(); - - stylesheet.add(new StreamResource( - new StreamResource.StreamSource() { - - @Override - public InputStream getStream() { - return new ByteArrayInputStream( - css.getBytes()); - } - }, UUID.randomUUID() + ".css")); - - cssToInject.setValue(""); - }); + Button injectRandom = new Button("Inject as resource!", event -> { + final String css = cssToInject.getValue(); + + stylesheet + .add(new StreamResource(new StreamResource.StreamSource() { + + @Override + public InputStream getStream() { + return new ByteArrayInputStream(css.getBytes()); + } + }, UUID.randomUUID() + ".css")); + + cssToInject.setValue(""); + }); addComponent(injectRandom); - addComponent( - new Button("Inject initial again!", - event -> stylesheet.add(initialResource))); + addComponent(new Button("Inject initial again!", + event -> stylesheet.add(initialResource))); } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/ButtonsAndLinks.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/ButtonsAndLinks.java index deeb1d2604..74b1a106fc 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/valo/ButtonsAndLinks.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/ButtonsAndLinks.java @@ -12,7 +12,8 @@ import com.vaadin.ui.NativeButton; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.themes.ValoTheme; -public class ButtonsAndLinks extends VerticalLayout implements View { public ButtonsAndLinks() { +public class ButtonsAndLinks extends VerticalLayout implements View { + public ButtonsAndLinks() { setSpacing(false); Label h1 = new Label("Buttons"); diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/CalendarTest.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/CalendarTest.java index d3ba3f2588..e890c8532d 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/valo/CalendarTest.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/CalendarTest.java @@ -581,8 +581,8 @@ public class CalendarTest extends GridLayout implements View { }); calendarComponent - .setHandler((EventClickHandler) - event -> showEventPopup(event.getCalendarEvent(), false)); + .setHandler((EventClickHandler) event -> showEventPopup( + event.getCalendarEvent(), false)); calendarComponent.setHandler(new BasicDateClickHandler() { @@ -595,9 +595,8 @@ public class CalendarTest extends GridLayout implements View { } }); - calendarComponent - .setHandler( - (RangeSelectHandler) event -> handleRangeSelect(event)); + calendarComponent.setHandler( + (RangeSelectHandler) event -> handleRangeSelect(event)); } private ComboBox createTimeZoneSelect() { 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 a46ea05726..7b3d9fb337 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 @@ -417,14 +417,13 @@ public class CommonParts extends VerticalLayout implements View { tabs.addTab(new Label(" ", ContentMode.HTML), "One more"); tabs.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR); - tabs.addSelectedTabChangeListener( - event -> { - try { - Thread.sleep(600); - } catch (InterruptedException e) { - e.printStackTrace(); - } - }); + tabs.addSelectedTabChangeListener(event -> { + try { + Thread.sleep(600); + } catch (InterruptedException e) { + e.printStackTrace(); + } + }); content = tabs; } else if (!autoHeight) { Panel p = new Panel(); @@ -584,13 +583,12 @@ public class CommonParts extends VerticalLayout implements View { options.addStyleName(ValoTheme.MENUBAR_SMALL); addComponent(options); - final Button show = new Button("Open Window", - event -> { - getUI().addWindow(win); - win.center(); - win.focus(); - event.getButton().setEnabled(false); - }); + final Button show = new Button("Open Window", event -> { + getUI().addWindow(win); + win.center(); + win.focus(); + event.getButton().setEnabled(false); + }); show.addStyleName(ValoTheme.BUTTON_PRIMARY); addComponent(show); diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/DateFields.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/DateFields.java index 5f678f4598..37334686f0 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/valo/DateFields.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/DateFields.java @@ -34,7 +34,8 @@ public class DateFields extends VerticalLayout implements View { row.addStyleName(ValoTheme.LAYOUT_HORIZONTAL_WRAPPING); addComponent(row); - AbstractDateField<LocalDate, DateResolution> date = new TestDateField("Default resolution"); + AbstractDateField<LocalDate, DateResolution> date = new TestDateField( + "Default resolution"); setDate(date); row.addComponent(date); @@ -167,7 +168,8 @@ public class DateFields extends VerticalLayout implements View { row.addComponent(form); } - private void setDateRange(AbstractDateField<LocalDate, DateResolution> date) { + private void setDateRange( + AbstractDateField<LocalDate, DateResolution> date) { date.setRangeStart(getDefaultDate()); LocalDate endDate = getDefaultDate(); diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/Forms.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/Forms.java index 2e583d3c4c..46cd25b6c6 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/valo/Forms.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/Forms.java @@ -52,7 +52,8 @@ public class Forms extends VerticalLayout implements View { name.setWidth("50%"); form.addComponent(name); - AbstractDateField<LocalDate, DateResolution> birthday = new TestDateField("Birthday"); + AbstractDateField<LocalDate, DateResolution> birthday = new TestDateField( + "Birthday"); birthday.setValue(LocalDate.of(1980, 1, 31)); form.addComponent(birthday); diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/NotificationStyle.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/NotificationStyle.java index 7a9f845b90..d8b734fb9d 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/valo/NotificationStyle.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/NotificationStyle.java @@ -14,26 +14,22 @@ public class NotificationStyle extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - Button button = new Button("Show notification with h1", - event -> { - Notification notification = new Notification( - "<p>Caption</p>", - "<div style='display:inline-block;'><h1>Description</h1>" - + "<p class='tested-p'>tested p</p></div>"); - notification.setHtmlContentAllowed(true); - notification.setDelayMsec(50000); - notification.show(getPage()); - }); + Button button = new Button("Show notification with h1", event -> { + Notification notification = new Notification("<p>Caption</p>", + "<div style='display:inline-block;'><h1>Description</h1>" + + "<p class='tested-p'>tested p</p></div>"); + notification.setHtmlContentAllowed(true); + notification.setDelayMsec(50000); + notification.show(getPage()); + }); addComponent(button); - button = new Button("Show notification with p", - event -> { - Notification notification = new Notification( - "<p>Caption</p>", - "Description text<p class='tested-p'>tested p text</p>"); - notification.setHtmlContentAllowed(true); - notification.setDelayMsec(50000); - notification.show(getPage()); - }); + button = new Button("Show notification with p", event -> { + Notification notification = new Notification("<p>Caption</p>", + "Description text<p class='tested-p'>tested p text</p>"); + notification.setHtmlContentAllowed(true); + notification.setDelayMsec(50000); + notification.show(getPage()); + }); addComponent(button); } diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/PopupViews.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/PopupViews.java index f8ec9458b3..83a0d4bb59 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/valo/PopupViews.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/PopupViews.java @@ -58,13 +58,12 @@ public class PopupViews extends VerticalLayout implements View { return new VerticalLayout() { { setSpacing(false); - addComponent( - new Label( - "<h3>Thanks for waiting!</h3><p>You've opened this popup <b>" - + ++count + " time" - + (count > 1 ? "s" : " only") - + "</b>.</p>", - ContentMode.HTML)); + addComponent(new Label( + "<h3>Thanks for waiting!</h3><p>You've opened this popup <b>" + + ++count + " time" + + (count > 1 ? "s" : " only") + + "</b>.</p>", + ContentMode.HTML)); } }; } diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/StringGenerator.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/StringGenerator.java index a4fd7117f3..aa8a4fb9e9 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/valo/StringGenerator.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/StringGenerator.java @@ -3,9 +3,9 @@ package com.vaadin.tests.themes.valo; import com.vaadin.shared.util.SharedUtil; public class StringGenerator { - static String[] strings = { "lorem", "ipsum", "dolor", "sit", - "amet", "consectetur", "quid", "securi", "etiam", "tamquam", "eu", - "fugiat", "nulla", "pariatur" }; + static String[] strings = { "lorem", "ipsum", "dolor", "sit", "amet", + "consectetur", "quid", "securi", "etiam", "tamquam", "eu", "fugiat", + "nulla", "pariatur" }; int stringCount = -1; String nextString(boolean capitalize) { diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/Tabsheets.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/Tabsheets.java index 2692eca678..5ad8135f9f 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/valo/Tabsheets.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/Tabsheets.java @@ -121,7 +121,8 @@ public class Tabsheets extends VerticalLayout implements View { for (int i = 1; i <= (scrolling ? 10 : 3); i++) { String tabcaption = caption - ? sg.nextString(true) + " " + sg.nextString(false) : null; + ? sg.nextString(true) + " " + sg.nextString(false) + : null; VerticalLayout content = new VerticalLayout(); content.addComponent(new Label("Content for tab " + i)); diff --git a/uitest/src/main/java/com/vaadin/tests/tooltip/TooltipConfiguration.java b/uitest/src/main/java/com/vaadin/tests/tooltip/TooltipConfiguration.java index a9ddb9f1bb..c972c8469a 100644 --- a/uitest/src/main/java/com/vaadin/tests/tooltip/TooltipConfiguration.java +++ b/uitest/src/main/java/com/vaadin/tests/tooltip/TooltipConfiguration.java @@ -53,23 +53,21 @@ public class TooltipConfiguration extends AbstractReindeerTestUIWithLog { quickOpenDelay = createIntegerTextField("Quick open delay", getState().tooltipConfiguration.quickOpenDelay); - quickOpenDelay - .addValueChangeListener(event -> { - if (quickOpenDelay.getConvertedValue() != null) { - getTooltipConfiguration().setQuickOpenDelay( - (Integer) quickOpenDelay.getConvertedValue()); - } - }); + quickOpenDelay.addValueChangeListener(event -> { + if (quickOpenDelay.getConvertedValue() != null) { + getTooltipConfiguration().setQuickOpenDelay( + (Integer) quickOpenDelay.getConvertedValue()); + } + }); quickOpenTimeout = createIntegerTextField("Quick open timeout", getState().tooltipConfiguration.quickOpenTimeout); - quickOpenTimeout - .addValueChangeListener(event -> { - if (quickOpenTimeout.getConvertedValue() != null) { - getTooltipConfiguration().setQuickOpenTimeout( - (Integer) quickOpenTimeout.getConvertedValue()); - } - }); + quickOpenTimeout.addValueChangeListener(event -> { + if (quickOpenTimeout.getConvertedValue() != null) { + getTooltipConfiguration().setQuickOpenTimeout( + (Integer) quickOpenTimeout.getConvertedValue()); + } + }); getLayout().addComponents(closeTimeout, openDelay, quickOpenDelay, quickOpenTimeout, maxWidth); diff --git a/uitest/src/main/java/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java b/uitest/src/main/java/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java index 838f9bdf8b..96a51b8a3b 100644 --- a/uitest/src/main/java/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java +++ b/uitest/src/main/java/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java @@ -18,14 +18,11 @@ public class BootstrapModifyUI extends AbstractReindeerTestUI { @Override protected void setup(VaadinRequest request) { - Button c = new Button("Add bootstrap listener", - event->{ - getSession().addBootstrapListener( - createBootstrapListener()); - event.getButton().setEnabled(false); - getSession().setAttribute(INSTALLED_ATRIBUTE_NAME, - Boolean.TRUE); - }); + Button c = new Button("Add bootstrap listener", event -> { + getSession().addBootstrapListener(createBootstrapListener()); + event.getButton().setEnabled(false); + getSession().setAttribute(INSTALLED_ATRIBUTE_NAME, Boolean.TRUE); + }); addComponent(c); c.setEnabled( getSession().getAttribute(INSTALLED_ATRIBUTE_NAME) == null); diff --git a/uitest/src/main/java/com/vaadin/tests/widgetset/client/ConnectorBundleStatusDisplayConnector.java b/uitest/src/main/java/com/vaadin/tests/widgetset/client/ConnectorBundleStatusDisplayConnector.java index 0be4225ef8..8095225331 100644 --- a/uitest/src/main/java/com/vaadin/tests/widgetset/client/ConnectorBundleStatusDisplayConnector.java +++ b/uitest/src/main/java/com/vaadin/tests/widgetset/client/ConnectorBundleStatusDisplayConnector.java @@ -9,7 +9,8 @@ import com.vaadin.shared.ui.Connect; import com.vaadin.tests.widgetset.server.ConnectorBundleStatusDisplay; @Connect(ConnectorBundleStatusDisplay.class) -public class ConnectorBundleStatusDisplayConnector extends AbstractComponentConnector { +public class ConnectorBundleStatusDisplayConnector + extends AbstractComponentConnector { @Override public Label getWidget() { return (Label) super.getWidget(); diff --git a/uitest/src/main/java/com/vaadin/tests/widgetset/client/ResizeTerrorizerControlConnector.java b/uitest/src/main/java/com/vaadin/tests/widgetset/client/ResizeTerrorizerControlConnector.java index 65b8d33126..d3b1ff8c8d 100644 --- a/uitest/src/main/java/com/vaadin/tests/widgetset/client/ResizeTerrorizerControlConnector.java +++ b/uitest/src/main/java/com/vaadin/tests/widgetset/client/ResizeTerrorizerControlConnector.java @@ -45,8 +45,7 @@ public class ResizeTerrorizerControlConnector extends AbstractComponentConnector private final Button terrorizeButton = new Button("Terrorize", (ClickHandler) event -> terrorize(startWidth.getValue(), endWidth.getValue(), startHeight.getValue(), - endHeight.getValue(), - 1000)); + endHeight.getValue(), 1000)); private HandlerRegistration historyHandlerRegistration; @@ -225,15 +224,13 @@ public class ResizeTerrorizerControlConnector extends AbstractComponentConnector if (panel.startWidth.getValue() == null) { int width = getTarget().getWidget().getElement().getOffsetWidth(); panel.startWidth.setValue(width); - panel.endWidth - .setValue(width + getState().defaultWidthOffset); + panel.endWidth.setValue(width + getState().defaultWidthOffset); } if (panel.startHeight.getValue() == null) { int height = getTarget().getWidget().getElement().getOffsetHeight(); panel.startHeight.setValue(height); - panel.endHeight - .setValue(height + getState().defaultHeightOffset); + panel.endHeight.setValue(height + getState().defaultHeightOffset); } } diff --git a/uitest/src/main/java/com/vaadin/tests/widgetset/client/extension/EventTriggerExtensionConnector.java b/uitest/src/main/java/com/vaadin/tests/widgetset/client/extension/EventTriggerExtensionConnector.java index 10994f7430..cb686ffbf9 100644 --- a/uitest/src/main/java/com/vaadin/tests/widgetset/client/extension/EventTriggerExtensionConnector.java +++ b/uitest/src/main/java/com/vaadin/tests/widgetset/client/extension/EventTriggerExtensionConnector.java @@ -5,9 +5,10 @@ import com.vaadin.shared.ui.Connect; import com.vaadin.tests.extensions.EventTriggerExtension; @Connect(EventTriggerExtension.class) -public class EventTriggerExtensionConnector extends AbstractEventTriggerExtensionConnector{ +public class EventTriggerExtensionConnector + extends AbstractEventTriggerExtensionConnector { @Override protected native void trigger() /*-{ - alert("Trigger"); - }-*/; + alert("Trigger"); + }-*/; } diff --git a/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridThemeUI.java b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridThemeUI.java index 6f208285e5..fc71bdfbe4 100644 --- a/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridThemeUI.java +++ b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridThemeUI.java @@ -25,8 +25,8 @@ public class GridThemeUI extends AbstractTestUIWithLog { private Grid grid; - protected static String[] columns = { "firstName", "lastName", - "gender", "birthDate", "age", "alive", "address.streetAddress", + protected static String[] columns = { "firstName", "lastName", "gender", + "birthDate", "age", "alive", "address.streetAddress", "address.postalCode", "address.city", "address.country" }; protected BeanItemContainer<ComplexPerson> container = ComplexPerson diff --git a/uitest/src/main/java/com/vaadin/v7/tests/components/grid/MyBeanJSRenderer.java b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/MyBeanJSRenderer.java index 9cf074ce81..fad9d8acdd 100644 --- a/uitest/src/main/java/com/vaadin/v7/tests/components/grid/MyBeanJSRenderer.java +++ b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/MyBeanJSRenderer.java @@ -4,11 +4,6 @@ import com.vaadin.annotations.JavaScript; import com.vaadin.v7.tests.components.grid.JavaScriptRenderers.MyBean; import com.vaadin.v7.ui.renderers.AbstractJavaScriptRenderer; -/** - * - * @since - * @author Vaadin Ltd - */ @JavaScript("myBeanJsRenderer.js") public class MyBeanJSRenderer extends AbstractJavaScriptRenderer<MyBean> { diff --git a/uitest/src/main/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridBasicClientFeatures.java b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridBasicClientFeatures.java index b82e3b2298..9be0254d59 100644 --- a/uitest/src/main/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridBasicClientFeatures.java +++ b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridBasicClientFeatures.java @@ -10,7 +10,6 @@ import com.vaadin.ui.UI; /** * Initializer shell for GridClientBasicFeatures test application * - * @since * @author Vaadin Ltd */ @Widgetset(TestingWidgetSet.NAME) diff --git a/uitest/src/main/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridBasicFeatures.java b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridBasicFeatures.java index 4981acaf36..6b7e9ae182 100644 --- a/uitest/src/main/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridBasicFeatures.java +++ b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridBasicFeatures.java @@ -71,7 +71,6 @@ import com.vaadin.v7.ui.renderers.NumberRenderer; /** * Tests the basic features like columns, footers and headers * - * @since * @author Vaadin Ltd */ @Theme("valo") @@ -664,11 +663,13 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { createSelectAction("Row description generator", "State", contentModes, "None", new Command<Grid, ContentMode>() { @Override - public void execute(Grid grid, ContentMode mode, Object data) { + public void execute(Grid grid, ContentMode mode, + Object data) { if (mode == null) { grid.setRowDescriptionGenerator(null); } else if (mode == ContentMode.PREFORMATTED) { - grid.setRowDescriptionGenerator(rowDescriptionGenerator); + grid.setRowDescriptionGenerator( + rowDescriptionGenerator); } else { grid.setRowDescriptionGenerator( rowDescriptionGenerator, mode); @@ -676,14 +677,16 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { } }); - createSelectAction("Cell description generator", "State", - contentModes, "None", new Command<Grid, ContentMode>() { + createSelectAction("Cell description generator", "State", contentModes, + "None", new Command<Grid, ContentMode>() { @Override - public void execute(Grid grid, ContentMode mode, Object data) { + public void execute(Grid grid, ContentMode mode, + Object data) { if (mode == null) { grid.setCellDescriptionGenerator(null); } else if (mode == ContentMode.PREFORMATTED) { - grid.setCellDescriptionGenerator(cellDescriptionGenerator); + grid.setCellDescriptionGenerator( + cellDescriptionGenerator); } else { grid.setCellDescriptionGenerator( cellDescriptionGenerator, mode); diff --git a/uitest/src/main/java/com/vaadin/v7/tests/components/tree/TreeToolTips.java b/uitest/src/main/java/com/vaadin/v7/tests/components/tree/TreeToolTips.java index 320d44936e..6c5bdfffa1 100644 --- a/uitest/src/main/java/com/vaadin/v7/tests/components/tree/TreeToolTips.java +++ b/uitest/src/main/java/com/vaadin/v7/tests/components/tree/TreeToolTips.java @@ -10,10 +10,9 @@ public class TreeToolTips extends TestBase { @Override protected void setup() { final Tree tree = new Tree(null, createContainer()); - tree.setItemDescriptionGenerator( - (source, itemId, - propertyId) -> "This is a tooltip for item id '" - + itemId + "'"); + tree.setItemDescriptionGenerator((source, itemId, + propertyId) -> "This is a tooltip for item id '" + itemId + + "'"); for (Object rootItems : tree.rootItemIds()) { tree.expandItemsRecursively(rootItems); diff --git a/uitest/src/main/resources/com/vaadin/tests/widgetset/TestingWidgetSet.gwt.xml b/uitest/src/main/resources/com/vaadin/tests/widgetset/TestingWidgetSet.gwt.xml index db262f45b0..60103c1ff5 100644 --- a/uitest/src/main/resources/com/vaadin/tests/widgetset/TestingWidgetSet.gwt.xml +++ b/uitest/src/main/resources/com/vaadin/tests/widgetset/TestingWidgetSet.gwt.xml @@ -20,10 +20,10 @@ class="com.vaadin.tests.widgetset.client.MockApplicationConnection"> <when-type-is class="com.vaadin.client.ApplicationConnection" /> </replace-with> - + <generate-with class="com.vaadin.tests.widgetset.rebind.TestWidgetRegistryGenerator"> <when-type-is class="com.vaadin.tests.widgetset.client.TestWidgetConnector.TestWidgetRegistry" /> </generate-with> - + <entry-point class="com.vaadin.tests.widgetset.client.TestingWidgetsetEntryPoint" /> </module> diff --git a/uitest/src/main/webapp/WEB-INF/portlet.xml b/uitest/src/main/webapp/WEB-INF/portlet.xml index 3886dc65e9..3276048afb 100644 --- a/uitest/src/main/webapp/WEB-INF/portlet.xml +++ b/uitest/src/main/webapp/WEB-INF/portlet.xml @@ -40,6 +40,6 @@ </security-role-ref> </portlet> - <!-- This can be used to work around an issue in liferay 5.0-5.1.1 <container-runtime-option> + <!-- This can be used to work around an issue in liferay 5.0-5.1.1 <container-runtime-option> <name>javax.portlet.escapeXml</name> <value>false</value> </container-runtime-option> --> -</portlet-app>
\ No newline at end of file +</portlet-app> diff --git a/uitest/src/main/webapp/WEB-INF/web.xml b/uitest/src/main/webapp/WEB-INF/web.xml index 1771a0bd98..a52478bb0c 100644 --- a/uitest/src/main/webapp/WEB-INF/web.xml +++ b/uitest/src/main/webapp/WEB-INF/web.xml @@ -115,8 +115,8 @@ </servlet> <servlet> - <!-- This servlet is a separate instance for the sole purpose of - testing #12446 (com.vaadin.tests.components.ui.TimeoutRedirectResetsOnActivity) + <!-- This servlet is a separate instance for the sole purpose of + testing #12446 (com.vaadin.tests.components.ui.TimeoutRedirectResetsOnActivity) because it modifies the VaadinService timeout parameters --> <servlet-name>VaadinApplicationRunnerWithTimeoutRedirect</servlet-name> <servlet-class>com.vaadin.launcher.ApplicationRunnerServlet</servlet-class> diff --git a/uitest/src/test/java/com/vaadin/tests/components/MenuBarDownloadBrowserOpenerUITest.java b/uitest/src/test/java/com/vaadin/tests/components/MenuBarDownloadBrowserOpenerUITest.java index 00e12bd1f3..86efdbb4d4 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/MenuBarDownloadBrowserOpenerUITest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/MenuBarDownloadBrowserOpenerUITest.java @@ -14,7 +14,7 @@ import com.vaadin.tests.tb3.MultiBrowserTest; public class MenuBarDownloadBrowserOpenerUITest extends MultiBrowserTest { @Override public List<DesiredCapabilities> getBrowsersToTest() { - //alerts do not work properly on PhantomJS + // alerts do not work properly on PhantomJS return getBrowserCapabilities(Browser.CHROME); } @@ -37,7 +37,7 @@ public class MenuBarDownloadBrowserOpenerUITest extends MultiBrowserTest { private void checkAndCloseAlert() { Alert alert = getDriver().switchTo().alert(); - Assert.assertEquals("Trigger",alert.getText()); + Assert.assertEquals("Trigger", alert.getText()); alert.dismiss(); } 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 dc283d0141..3897a76e4f 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 @@ -365,13 +365,18 @@ public class CheckBoxGroupTest extends MultiBrowserTest { openTestURL("theme=valo"); selectMenuPath("Component", "Selection", "Toggle Item 5"); - String className = getSelect().getOptionElements().get(5).getAttribute("className"); - assertTrue("No v-select-option-selected class, was " + className, className.contains("v-select-option-selected")); + String className = getSelect().getOptionElements().get(5) + .getAttribute("className"); + assertTrue("No v-select-option-selected class, was " + className, + className.contains("v-select-option-selected")); selectMenuPath("Component", "Selection", "Toggle Item 5"); - className = getSelect().getOptionElements().get(5).getAttribute("className"); - assertFalse("Extra v-select-option-selected class, was " + className, className.contains("v-select-option-selected")); + className = getSelect().getOptionElements().get(5) + .getAttribute("className"); + assertFalse("Extra v-select-option-selected class, was " + className, + className.contains("v-select-option-selected")); } + // needed to make tooltips work in IE tests @Override protected boolean requireWindowFocusForIE() { diff --git a/uitest/src/test/java/com/vaadin/tests/components/colorpicker/ColorPickerModalTest.java b/uitest/src/test/java/com/vaadin/tests/components/colorpicker/ColorPickerModalTest.java index 0af1f52735..3ecfee7c9c 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/colorpicker/ColorPickerModalTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/colorpicker/ColorPickerModalTest.java @@ -17,4 +17,4 @@ public class ColorPickerModalTest extends MultiBrowserTest { Assert.assertEquals(false, label.getText().contains("Exception caught")); } -}
\ No newline at end of file +} diff --git a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxHeightTest.java b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxHeightTest.java index 512238b759..5d78fb5a66 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxHeightTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxHeightTest.java @@ -26,9 +26,8 @@ public class ComboBoxHeightTest extends SingleBrowserTest { comboBox.openPopup(); WebElement suggestionPopup = comboBox.getSuggestionPopup(); - int suggestionPopupBottom = - suggestionPopup.getLocation().getY() + suggestionPopup.getSize() - .getHeight(); + int suggestionPopupBottom = suggestionPopup.getLocation().getY() + + suggestionPopup.getSize().getHeight(); assertGreaterOrEqual( "Combo box suggestion popup should not exceed the browser's viewport", diff --git a/uitest/src/test/java/com/vaadin/tests/components/datefield/AriaDateTimeDisabledTest.java b/uitest/src/test/java/com/vaadin/tests/components/datefield/AriaDateTimeDisabledTest.java index bac3f01519..929eeab1d2 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/datefield/AriaDateTimeDisabledTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/datefield/AriaDateTimeDisabledTest.java @@ -14,9 +14,8 @@ public class AriaDateTimeDisabledTest extends MultiBrowserTest { openTestURL(); // Expect aria-disabled="false" on the enabled DateField. - String ariaDisabled = driver - .findElement(By - .vaadin("/VVerticalLayout[0]/VPopupTimeCalendar[1]#popupButton")) + String ariaDisabled = driver.findElement(By.vaadin( + "/VVerticalLayout[0]/VPopupTimeCalendar[1]#popupButton")) .getAttribute("aria-disabled"); assertEquals("false", ariaDisabled); diff --git a/uitest/src/test/java/com/vaadin/tests/components/datefield/AriaDisabledTest.java b/uitest/src/test/java/com/vaadin/tests/components/datefield/AriaDisabledTest.java index 70b9c1e8d1..86cb65a7ac 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/datefield/AriaDisabledTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/datefield/AriaDisabledTest.java @@ -15,8 +15,8 @@ public class AriaDisabledTest extends MultiBrowserTest { // Expect aria-disabled="false" on the enabled DateField. String ariaDisabled = driver - .findElement(By - .vaadin("/VVerticalLayout[0]/VPopupCalendar[1]#popupButton")) + .findElement(By.vaadin( + "/VVerticalLayout[0]/VPopupCalendar[1]#popupButton")) .getAttribute("aria-disabled"); assertEquals("false", ariaDisabled); diff --git a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldAriaTest.java b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldAriaTest.java index 1d3cd39736..83f0a7103d 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldAriaTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldAriaTest.java @@ -25,7 +25,7 @@ public class DateFieldAriaTest extends SingleBrowserTest { Assert.assertEquals("Previous month", prevMonthButton.getAttribute("aria-label")); - dateField.openPopup(); // This actually closes the calendar popup + dateField.openPopup(); // This actually closes the calendar popup ButtonElement changeLabelsButton = $(ButtonElement.class).first(); changeLabelsButton.click(); diff --git a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldChangeResolutionTest.java b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldChangeResolutionTest.java index 6651e7d8d4..adee2682f5 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldChangeResolutionTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldChangeResolutionTest.java @@ -30,7 +30,8 @@ public class DateFieldChangeResolutionTest extends MultiBrowserTest { @Test public void changeResolutionToDayThenMonth() throws Exception { initialize(); - checkHeaderAndBody(DateResolution.YEAR, true); // check the initial state + checkHeaderAndBody(DateResolution.YEAR, true); // check the initial + // state click(resolutionDay); checkHeaderAndBody(DateResolution.DAY, true); click(resolutionMonth); diff --git a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldValidationErrorTest.java b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldValidationErrorTest.java index 6bfa1d2e2b..703299a4f8 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldValidationErrorTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldValidationErrorTest.java @@ -13,7 +13,8 @@ import org.openqa.selenium.support.ui.ExpectedConditions; public class DateFieldValidationErrorTest extends MultiBrowserTest { @Test - public void testComponentErrorShouldBeShownWhenEnteringInvalidDate() throws InterruptedException { + public void testComponentErrorShouldBeShownWhenEnteringInvalidDate() + throws InterruptedException { openTestURL(); DateFieldElement dateField = $(DateFieldElement.class).first(); dateField.getInputElement().click(); @@ -23,16 +24,20 @@ public class DateFieldValidationErrorTest extends MultiBrowserTest { } @Test - public void testComponentErrorShouldBeShownWhenSelectingInvalidDate() throws InterruptedException { + public void testComponentErrorShouldBeShownWhenSelectingInvalidDate() + throws InterruptedException { openTestURL(); DateFieldElement dateField = $(DateFieldElement.class).first(); dateField.setDate(LocalDate.now()); dateField.openPopup(); - waitUntil(ExpectedConditions.visibilityOfElementLocated(By.className("v-datefield-popup"))); + waitUntil(ExpectedConditions + .visibilityOfElementLocated(By.className("v-datefield-popup"))); - WebElement popup = findElement(com.vaadin.testbench.By.className("v-datefield-popup")); + WebElement popup = findElement( + com.vaadin.testbench.By.className("v-datefield-popup")); // select day before today - WebElement popupBody = popup.findElement(By.className("v-datefield-calendarpanel")); + WebElement popupBody = popup + .findElement(By.className("v-datefield-calendarpanel")); popupBody.sendKeys(Keys.ARROW_LEFT, Keys.ENTER); // move focus away otherwise tooltip is not shown @@ -46,7 +51,8 @@ public class DateFieldValidationErrorTest extends MultiBrowserTest { private void assertHasErrorMessage(DateFieldElement dateField) { waitForElementPresent(By.className("v-errorindicator")); dateField.showTooltip(); - waitUntil(driver -> "Invalid date".equals(getTooltipErrorElement().getText())); + waitUntil(driver -> "Invalid date" + .equals(getTooltipErrorElement().getText())); } @Override diff --git a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTextHandlingTest.java b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTextHandlingTest.java index 848759c76d..87621c6db7 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTextHandlingTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTextHandlingTest.java @@ -21,13 +21,14 @@ public class DateTextHandlingTest extends SingleBrowserTest { ButtonElement validate = $(ButtonElement.class).first(); WebElement dateTextbox = dateFieldElement.getInputElement(); - dateTextbox.sendKeys("Y2K",Keys.TAB); + dateTextbox.sendKeys("Y2K", Keys.TAB); validate.click(); - assertNotification("Y2K Should be converted to " + Y2K_GB_LOCALE, Y2K_GB_LOCALE); + assertNotification("Y2K Should be converted to " + Y2K_GB_LOCALE, + Y2K_GB_LOCALE); dateTextbox.clear(); validate.click(); - assertNotification("Null for empty string","NULL"); + assertNotification("Null for empty string", "NULL"); } protected void assertNotification(String message, String expected) { diff --git a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldChangeResolutionTest.java b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldChangeResolutionTest.java index 54f10e487f..7f1a275528 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldChangeResolutionTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldChangeResolutionTest.java @@ -181,4 +181,4 @@ public class DateTimeFieldChangeResolutionTest extends MultiBrowserTest { .findElement(By.cssSelector(".v-datefield-calendarpanel")); element.sendKeys(Keys.ESCAPE); } -}
\ No newline at end of file +} diff --git a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldKeyboardInputTest.java b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldKeyboardInputTest.java index 67f85371cc..2a38b8dc68 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldKeyboardInputTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldKeyboardInputTest.java @@ -25,4 +25,4 @@ public class DateTimeFieldKeyboardInputTest extends MultiBrowserTest { assertTrue("Changing the date failed.", numLabelsAfterUpdate == numLabelsBeforeUpdate + 1); } -}
\ No newline at end of file +} diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridAriaRowcountTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridAriaRowcountTest.java index fd4613f393..10f8d277a3 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridAriaRowcountTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridAriaRowcountTest.java @@ -23,11 +23,16 @@ public class GridAriaRowcountTest extends SingleBrowserTest { // default grid should contain at least one of each role String gridHtml = grid.getHTML(); - assertTrue("Grid should contain a role=\"rowheader\"", gridHtml.contains("role=\"rowheader\"")); - assertTrue("Grid should contain a role=\"columnheader\"", gridHtml.contains("role=\"columnheader\"")); - assertTrue("Grid should contain a role=\"row\"", gridHtml.contains("role=\"row\"")); - assertTrue("Grid should contain a role=\"gridcell\"", gridHtml.contains("role=\"gridcell\"")); - assertTrue("Grid should contain a role=\"rowgroup\"", gridHtml.contains("role=\"rowgroup\"")); + assertTrue("Grid should contain a role=\"rowheader\"", + gridHtml.contains("role=\"rowheader\"")); + assertTrue("Grid should contain a role=\"columnheader\"", + gridHtml.contains("role=\"columnheader\"")); + assertTrue("Grid should contain a role=\"row\"", + gridHtml.contains("role=\"row\"")); + assertTrue("Grid should contain a role=\"gridcell\"", + gridHtml.contains("role=\"gridcell\"")); + assertTrue("Grid should contain a role=\"rowgroup\"", + gridHtml.contains("role=\"rowgroup\"")); // default with 1 header row and 2 body rows. assertTrue("Grid should have 3 rows", containsRows(3)); diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnPresentationTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnPresentationTest.java index 79233dc50d..13e304808d 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnPresentationTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnPresentationTest.java @@ -16,11 +16,12 @@ public class GridColumnPresentationTest extends SingleBrowserTest { GridElement grid = $(GridElement.class).get(0); assertEquals("Turku FINLAND", grid.getCell(0, 0).getText()); assertEquals("Amsterdam NETHERLANDS", grid.getCell(1, 0).getText()); - //Activate editor + // Activate editor GridElement.GridCellElement cell = grid.getCell(1, 0); cell.doubleClick(); - assertEquals("Address [streetAddress=Red street, postalCode=12, city=Amsterdam, country=Netherlands]", + assertEquals( + "Address [streetAddress=Red street, postalCode=12, city=Amsterdam, country=Netherlands]", grid.getEditor().getField(0).getText()); } diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/GridColumnResizeModeTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/GridColumnResizeModeTest.java index e12151b66d..df51706ddb 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/GridColumnResizeModeTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/GridColumnResizeModeTest.java @@ -103,28 +103,28 @@ public class GridColumnResizeModeTest extends GridBasicsTest { // ANIMATED resize mode drag(handle, 100); - assertTrue(getLogRow(0).contains( - "Column resized: caption=Column 1, width=" + cell.getSize() - .getWidth())); + assertTrue( + getLogRow(0).contains("Column resized: caption=Column 1, width=" + + cell.getSize().getWidth())); drag(handle, -100); - assertTrue(getLogRow(0).contains( - "Column resized: caption=Column 1, width=" + cell.getSize() - .getWidth())); + assertTrue( + getLogRow(0).contains("Column resized: caption=Column 1, width=" + + cell.getSize().getWidth())); // SIMPLE resize mode selectMenuPath("Component", "Columns", "Simple resize mode"); sleep(250); drag(handle, 100); - assertTrue(getLogRow(0).contains( - "Column resized: caption=Column 1, width=" + cell.getSize() - .getWidth())); + assertTrue( + getLogRow(0).contains("Column resized: caption=Column 1, width=" + + cell.getSize().getWidth())); drag(handle, -100); - assertTrue(getLogRow(0).contains( - "Column resized: caption=Column 1, width=" + cell.getSize() - .getWidth())); + assertTrue( + getLogRow(0).contains("Column resized: caption=Column 1, width=" + + cell.getSize().getWidth())); } private void drag(WebElement handle, int xOffset) { diff --git a/uitest/src/test/java/com/vaadin/tests/components/menubar/MenuItemStyleAddTest.java b/uitest/src/test/java/com/vaadin/tests/components/menubar/MenuItemStyleAddTest.java index 79e390fcff..845135f6f8 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/menubar/MenuItemStyleAddTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/menubar/MenuItemStyleAddTest.java @@ -35,4 +35,4 @@ public class MenuItemStyleAddTest extends MultiBrowserTest { .replaceAll("v-menubar-menuitem-styleTest", "") .contains("styleTest")); } -}
\ No newline at end of file +} diff --git a/uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectDisabledTest.java b/uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectDisabledTest.java index fe01ef90ad..7742d5d351 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectDisabledTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectDisabledTest.java @@ -23,4 +23,4 @@ public class NativeSelectDisabledTest extends MultiBrowserTest { System.out.println(el.getSelectElement().getText()); assertEquals("true", el.getSelectElement().getAttribute("disabled")); } -}
\ No newline at end of file +} 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 835c2a53ef..e027310ec9 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 @@ -186,27 +186,33 @@ public class RadioButtonGroupTest extends MultiBrowserTest { openTestURL("theme=valo"); selectMenuPath("Component", "Selection", "Toggle Item 5"); - String className = getSelect().findElements(By.tagName("span")).get(5).getAttribute("className"); - assertTrue("No v-select-option-selected class, was " + className, className.contains("v-select-option-selected") - ); + String className = getSelect().findElements(By.tagName("span")).get(5) + .getAttribute("className"); + assertTrue("No v-select-option-selected class, was " + className, + className.contains("v-select-option-selected")); getSelect().selectByText("Item 5"); - className = getSelect().findElements(By.tagName("span")).get(5).getAttribute("className"); - assertTrue("No v-select-option-selected class, was " + className, className.contains("v-select-option-selected")); + className = getSelect().findElements(By.tagName("span")).get(5) + .getAttribute("className"); + assertTrue("No v-select-option-selected class, was " + className, + className.contains("v-select-option-selected")); getSelect().selectByText("Item 10"); List<WebElement> options = getSelect().findElements(By.tagName("span")); className = options.get(5).getAttribute("className"); - assertFalse("Extra v-select-option-selected class, was " + className, className.contains("v-select-option-selected")); + assertFalse("Extra v-select-option-selected class, was " + className, + className.contains("v-select-option-selected")); className = options.get(10).getAttribute("className"); - assertTrue("No v-select-option-selected class, was " + className, className.contains("v-select-option-selected")); + assertTrue("No v-select-option-selected class, was " + className, + className.contains("v-select-option-selected")); selectMenuPath("Component", "Selection", "Toggle Item 10"); - className = getSelect().findElements(By.tagName("span")).get(10).getAttribute("className"); - assertFalse("Extra v-select-option-selected class, was " + className, className.contains("v-select-option-selected")); + className = getSelect().findElements(By.tagName("span")).get(10) + .getAttribute("className"); + assertFalse("Extra v-select-option-selected class, was " + className, + className.contains("v-select-option-selected")); } - @Test public void itemIconGenerator() { selectMenuPath("Component", "Item Icon Generator", diff --git a/uitest/src/test/java/com/vaadin/tests/components/richtextarea/RichTextAreaDelegateToShortcutHandlerTest.java b/uitest/src/test/java/com/vaadin/tests/components/richtextarea/RichTextAreaDelegateToShortcutHandlerTest.java index 0fc2c631ca..0188ae7450 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/richtextarea/RichTextAreaDelegateToShortcutHandlerTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/richtextarea/RichTextAreaDelegateToShortcutHandlerTest.java @@ -12,7 +12,8 @@ import org.openqa.selenium.remote.DesiredCapabilities; import static org.hamcrest.Matchers.containsString; import static org.junit.Assert.assertThat; -public class RichTextAreaDelegateToShortcutHandlerTest extends MultiBrowserTest { +public class RichTextAreaDelegateToShortcutHandlerTest + extends MultiBrowserTest { @Override public List<DesiredCapabilities> getBrowsersToTest() { @@ -23,18 +24,19 @@ public class RichTextAreaDelegateToShortcutHandlerTest extends MultiBrowserTest public void shouldDelegateToShortcutActionHandler() { openTestURL(); - WebElement textAreaEditor = $(RichTextAreaElement.class).first().getEditorIframe(); + WebElement textAreaEditor = $(RichTextAreaElement.class).first() + .getEditorIframe(); textAreaEditor.sendKeys("Test"); textAreaEditor.sendKeys(Keys.ENTER); - assertThat("Shortcut handler has not been invoked", - getLogRow(0), containsString("ShortcutHandler invoked Test")); + assertThat("Shortcut handler has not been invoked", getLogRow(0), + containsString("ShortcutHandler invoked Test")); textAreaEditor.sendKeys(Keys.chord(Keys.SHIFT, Keys.ENTER)); textAreaEditor.sendKeys("another row"); textAreaEditor.sendKeys(Keys.ENTER); - assertThat("Shortcut handler has not been invoked", - getLogRow(0), containsString("ShortcutHandler invoked Test\nanother row")); + assertThat("Shortcut handler has not been invoked", getLogRow(0), + containsString("ShortcutHandler invoked Test\nanother row")); } } diff --git a/uitest/src/test/java/com/vaadin/tests/components/richtextarea/RichTextAreaReadOnlyDisabledTest.java b/uitest/src/test/java/com/vaadin/tests/components/richtextarea/RichTextAreaReadOnlyDisabledTest.java index 83b1c41edc..767f50f627 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/richtextarea/RichTextAreaReadOnlyDisabledTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/richtextarea/RichTextAreaReadOnlyDisabledTest.java @@ -29,9 +29,9 @@ public class RichTextAreaReadOnlyDisabledTest extends MultiBrowserTest { enablePrB.click(); assertElementPresent(By.className("gwt-RichTextArea")); - readPrB.click();//Set to read-only + readPrB.click();// Set to read-only assertElementNotPresent(By.className("gwt-RichTextArea")); - enablePrB.click();//Set disabled + enablePrB.click();// Set disabled assertElementNotPresent(By.className("gwt-RichTextArea")); } } diff --git a/uitest/src/test/java/com/vaadin/tests/components/table/MemoryLeakTableTest.java b/uitest/src/test/java/com/vaadin/tests/components/table/MemoryLeakTableTest.java index 717ab681d4..fbd1dd4c84 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/table/MemoryLeakTableTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/table/MemoryLeakTableTest.java @@ -22,7 +22,8 @@ import com.vaadin.tests.tb3.MultiBrowserTest; * * @author Vaadin Ltd */ -public class MemoryLeakTableTest extends MultiBrowserTest { private static final int ITERATIONS = 200; +public class MemoryLeakTableTest extends MultiBrowserTest { + private static final int ITERATIONS = 200; // To run locally in chrome download ChromeDriver for TB3 // Set path to the chrome driver. In diff --git a/uitest/src/test/java/com/vaadin/tests/components/tabsheet/TabSheetFocusedTabTest.java b/uitest/src/test/java/com/vaadin/tests/components/tabsheet/TabSheetFocusedTabTest.java index 8488fd9e9b..060126f368 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/tabsheet/TabSheetFocusedTabTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/tabsheet/TabSheetFocusedTabTest.java @@ -53,8 +53,8 @@ public class TabSheetFocusedTabTest extends MultiBrowserTest { } private WebElement getTab(int index) { - return getDriver().findElement(By - .xpath("(//table[contains(@class, 'v-tabsheet-tabs')])[1]/tbody/tr/td[" + return getDriver().findElement(By.xpath( + "(//table[contains(@class, 'v-tabsheet-tabs')])[1]/tbody/tr/td[" + (index + 1) + "]/div")); } diff --git a/uitest/src/test/java/com/vaadin/tests/components/tree/TreeBasicFeaturesTest.java b/uitest/src/test/java/com/vaadin/tests/components/tree/TreeBasicFeaturesTest.java index e2c60b9506..4e133015b3 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/tree/TreeBasicFeaturesTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/tree/TreeBasicFeaturesTest.java @@ -21,16 +21,16 @@ import com.vaadin.tests.tb3.MultiBrowserTest; public class TreeBasicFeaturesTest extends MultiBrowserTest { - private static final Predicate<TestBenchElement> THEME_RESOURCE = - element -> element.isElementPresent(By.tagName("img")) + private static final Predicate<TestBenchElement> THEME_RESOURCE = element -> element + .isElementPresent(By.tagName("img")) && element.findElement(By.tagName("img")).getAttribute("src") .contains("bullet.png"); - private static final Predicate<TestBenchElement> VAADIN_ICON = - element -> element.isElementPresent(By.className("v-icon")) + private static final Predicate<TestBenchElement> VAADIN_ICON = element -> element + .isElementPresent(By.className("v-icon")) && element.findElement(By.className("v-icon")).getAttribute("class") .contains("Vaadin-Icons"); - private static final Predicate<TestBenchElement> CLASS_RESOURCE = - element -> element.isElementPresent(By.tagName("img")) + private static final Predicate<TestBenchElement> CLASS_RESOURCE = element -> element + .isElementPresent(By.tagName("img")) && element.findElement(By.tagName("img")).getAttribute("src") .contains("m.gif"); diff --git a/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridAriaRowcountTest.java b/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridAriaRowcountTest.java index a9b93773a9..24c1187e14 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridAriaRowcountTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridAriaRowcountTest.java @@ -53,6 +53,7 @@ public class TreeGridAriaRowcountTest extends SingleBrowserTest { } private boolean containsRows(int rowcount) { - return grid.getHTML().contains("aria-rowcount=\"" + String.valueOf(rowcount) + "\""); + return grid.getHTML() + .contains("aria-rowcount=\"" + String.valueOf(rowcount) + "\""); } } diff --git a/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridDoubleClickTest.java b/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridDoubleClickTest.java index ba472f0dd3..052bfb0252 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridDoubleClickTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridDoubleClickTest.java @@ -30,7 +30,7 @@ public class TreeGridDoubleClickTest extends SingleBrowserTest { private boolean isDoubleClickNotificationPresent() { ElementQuery<NotificationElement> notification = $( NotificationElement.class); - return notification.exists() && "Double click" - .equals(notification.first().getCaption()); + return notification.exists() + && "Double click".equals(notification.first().getCaption()); } } diff --git a/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridExpandCollapseRecursivelyTest.java b/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridExpandCollapseRecursivelyTest.java index 6e2451b96a..e35cc3c1d5 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridExpandCollapseRecursivelyTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridExpandCollapseRecursivelyTest.java @@ -14,12 +14,12 @@ public class TreeGridExpandCollapseRecursivelyTest extends SingleBrowserTest { private static final int rowCount0 = 5; private static final int rowCount1 = rowCount0 + rowCount0 * 5; - private static final int rowCount2 = - rowCount1 + (rowCount1 - rowCount0) * 5; - private static final int rowCount3 = - rowCount2 + (rowCount2 - rowCount1) * 5; - private static final int rowCount4 = - rowCount3 + (rowCount3 - rowCount2) * 5; + private static final int rowCount2 = rowCount1 + + (rowCount1 - rowCount0) * 5; + private static final int rowCount3 = rowCount2 + + (rowCount2 - rowCount1) * 5; + private static final int rowCount4 = rowCount3 + + (rowCount3 - rowCount2) * 5; private TreeGridElement grid; private RadioButtonGroupElement depthSelector; diff --git a/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridHugeTreeNavigationTest.java b/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridHugeTreeNavigationTest.java index 19e8daef2e..47f6cf42f6 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridHugeTreeNavigationTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridHugeTreeNavigationTest.java @@ -32,15 +32,14 @@ public class TreeGridHugeTreeNavigationTest extends MultiBrowserTest { // Should navigate to "Granddad 1" and expand it new Actions(getDriver()).sendKeys(Keys.DOWN, Keys.RIGHT).perform(); assertEquals(6, grid.getRowCount()); - assertCellTexts(0, 0, "Granddad 0", "Granddad 1", - "Dad 1/0", "Dad 1/1", "Dad 1/2", "Granddad 2"); + assertCellTexts(0, 0, "Granddad 0", "Granddad 1", "Dad 1/0", "Dad 1/1", + "Dad 1/2", "Granddad 2"); checkRowFocused(1); // Should navigate to and expand "Dad 1/1" new Actions(getDriver()).sendKeys(Keys.DOWN, Keys.DOWN, Keys.RIGHT) .perform(); - assertCellTexts(0, 0, - "Granddad 0", "Granddad 1", "Dad 1/0", "Dad 1/1", + assertCellTexts(0, 0, "Granddad 0", "Granddad 1", "Dad 1/0", "Dad 1/1", "Son 1/1/0", "Son 1/1/1", "Son 1/1/2", "Son 1/1/3"); checkRowFocused(3); @@ -62,14 +61,14 @@ public class TreeGridHugeTreeNavigationTest extends MultiBrowserTest { // Should collapse "Dad 1/1" new Actions(getDriver()).sendKeys(Keys.LEFT).perform(); - assertCellTexts(0, 0, "Granddad 0", "Granddad 1", - "Dad 1/0", "Dad 1/1", "Dad 1/2", "Granddad 2"); + assertCellTexts(0, 0, "Granddad 0", "Granddad 1", "Dad 1/0", "Dad 1/1", + "Dad 1/2", "Granddad 2"); checkRowFocused(3); // Should navigate to "Granddad 1" new Actions(getDriver()).sendKeys(Keys.LEFT).perform(); - assertCellTexts(0, 0, "Granddad 0", "Granddad 1", - "Dad 1/0", "Dad 1/1", "Dad 1/2", "Granddad 2"); + assertCellTexts(0, 0, "Granddad 0", "Granddad 1", "Dad 1/0", "Dad 1/1", + "Dad 1/2", "Granddad 2"); checkRowFocused(1); // Should collapse "Granddad 1" @@ -102,18 +101,21 @@ public class TreeGridHugeTreeNavigationTest extends MultiBrowserTest { @Test public void uncollapsible_item() { grid.getRow(0).getCell(0).click(); - new Actions(getDriver()).sendKeys(Keys.DOWN, Keys.DOWN, Keys.RIGHT).perform(); + new Actions(getDriver()).sendKeys(Keys.DOWN, Keys.DOWN, Keys.RIGHT) + .perform(); grid.waitForVaadin(); - //expand Dad 2/1 - new Actions(getDriver()).sendKeys(Keys.DOWN, Keys.DOWN, Keys.RIGHT).perform(); + // expand Dad 2/1 + new Actions(getDriver()).sendKeys(Keys.DOWN, Keys.DOWN, Keys.RIGHT) + .perform(); grid.waitForVaadin(); assertNoErrorNotifications(); - assertCellTexts(5,0,"Son 2/1/0"); + assertCellTexts(5, 0, "Son 2/1/0"); new Actions(getDriver()).sendKeys(Keys.LEFT).perform(); grid.waitForVaadin(); assertNoErrorNotifications(); - assertCellTexts(5,0,"Son 2/1/0"); + assertCellTexts(5, 0, "Son 2/1/0"); } + @Test public void can_toggle_collapse_on_row_that_is_no_longer_in_cache() { grid.getRow(0).getCell(0).click(); @@ -125,10 +127,10 @@ public class TreeGridHugeTreeNavigationTest extends MultiBrowserTest { grid.waitForVaadin(); grid.scrollToRow(200); grid.waitForVaadin(); - //Jump into view + // Jump into view new Actions(getDriver()).sendKeys(Keys.LEFT).perform(); grid.waitForVaadin(); - //Collapse + // Collapse new Actions(getDriver()).sendKeys(Keys.LEFT).perform(); grid.waitForVaadin(); assertEquals(6, grid.getRowCount()); @@ -150,11 +152,10 @@ public class TreeGridHugeTreeNavigationTest extends MultiBrowserTest { if (index > 0) { assertFalse(grid.getRow(index - 1) .hasClassName("v-treegrid-row-focused")); - } - assertTrue(grid.getRow(index) - .hasClassName("v-treegrid-row-focused")); - assertFalse(grid.getRow(index + 1) - .hasClassName("v-treegrid-row-focused")); + } + assertTrue(grid.getRow(index).hasClassName("v-treegrid-row-focused")); + assertFalse( + grid.getRow(index + 1).hasClassName("v-treegrid-row-focused")); } private void assertCellTexts(int startRowIndex, int cellIndex, diff --git a/uitest/src/test/java/com/vaadin/tests/components/upload/UploadInTabsheetTest.java b/uitest/src/test/java/com/vaadin/tests/components/upload/UploadInTabsheetTest.java index 156676f68f..910588d192 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/upload/UploadInTabsheetTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/upload/UploadInTabsheetTest.java @@ -31,7 +31,7 @@ public class UploadInTabsheetTest extends MultiBrowserTest { @Test public void testThatChangingTabAfterUploadDoesntCauseErrors() - throws Exception { + throws Exception { setDebug(true); openTestURL(); diff --git a/uitest/src/test/java/com/vaadin/tests/components/window/BackspaceKeyWithModalOpenedTest.java b/uitest/src/test/java/com/vaadin/tests/components/window/BackspaceKeyWithModalOpenedTest.java index b2134b56ee..1512042eab 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/window/BackspaceKeyWithModalOpenedTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/window/BackspaceKeyWithModalOpenedTest.java @@ -48,9 +48,9 @@ public class BackspaceKeyWithModalOpenedTest extends MultiBrowserTest { /** * Tests that backspace action in the bottom component is prevented. * - * Ignored because the fix to #8855 stops the top and bottom components - * from functioning as focus traps. Meanwhile, navigation with Backspace - * is not anymore supported by reasonable browsers. + * Ignored because the fix to #8855 stops the top and bottom components from + * functioning as focus traps. Meanwhile, navigation with Backspace is not + * anymore supported by reasonable browsers. */ @Test @Ignore diff --git a/uitest/src/test/java/com/vaadin/tests/contextclick/TableContextClickTestBase.java b/uitest/src/test/java/com/vaadin/tests/contextclick/TableContextClickTestBase.java index 26c8951b14..858e33143c 100644 --- a/uitest/src/test/java/com/vaadin/tests/contextclick/TableContextClickTestBase.java +++ b/uitest/src/test/java/com/vaadin/tests/contextclick/TableContextClickTestBase.java @@ -15,16 +15,14 @@ public abstract class TableContextClickTestBase protected void assertTypedContextClickListener(int startIndex) { contextClick($(TableElement.class).first().getCell(0, 0)); - assertEquals( - (startIndex++) - + ". ContextClickEvent value: Lisa Schneider, propertyId: address, section: BODY", + assertEquals((startIndex++) + + ". ContextClickEvent value: Lisa Schneider, propertyId: address, section: BODY", getLogRow(0)); contextClick($(TableElement.class).first().getCell(0, 3)); - assertEquals( - startIndex - + ". ContextClickEvent value: Lisa Schneider, propertyId: lastName, section: BODY", + assertEquals(startIndex + + ". ContextClickEvent value: Lisa Schneider, propertyId: lastName, section: BODY", getLogRow(0)); } } diff --git a/uitest/src/test/java/com/vaadin/tests/contextclick/TreeV8ContextClickTest.java b/uitest/src/test/java/com/vaadin/tests/contextclick/TreeV8ContextClickTest.java index 617755be88..4507125bf5 100644 --- a/uitest/src/test/java/com/vaadin/tests/contextclick/TreeV8ContextClickTest.java +++ b/uitest/src/test/java/com/vaadin/tests/contextclick/TreeV8ContextClickTest.java @@ -15,17 +15,13 @@ public class TreeV8ContextClickTest extends AbstractContextClickTest { TreeElement tree = $(TreeElement.class).first(); contextClick(tree.getItem(0)); - assertEquals( - "1. ContextClickEvent value: Granddad 0", - getLogRow(0)); + assertEquals("1. ContextClickEvent value: Granddad 0", getLogRow(0)); tree.expand(0); tree.expand(2); contextClick(tree.getItem(6)); - assertEquals( - "2. ContextClickEvent value: Son 0/1/3", - getLogRow(0)); + assertEquals("2. ContextClickEvent value: Son 0/1/3", getLogRow(0)); } /** diff --git a/uitest/src/test/java/com/vaadin/tests/elements/menubar/MenuBarUITest.java b/uitest/src/test/java/com/vaadin/tests/elements/menubar/MenuBarUITest.java index 95365366b6..f1d5f931ae 100644 --- a/uitest/src/test/java/com/vaadin/tests/elements/menubar/MenuBarUITest.java +++ b/uitest/src/test/java/com/vaadin/tests/elements/menubar/MenuBarUITest.java @@ -16,7 +16,7 @@ import com.vaadin.testbench.elements.MenuBarElement; import com.vaadin.tests.tb3.MultiBrowserTest; public class MenuBarUITest extends MultiBrowserTest { - + @Override protected boolean requireWindowFocusForIE() { return true; diff --git a/uitest/src/test/java/com/vaadin/tests/elements/splitpanel/SplitPanelComponentsTest.java b/uitest/src/test/java/com/vaadin/tests/elements/splitpanel/SplitPanelComponentsTest.java index 2ba548022c..68e3f0c8dc 100644 --- a/uitest/src/test/java/com/vaadin/tests/elements/splitpanel/SplitPanelComponentsTest.java +++ b/uitest/src/test/java/com/vaadin/tests/elements/splitpanel/SplitPanelComponentsTest.java @@ -131,4 +131,4 @@ public class SplitPanelComponentsTest extends MultiBrowserTest { + " text " + buttonText, button == null); } -}
\ No newline at end of file +} diff --git a/uitest/src/test/java/com/vaadin/tests/elements/tabsheet/NestedTabSheetTest.java b/uitest/src/test/java/com/vaadin/tests/elements/tabsheet/NestedTabSheetTest.java index ceaeb2fc53..23874fc0c0 100644 --- a/uitest/src/test/java/com/vaadin/tests/elements/tabsheet/NestedTabSheetTest.java +++ b/uitest/src/test/java/com/vaadin/tests/elements/tabsheet/NestedTabSheetTest.java @@ -73,4 +73,4 @@ public class NestedTabSheetTest extends MultiBrowserTest { } return false; } -}
\ No newline at end of file +} diff --git a/uitest/src/test/java/com/vaadin/tests/elements/tabsheet/TabSheetElementExceptionTest.java b/uitest/src/test/java/com/vaadin/tests/elements/tabsheet/TabSheetElementExceptionTest.java index 648b436e17..6c95069290 100644 --- a/uitest/src/test/java/com/vaadin/tests/elements/tabsheet/TabSheetElementExceptionTest.java +++ b/uitest/src/test/java/com/vaadin/tests/elements/tabsheet/TabSheetElementExceptionTest.java @@ -27,4 +27,4 @@ public class TabSheetElementExceptionTest extends MultiBrowserTest { TabSheetElement tse = $(TabSheetElement.class).first(); tse.openTab("Tab 6"); } -}
\ No newline at end of file +} diff --git a/uitest/src/test/java/com/vaadin/tests/layouts/RelativeSizeInUndefinedCssLayoutTest.java b/uitest/src/test/java/com/vaadin/tests/layouts/RelativeSizeInUndefinedCssLayoutTest.java index 05a9e4aaac..a7e1d3bada 100644 --- a/uitest/src/test/java/com/vaadin/tests/layouts/RelativeSizeInUndefinedCssLayoutTest.java +++ b/uitest/src/test/java/com/vaadin/tests/layouts/RelativeSizeInUndefinedCssLayoutTest.java @@ -9,8 +9,7 @@ import com.vaadin.testbench.elements.FormLayoutElement; import com.vaadin.testbench.elements.TextFieldElement; import com.vaadin.tests.tb3.SingleBrowserTest; -public class RelativeSizeInUndefinedCssLayoutTest - extends SingleBrowserTest { +public class RelativeSizeInUndefinedCssLayoutTest extends SingleBrowserTest { @Test public void relativeSizeInUndefinedCssLayout() { diff --git a/uitest/src/test/java/com/vaadin/tests/layouts/gridlayout/GridLayoutCaptionOnBottomAlignedComponentTest.java b/uitest/src/test/java/com/vaadin/tests/layouts/gridlayout/GridLayoutCaptionOnBottomAlignedComponentTest.java index 0e5d3dea8a..6820db4d2f 100644 --- a/uitest/src/test/java/com/vaadin/tests/layouts/gridlayout/GridLayoutCaptionOnBottomAlignedComponentTest.java +++ b/uitest/src/test/java/com/vaadin/tests/layouts/gridlayout/GridLayoutCaptionOnBottomAlignedComponentTest.java @@ -10,7 +10,8 @@ import org.openqa.selenium.WebElement; import static org.junit.Assert.assertEquals; -public class GridLayoutCaptionOnBottomAlignedComponentTest extends MultiBrowserTest { +public class GridLayoutCaptionOnBottomAlignedComponentTest + extends MultiBrowserTest { @Test public void captionShouldBeImmediatelyAboveItsComponent() { @@ -20,12 +21,15 @@ public class GridLayoutCaptionOnBottomAlignedComponentTest extends MultiBrowserT TextFieldElement component = $(TextFieldElement.class).first(); assertEquals("Caption and component have the same horizontal alignment", - caption.getLocation().x, component.getLocation().x); + caption.getLocation().x, component.getLocation().x); - // We have to do the assertion in this way because different browsers on different operating systems + // We have to do the assertion in this way because different browsers on + // different operating systems // measure the height of the caption in different ways. - int diff = Math.abs(caption.getLocation().y - component.getLocation().y + caption.getSize().height); - assertLessThanOrEqual("Caption is placed directly above the component", diff, 1); + int diff = Math.abs(caption.getLocation().y - component.getLocation().y + + caption.getSize().height); + assertLessThanOrEqual("Caption is placed directly above the component", + diff, 1); } @Test @@ -39,9 +43,9 @@ public class GridLayoutCaptionOnBottomAlignedComponentTest extends MultiBrowserT $(ButtonElement.class).first().click(); assertEquals("Caption and component have the same horizontal alignment", - caption.getLocation().x, component.getLocation().x); + caption.getLocation().x, component.getLocation().x); assertEquals("Caption is placed in the top-left corner", - gridLayout.getLocation().y, caption.getLocation().y); + gridLayout.getLocation().y, caption.getLocation().y); } } diff --git a/uitest/src/test/java/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java b/uitest/src/test/java/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java index 1a478693c7..4b852ba534 100644 --- a/uitest/src/test/java/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java +++ b/uitest/src/test/java/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java @@ -18,9 +18,8 @@ public abstract class MultiBrowserTestWithProxy extends MultiBrowserTest { private Integer proxyPort = null; private JSch jsch; private static String sshDir = System.getProperty("user.home") + "/.ssh/"; - private String[] publicKeys = { - System.getProperty("sshkey.file"), sshDir + "id_rsa", - sshDir + "id_dsa", sshDir + "id_rsa2" }; + private String[] publicKeys = { System.getProperty("sshkey.file"), + sshDir + "id_rsa", sshDir + "id_dsa", sshDir + "id_rsa2" }; @Override public void setup() throws Exception { diff --git a/uitest/src/test/java/com/vaadin/tests/themes/valo/ModalWindowTest.java b/uitest/src/test/java/com/vaadin/tests/themes/valo/ModalWindowTest.java index 79ad0ec471..8cfb9eb36d 100644 --- a/uitest/src/test/java/com/vaadin/tests/themes/valo/ModalWindowTest.java +++ b/uitest/src/test/java/com/vaadin/tests/themes/valo/ModalWindowTest.java @@ -73,4 +73,4 @@ public class ModalWindowTest extends SingleBrowserTest { assertFalse(isElementPresent(By.className("v-window-draggingCurtain"))); assertFalse(isElementPresent(By.className("v-window-resizingCurtain"))); } -}
\ No newline at end of file +} diff --git a/uitest/src/test/java/com/vaadin/tests/tooltip/MenuBarTooltipTest.java b/uitest/src/test/java/com/vaadin/tests/tooltip/MenuBarTooltipTest.java index c7fa0e15aa..1eb776182d 100644 --- a/uitest/src/test/java/com/vaadin/tests/tooltip/MenuBarTooltipTest.java +++ b/uitest/src/test/java/com/vaadin/tests/tooltip/MenuBarTooltipTest.java @@ -17,9 +17,8 @@ public class MenuBarTooltipTest extends MultiBrowserTest { @Test public void toolTipShouldBeOnTopOfMenuItem() { - String[] themes = { ValoTheme.THEME_NAME, - Reindeer.THEME_NAME, Runo.THEME_NAME, - ChameleonTheme.THEME_NAME }; + String[] themes = { ValoTheme.THEME_NAME, Reindeer.THEME_NAME, + Runo.THEME_NAME, ChameleonTheme.THEME_NAME }; for (String theme : themes) { assertZIndices(theme); diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridClientRenderers.java b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridClientRenderers.java index d2bdc8df86..d818db5cb4 100644 --- a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridClientRenderers.java +++ b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridClientRenderers.java @@ -27,7 +27,6 @@ import com.vaadin.tests.widgetset.server.v7.grid.GridClientColumnRenderers; /** * Tests Grid client side renderers * - * @since * @author Vaadin Ltd */ @TestCategory("grid") diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridThemeUITest.java b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridThemeUITest.java index 6a2259fa8a..8a243bef18 100644 --- a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridThemeUITest.java +++ b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridThemeUITest.java @@ -81,10 +81,6 @@ public class GridThemeUITest extends MultiBrowserThemeTest { new Actions(getDriver()).doubleClick(targetCell).perform(); } - /** - * @since - * @param string - */ private void selectPage(String string) { $(NativeSelectElement.class).id("page").selectByText(string); grid = $(GridElement.class).first(); diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/WidgetRenderersTest.java b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/WidgetRenderersTest.java index 95d242ff4d..463c7226f3 100644 --- a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/WidgetRenderersTest.java +++ b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/WidgetRenderersTest.java @@ -21,7 +21,6 @@ import com.vaadin.tests.tb3.MultiBrowserTest; /** * TB tests for the various builtin widget-based renderers. * - * @since * @author Vaadin Ltd */ @TestCategory("grid") diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridBasicClientFeaturesTest.java b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridBasicClientFeaturesTest.java index 8ec8c96005..d21faeb79e 100644 --- a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridBasicClientFeaturesTest.java +++ b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridBasicClientFeaturesTest.java @@ -11,7 +11,6 @@ import com.vaadin.testbench.elements.GridElement; /** * GridBasicClientFeatures. * - * @since * @author Vaadin Ltd */ public abstract class GridBasicClientFeaturesTest diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridDescriptionGeneratorTest.java b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridDescriptionGeneratorTest.java index abb0029287..ac20e65f51 100644 --- a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridDescriptionGeneratorTest.java +++ b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridDescriptionGeneratorTest.java @@ -109,17 +109,17 @@ public class GridDescriptionGeneratorTest extends GridBasicFeaturesTest { } private void assertPreTooltipShown() { - assertTrue("Tooltip should contain <b> as text", getTooltipText() - .contains("<b>")); - assertTrue("Tooltip should contain a newline", getTooltipText() - .contains("\n")); + assertTrue("Tooltip should contain <b> as text", + getTooltipText().contains("<b>")); + assertTrue("Tooltip should contain a newline", + getTooltipText().contains("\n")); } private void assertPlainTooltipShown() { - assertTrue("Tooltip should contain <b> as text", getTooltipText() - .contains("<b>")); - assertFalse("Tooltip should not contain a newline", getTooltipText() - .contains("\n")); + assertTrue("Tooltip should contain <b> as text", + getTooltipText().contains("<b>")); + assertFalse("Tooltip should not contain a newline", + getTooltipText().contains("\n")); } private void assertHtmlTooltipShown() { @@ -132,7 +132,8 @@ public class GridDescriptionGeneratorTest extends GridBasicFeaturesTest { } private void selectCellGenerator(String name) { - selectMenuPath("Component", "State", "Cell description generator", name); + selectMenuPath("Component", "State", "Cell description generator", + name); } private void selectRowGenerator(String name) { diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/client/GridDetailsClientTest.java b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/client/GridDetailsClientTest.java index d28ba26198..8d3dcf89f4 100644 --- a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/client/GridDetailsClientTest.java +++ b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/client/GridDetailsClientTest.java @@ -25,12 +25,12 @@ import com.vaadin.v7.tests.components.grid.basicfeatures.GridBasicClientFeatures public class GridDetailsClientTest extends GridBasicClientFeaturesTest { - private static final String[] SET_GENERATOR = { "Component", - "Row details", "Set generator" }; - private static final String[] SET_FAULTY_GENERATOR = { - "Component", "Row details", "Set faulty generator" }; - private static final String[] SET_EMPTY_GENERATOR = { - "Component", "Row details", "Set empty generator" }; + private static final String[] SET_GENERATOR = { "Component", "Row details", + "Set generator" }; + private static final String[] SET_FAULTY_GENERATOR = { "Component", + "Row details", "Set faulty generator" }; + private static final String[] SET_EMPTY_GENERATOR = { "Component", + "Row details", "Set empty generator" }; @Before public void setUp() { diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/client/GridEditorClientTest.java b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/client/GridEditorClientTest.java index 8344400cb5..4d5df990fb 100644 --- a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/client/GridEditorClientTest.java +++ b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/client/GridEditorClientTest.java @@ -26,10 +26,10 @@ import com.vaadin.v7.tests.components.grid.basicfeatures.GridBasicFeatures; public class GridEditorClientTest extends GridBasicClientFeaturesTest { - private static final String[] EDIT_ROW_100 = { "Component", - "Editor", "Edit row 100" }; - private static final String[] EDIT_ROW_5 = { "Component", - "Editor", "Edit row 5" }; + private static final String[] EDIT_ROW_100 = { "Component", "Editor", + "Edit row 100" }; + private static final String[] EDIT_ROW_5 = { "Component", "Editor", + "Edit row 5" }; @Before public void setUp() { diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/client/GridStaticSectionTest.java b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/client/GridStaticSectionTest.java index b9c8ddc15b..44ecdf5843 100644 --- a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/client/GridStaticSectionTest.java +++ b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/client/GridStaticSectionTest.java @@ -14,7 +14,6 @@ import com.vaadin.v7.tests.components.grid.basicfeatures.GridBasicFeatures; /** * Abstract base class for header and footer tests. * - * @since * @author Vaadin Ltd */ public abstract class GridStaticSectionTest diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridDetailsServerTest.java b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridDetailsServerTest.java index 5a321cd681..8356874de7 100644 --- a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridDetailsServerTest.java +++ b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridDetailsServerTest.java @@ -23,20 +23,20 @@ public class GridDetailsServerTest extends GridBasicFeaturesTest { * awkward with two scroll commands back to back. */ private static final int ALMOST_LAST_INDEX = 995; - private static final String[] OPEN_ALMOST_LAST_ITEM_DETAILS = { - "Component", "Details", "Open " + ALMOST_LAST_INDEX }; - private static final String[] OPEN_FIRST_ITEM_DETAILS = { - "Component", "Details", "Open firstItemId" }; - private static final String[] TOGGLE_FIRST_ITEM_DETAILS = { - "Component", "Details", "Toggle firstItemId" }; - private static final String[] DETAILS_GENERATOR_NULL = { - "Component", "Details", "Generators", "NULL" }; - private static final String[] DETAILS_GENERATOR_WATCHING = { - "Component", "Details", "Generators", "\"Watching\"" }; - private static final String[] DETAILS_GENERATOR_PERSISTING = { - "Component", "Details", "Generators", "Persisting" }; - private static final String[] CHANGE_HIERARCHY = { "Component", - "Details", "Generators", "- Change Component" }; + private static final String[] OPEN_ALMOST_LAST_ITEM_DETAILS = { "Component", + "Details", "Open " + ALMOST_LAST_INDEX }; + private static final String[] OPEN_FIRST_ITEM_DETAILS = { "Component", + "Details", "Open firstItemId" }; + private static final String[] TOGGLE_FIRST_ITEM_DETAILS = { "Component", + "Details", "Toggle firstItemId" }; + private static final String[] DETAILS_GENERATOR_NULL = { "Component", + "Details", "Generators", "NULL" }; + private static final String[] DETAILS_GENERATOR_WATCHING = { "Component", + "Details", "Generators", "\"Watching\"" }; + private static final String[] DETAILS_GENERATOR_PERSISTING = { "Component", + "Details", "Generators", "Persisting" }; + private static final String[] CHANGE_HIERARCHY = { "Component", "Details", + "Generators", "- Change Component" }; @Before public void setUp() { diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridFocusTest.java b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridFocusTest.java index 0a468b1f8d..cf3587a07c 100644 --- a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridFocusTest.java +++ b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridFocusTest.java @@ -12,7 +12,6 @@ import com.vaadin.v7.tests.components.grid.basicfeatures.GridBasicFeaturesTest; /** * Test for server-side Grid focus features. * - * @since * @author Vaadin Ltd */ public class GridFocusTest extends GridBasicFeaturesTest { diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridSortingTest.java b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridSortingTest.java index 885ad056c7..d79bd65cdc 100644 --- a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridSortingTest.java +++ b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridSortingTest.java @@ -43,12 +43,13 @@ public class GridSortingTest extends GridBasicFeaturesTest { } } - private static SortInfo getSortInfo(int sortOrder, SortDirection sortDirection) { + private static SortInfo getSortInfo(int sortOrder, + SortDirection sortDirection) { return new SortInfo(sortOrder, sortDirection); } - private static SortInfoWithColumn getSortInfo(int columnIndex, int sortOrder, - SortDirection sortDirection) { + private static SortInfoWithColumn getSortInfo(int columnIndex, + int sortOrder, SortDirection sortDirection) { return new SortInfoWithColumn(columnIndex, sortOrder, sortDirection); } @@ -262,7 +263,8 @@ public class GridSortingTest extends GridBasicFeaturesTest { sendKey(Keys.ENTER); releaseKey(Keys.SHIFT); assertColumnsAreSortedAs(getSortInfo(1, SortDirection.ASCENDING), - getSortInfo(2, SortDirection.ASCENDING), getSortInfo(3, SortDirection.ASCENDING)); + getSortInfo(2, SortDirection.ASCENDING), + getSortInfo(3, SortDirection.ASCENDING)); // Move back to the second column sendKey(Keys.LEFT); @@ -272,7 +274,8 @@ public class GridSortingTest extends GridBasicFeaturesTest { sendKey(Keys.ENTER); releaseKey(Keys.SHIFT); assertColumnsAreSortedAs(getSortInfo(1, SortDirection.ASCENDING), - getSortInfo(2, SortDirection.DESCENDING), getSortInfo(3, SortDirection.ASCENDING)); + getSortInfo(2, SortDirection.DESCENDING), + getSortInfo(3, SortDirection.ASCENDING)); // Move back to the third column sendKey(Keys.RIGHT); |