From 18decd2e3c33c51cc70f90bed12f2f5982847cba Mon Sep 17 00:00:00 2001 From: Laurent CARON Date: Wed, 17 Aug 2022 20:12:06 +0200 Subject: [PATCH] Bug #489 - Nebula 2.7.2 releng Code cleaning --- .../org/eclipse/nebula/widgets/grid/Grid.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/Grid.java b/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/Grid.java index aacd66ce0..6bf7067f5 100644 --- a/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/Grid.java +++ b/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/Grid.java @@ -6278,10 +6278,10 @@ void updateColumnSelection() { * Initialize all listeners. */ private void initListeners() { - disposeListener = e -> onDispose(e); + disposeListener = this::onDispose; addListener(SWT.Dispose, disposeListener); - addPaintListener(e -> onPaint(e)); + addPaintListener(this::onPaint); addListener(SWT.Resize, e -> onResize()); @@ -6293,7 +6293,7 @@ private void initListeners() { getHorizontalBar().addListener(SWT.Selection, e -> onScrollSelection()); } - defaultKeyListener = e -> onKeyDown(e); + defaultKeyListener = this::onKeyDown; addListener(SWT.KeyDown, defaultKeyListener); addTraverseListener(e -> { @@ -6322,7 +6322,7 @@ private void initListeners() { addListener(SWT.MouseDown, this::onMouseDown); addListener(SWT.MouseUp, this::onMouseUp); - addMouseMoveListener(e -> onMouseMove(e)); + addMouseMoveListener(this::onMouseMove); addMouseTrackListener(new MouseTrackListener() { @Override @@ -6354,7 +6354,7 @@ public void focusLost(final FocusEvent e) { // Special code to reflect mouse wheel events if using an external // scroller - addListener(SWT.MouseWheel, e -> onMouseWheel(e)); + addListener(SWT.MouseWheel, this::onMouseWheel); } /** @@ -9488,7 +9488,7 @@ public void getChildren(final AccessibleControlEvent e) { for (int i = 0; i < items.size(); i++) { if (items.get(i).getParentItem() == null) { - children[j] = new Integer(i); + children[j] = Integer.valueOf(i); j++; } } @@ -9496,7 +9496,7 @@ public void getChildren(final AccessibleControlEvent e) { } else { final Object[] children = new Object[length]; for (int i = 0; i < items.size(); i++) { - children[i] = new Integer(i); + children[i] = Integer.valueOf(i); } e.children = children; } @@ -9631,7 +9631,7 @@ public void getSelection(final AccessibleControlEvent e) { for (int i = 0; i < length; i++) { final GridItem item = selectedItems.get(i); - children[i] = new Integer(item.getRowIndex()); + children[i] = Integer.valueOf(item.getRowIndex()); } e.children = children; }