aboutsummaryrefslogtreecommitdiffstats
path: root/compatibility-client/src/main
diff options
context:
space:
mode:
authorAhmed Ashour <asashour@yahoo.com>2017-09-22 12:23:12 +0200
committerHenri Sara <henri.sara@gmail.com>2017-09-22 13:23:12 +0300
commit60ff3d6c3428b2e353ecc0df90296cecc3e840e0 (patch)
treea88cd5b672417440f57ec786b3c2c3c2bdac6adb /compatibility-client/src/main
parent23718371f820fb3babca2c57072a62137aa2c01d (diff)
downloadvaadin-framework-60ff3d6c3428b2e353ecc0df90296cecc3e840e0.tar.gz
vaadin-framework-60ff3d6c3428b2e353ecc0df90296cecc3e840e0.zip
Format curly brackets correctly for checkstyle (#10066)
Diffstat (limited to 'compatibility-client/src/main')
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTree.java8
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/AutoScroller.java20
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/DefaultEditorEventHandler.java4
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/selection/MultiSelectionRenderer.java20
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Escalator.java49
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java15
6 files changed, 36 insertions, 80 deletions
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTree.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTree.java
index 12d76bec9f..a550272f61 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTree.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTree.java
@@ -1729,13 +1729,11 @@ public class VTree extends FocusElementPanel
if (!focusedNode.isLeaf() && focusedNode.getState()
&& focusedNode.getChildren().size() > 0) {
node = focusedNode.getChildren().get(0);
- }
-
- // Else move down to the next sibling
- else {
+ } else {
+ // Move down to the next sibling
node = getNextSibling(focusedNode);
if (node == null) {
- // Else jump to the parent and try to select the next
+ // Jump to the parent and try to select the next
// sibling there
TreeNode current = focusedNode;
while (node == null && current.getParentNode() != null) {
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/AutoScroller.java b/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/AutoScroller.java
index 500d616bc4..4b7ccef837 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/AutoScroller.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/AutoScroller.java
@@ -293,14 +293,10 @@ public class AutoScroller {
if (pointerPageCordinate < startBound) {
final double distance = pointerPageCordinate - startBound;
ratio = Math.max(-1, distance / gradientArea);
- }
-
- else if (pointerPageCordinate > endBound) {
+ } else if (pointerPageCordinate > endBound) {
final double distance = pointerPageCordinate - endBound;
ratio = Math.min(1, distance / gradientArea);
- }
-
- else {
+ } else {
ratio = 0;
}
@@ -357,13 +353,11 @@ public class AutoScroller {
if (startBound == -1) {
startBound = Math.min(finalStartBound, pageCordinate);
endBound = Math.max(finalEndBound, pageCordinate);
- }
-
- /*
- * Subsequent runs make sure that the scroll area grows (but doesn't
- * shrink) with the finger, but no further than the final bound.
- */
- else {
+ } else {
+ /*
+ * Subsequent runs make sure that the scroll area grows (but doesn't
+ * shrink) with the finger, but no further than the final bound.
+ */
int oldTopBound = startBound;
if (startBound < finalStartBound) {
startBound = Math.max(startBound,
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/DefaultEditorEventHandler.java b/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/DefaultEditorEventHandler.java
index 9f4eace77c..b163680230 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/DefaultEditorEventHandler.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/DefaultEditorEventHandler.java
@@ -145,9 +145,7 @@ public class DefaultEditorEventHandler<T> implements Editor.EventHandler<T> {
editRow(event, cell.getRowIndex(), cell.getColumnIndexDOM());
return true;
- }
-
- else if (e.getTypeInt() == Event.ONKEYDOWN) {
+ } else if (e.getTypeInt() == Event.ONKEYDOWN) {
int rowDelta = 0;
int colDelta = 0;
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/selection/MultiSelectionRenderer.java b/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/selection/MultiSelectionRenderer.java
index 86d5e0a323..94bef07c8b 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/selection/MultiSelectionRenderer.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/selection/MultiSelectionRenderer.java
@@ -369,14 +369,10 @@ public class MultiSelectionRenderer<T>
if (pointerPageY < topBound) {
final double distance = pointerPageY - topBound;
ratio = Math.max(-1, distance / gradientArea);
- }
-
- else if (pointerPageY > bottomBound) {
+ } else if (pointerPageY > bottomBound) {
final double distance = pointerPageY - bottomBound;
ratio = Math.min(1, distance / gradientArea);
- }
-
- else {
+ } else {
ratio = 0;
}
@@ -436,13 +432,11 @@ public class MultiSelectionRenderer<T>
if (topBound == -1) {
topBound = Math.min(finalTopBound, pageY);
bottomBound = Math.max(finalBottomBound, pageY);
- }
-
- /*
- * Subsequent runs make sure that the scroll area grows (but doesn't
- * shrink) with the finger, but no further than the final bound.
- */
- else {
+ } else {
+ /*
+ * Subsequent runs make sure that the scroll area grows (but doesn't
+ * shrink) with the finger, but no further than the final bound.
+ */
int oldTopBound = topBound;
if (topBound < finalTopBound) {
topBound = Math.max(topBound,
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Escalator.java b/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Escalator.java
index 94882e0507..e11e0d11aa 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Escalator.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Escalator.java
@@ -2581,9 +2581,7 @@ public class Escalator extends Widget
setTopRowLogicalIndex(logicalRowIndex);
rowsWereMoved = true;
- }
-
- else if (viewportOffset + nextRowBottomOffset <= 0) {
+ } else if (viewportOffset + nextRowBottomOffset <= 0) {
/*
* the viewport has been scrolled more than the topmost visual
* row.
@@ -2738,13 +2736,10 @@ public class Escalator extends Widget
final double yDelta = numberOfRows * getDefaultRowHeight();
moveViewportAndContent(yDelta);
updateTopRowLogicalIndex(numberOfRows);
- }
-
- else if (addedRowsBelowCurrentViewport) {
+ } else if (addedRowsBelowCurrentViewport) {
// NOOP, we already recalculated scrollbars.
- }
-
- else { // some rows were added inside the current viewport
+ } else {
+ // some rows were added inside the current viewport
final int unupdatedLogicalStart = index + addedRows.size();
final int visualOffset = getLogicalRowIndex(
@@ -3181,9 +3176,7 @@ public class Escalator extends Widget
final TableRowElement tr = visualRowOrder.get(i);
refreshRow(tr, i);
}
- }
-
- else {
+ } else {
// No escalator rows need to be removed.
/*
@@ -3215,9 +3208,7 @@ public class Escalator extends Widget
*/
paintRemoveRowsAtMiddle(removedLogicalInside,
removedVisualInside, 0);
- }
-
- else if (removedVisualInside.contains(0)
+ } else if (removedVisualInside.contains(0)
&& numberOfRows >= visualRowOrder.size()) {
/*
* We're removing so many rows that the viewport is
@@ -3257,9 +3248,7 @@ public class Escalator extends Widget
* TODO [[optimize]]: This might lead to a double body
* refresh. Needs investigation.
*/
- }
-
- else if (contentBottom
+ } else if (contentBottom
+ (numberOfRows * getDefaultRowHeight())
- viewportBottom < getDefaultRowHeight()) {
/*
@@ -3277,9 +3266,7 @@ public class Escalator extends Widget
removedVisualInside);
updateTopRowLogicalIndex(
-removedLogicalInside.length());
- }
-
- else {
+ } else {
/*
* We're in a combination, where we need to both scroll
* up AND show new rows at the bottom.
@@ -3715,9 +3702,7 @@ public class Escalator extends Widget
setScrollTop(oldScrollTop);
scroller.onScroll();
}
- }
-
- else if (neededEscalatorRowsDiff < 0) {
+ } else if (neededEscalatorRowsDiff < 0) {
// needs less
final ListIterator<TableRowElement> iter = visualRowOrder
@@ -5141,9 +5126,7 @@ public class Escalator extends Widget
continue;
} else if (topIsBelowRange) {
return heights;
- }
-
- else if (topIsAboveRange && bottomIsInRange) {
+ } else if (topIsAboveRange && bottomIsInRange) {
switch (topInclusion) {
case PARTIAL:
heights += bottom - rangeTop;
@@ -5154,9 +5137,7 @@ public class Escalator extends Widget
default:
break;
}
- }
-
- else if (topIsAboveRange && bottomIsBelowRange) {
+ } else if (topIsAboveRange && bottomIsBelowRange) {
/*
* Here we arbitrarily decide that the top inclusion will
@@ -5177,9 +5158,7 @@ public class Escalator extends Widget
} else if (topIsInRange && bottomIsInRange) {
heights += height;
- }
-
- else if (topIsInRange && bottomIsBelowRange) {
+ } else if (topIsInRange && bottomIsBelowRange) {
switch (bottomInclusion) {
case PARTIAL:
heights += rangeBottom - top;
@@ -5192,9 +5171,7 @@ public class Escalator extends Widget
}
return heights;
- }
-
- else {
+ } else {
assert false : "Unnaccounted-for situation";
}
}
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java b/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java
index 1fa352faf2..fbd1b2a0cc 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java
@@ -4330,10 +4330,9 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
&& rightBoundaryForDrag < dropMarkerLeft
&& dropMarkerLeft <= escalator.getInnerWidth()) {
dropMarkerLeft = rightBoundaryForDrag - dropMarkerWidthOffset;
- }
-
- // Check if the drop marker shouldn't be shown at all
- else if (dropMarkerLeft < frozenColumnsWidth
+ } else if (
+ // Check if the drop marker shouldn't be shown at all
+ dropMarkerLeft < frozenColumnsWidth
|| dropMarkerLeft > Math.min(rightBoundaryForDrag,
escalator.getInnerWidth())
|| dropMarkerLeft < 0) {
@@ -4609,9 +4608,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
rightBound = cellColumnRightIndex;
}
cellColumnIndex = cellColumnRightIndex - 1;
- }
-
- else { // can't drop inside a spanned cell, or this is the
+ } else { // can't drop inside a spanned cell, or this is the
// dragged cell
while (colspan > 1) {
cellColumnIndex++;
@@ -9083,9 +9080,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
if (visible && !isVisible) {
escalator.getBody().setSpacer(rowIndex, DETAILS_ROW_INITIAL_HEIGHT);
visibleDetails.add(rowIndexInteger);
- }
-
- else if (!visible && isVisible) {
+ } else if (!visible && isVisible) {
escalator.getBody().setSpacer(rowIndex, -1);
visibleDetails.remove(rowIndexInteger);
}