]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix formatting, improve documentation on autoformat (#11033)
authorIlia Motornyi <elmot@vaadin.com>
Tue, 10 Jul 2018 09:59:02 +0000 (12:59 +0300)
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>
Tue, 10 Jul 2018 09:59:02 +0000 (12:59 +0300)
CONTRIBUTING.md
client/src/main/java/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java
uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxCaretNavigationTest.java

index 43284b672c4551a5e4a98bab475163fd4ecec40f..3457ce0863eb43858de897681fe73cca1df7e580 100644 (file)
@@ -144,6 +144,10 @@ You should receive comments within a week or so; if that does not happen, make s
 
 # Submitting the patches
 
+## Source code auto-formatting
+
+Before submitting changes to Github, run the command `mvn process-sources` from project's root. This maven goal automatically formats source code according to Vaadin standards. The same goal is run automatically if you invoke `mvn install` or `mvn compile`.   
+
 ## Creating a pull request in GitHub
 
 All our projects accept contributions as GitHub pull requests. The first time you create a pull request, you will be asked to electronically sign a contribution agreement.
index 4462482fb15ba1ffc936b31076a27511ba95adf8..e2456285834ca0b867c5bded2cc0cde733b478da 100644 (file)
@@ -646,7 +646,8 @@ public class MultiSelectionRenderer<T>
         checkBox.setText("Selects row number " + getDOMRowIndex(cell) + ".");
         boolean editorOpen = grid.isEditorActive();
         boolean editorBuffered = grid.isEditorBuffered();
-        checkBox.setEnabled(grid.isEnabled() && !(editorOpen && editorBuffered));
+        checkBox.setEnabled(
+                grid.isEnabled() && !(editorOpen && editorBuffered));
     }
 
     private int getDOMRowIndex(RendererCellReference cell) {
index a1e0396107a7ac1abee0af1de98e6ceb317fd907..f5a543d4bf2be7be6951325a2d153c8aa38663d4 100644 (file)
@@ -28,7 +28,8 @@ public class ComboBoxCaretNavigationTest extends SingleBrowserTest {
         comboBox.sendKeys(Keys.HOME);
         assertCaretPosition("Home key didn't work well.", 0, comboBox);
         comboBox.sendKeys(Keys.END);
-        assertCaretPosition("End key didn't work well.", text.length(), comboBox);
+        assertCaretPosition("End key didn't work well.", text.length(),
+                comboBox);
     }
 
     @Test
@@ -37,9 +38,11 @@ public class ComboBoxCaretNavigationTest extends SingleBrowserTest {
         String text = comboBox.getPopupSuggestions().get(1);
         comboBox.selectByText(text);
         comboBox.sendKeys(Keys.ARROW_LEFT);
-        assertCaretPosition("Left Arrow key didn't work well.", text.length() - 1, comboBox);
+        assertCaretPosition("Left Arrow key didn't work well.",
+                text.length() - 1, comboBox);
         comboBox.sendKeys(Keys.ARROW_RIGHT);
-        assertCaretPosition("Right Arrow key didn't work well.", text.length(), comboBox);
+        assertCaretPosition("Right Arrow key didn't work well.", text.length(),
+                comboBox);
     }
 
     @Test
@@ -59,13 +62,16 @@ public class ComboBoxCaretNavigationTest extends SingleBrowserTest {
         String text = comboBox.getPopupSuggestions().get(1);
         comboBox.selectByText(text);
         comboBox.sendKeys(Keys.ARROW_LEFT);
-        assertCaretPosition("Left Arrow key didn't work well.", text.length() - 1, comboBox);
+        assertCaretPosition("Left Arrow key didn't work well.",
+                text.length() - 1, comboBox);
         comboBox.sendKeys(Keys.END);
-        assertCaretPosition("End key didn't work well.", text.length(), comboBox);
+        assertCaretPosition("End key didn't work well.", text.length(),
+                comboBox);
     }
 
-    private void assertCaretPosition(String message, int position, ComboBoxElement comboBox) {
-        assertArrayEquals(message, new int[]{position, position},
+    private void assertCaretPosition(String message, int position,
+            ComboBoxElement comboBox) {
+        assertArrayEquals(message, new int[] { position, position },
                 getSelection(comboBox.getInputField()));
     }
 
@@ -74,7 +80,7 @@ public class ComboBoxCaretNavigationTest extends SingleBrowserTest {
         List<Long> range = (List<Long>) executeScript(
                 "return [arguments[0].selectionStart,arguments[0].selectionEnd]",
                 element);
-        return new int[]{range.get(0).intValue(), range.get(1).intValue()};
+        return new int[] { range.get(0).intValue(), range.get(1).intValue() };
     }
 
 }