[cleanup] Combine nested 'if' within 'else' block to 'else if'
Cleanup performed on bundles
- org.eclipse.jface.examples.databinding
- org.eclipse.jface.snippets
Signed-off-by: Karsten Thoms <karsten.thoms@karakun.com>
Change-Id: Ie6cd9b1bc96800f4298e0cefcce35a5e1e6891b5
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/172233
Tested-by: Platform Bot <platform-bot@eclipse.org>
Reviewed-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/EditMask.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/EditMask.java
index 58bf9d4..5f5aebf 100644
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/EditMask.java
+++ b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/EditMask.java
@@ -401,14 +401,11 @@
selection = firstIncompletePosition;
text.setSelection(new Point(selection, selection));
- } else { // nothing was accepted by the mask
-
- // Either we backspaced over a literal or we typed an illegal character
- if (selection > oldSelection) { // typed an illegal character; backup
- text.setSelection(new Point(selection-1, selection-1));
- } else { // backspaced over a literal; don't interfere with selection position
- text.setSelection(new Point(selection, selection));
- }
+ } else // Either we backspaced over a literal or we typed an illegal character
+ if (selection > oldSelection) { // typed an illegal character; backup
+ text.setSelection(new Point(selection-1, selection-1));
+ } else { // backspaced over a literal; don't interfere with selection position
+ text.setSelection(new Point(selection, selection));
}
oldRawText = newRawText;
}
diff --git a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/TableCursor.java b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/TableCursor.java
index 8146fec..10cc230 100644
--- a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/TableCursor.java
+++ b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/TableCursor.java
@@ -74,22 +74,20 @@
break;
}
}
- } else {
- if (((Table)getParent()).getColumnCount() == 0) {
- x += 5;
- } else {
- int alignmnent = ((Table)getParent()).getColumn(cell.getColumnIndex()).getAlignment();
- switch (alignmnent) {
- case SWT.LEFT:
- x += 5;
- break;
- case SWT.RIGHT:
- x = bounds.width- extent.x - 2;
- break;
- case SWT.CENTER:
- x += (bounds.width - x - extent.x) / 2 + 2;
- break;
- }
+ } else if (((Table)getParent()).getColumnCount() == 0) {
+ x += 5;
+ } else {
+ int alignmnent = ((Table)getParent()).getColumn(cell.getColumnIndex()).getAlignment();
+ switch (alignmnent) {
+ case SWT.LEFT:
+ x += 5;
+ break;
+ case SWT.RIGHT:
+ x = bounds.width- extent.x - 2;
+ break;
+ case SWT.CENTER:
+ x += (bounds.width - x - extent.x) / 2 + 2;
+ break;
}
}
int textY = (size.y - extent.y) / 2;