diff options
author | Alexander Kurtakov | 2016-07-24 19:57:11 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2016-07-24 19:57:11 +0000 |
commit | 1fb36aa4b6acb0358844d2c2090bdcdd60d0836b (patch) | |
tree | 6837dae6582893a65c9a443c529092eef526d2ed /bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java | |
parent | 16f51f88dad9396bc46d985696a4f65ae53b2f76 (diff) | |
download | eclipse.platform.swt-1fb36aa4b6acb0358844d2c2090bdcdd60d0836b.tar.gz eclipse.platform.swt-1fb36aa4b6acb0358844d2c2090bdcdd60d0836b.tar.xz eclipse.platform.swt-1fb36aa4b6acb0358844d2c2090bdcdd60d0836b.zip |
Bug 497962 - Use lambdas where possible
Enable convert to lambdas and run initial conversion to not interfere
with later commits. Slightly smaller and faster code is worth it at SWT
level.
Change-Id: Ia94b6c25beb09555626eaa455b9e9f43e329f7e6
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java index 840e339249..7b115ffbee 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java @@ -170,18 +170,15 @@ public DragSource(Control control, int style) { OS.g_signal_connect(control.handle, OS.drag_end, DragEnd.getAddress(), 0); OS.g_signal_connect(control.handle, OS.drag_data_delete, DragDataDelete.getAddress(), 0); - controlListener = new Listener () { - @Override - public void handleEvent (Event event) { - if (event.type == SWT.Dispose) { - if (!DragSource.this.isDisposed()) { - DragSource.this.dispose(); - } + controlListener = event -> { + if (event.type == SWT.Dispose) { + if (!DragSource.this.isDisposed()) { + DragSource.this.dispose(); } - if (event.type == SWT.DragDetect) { - if (!DragSource.this.isDisposed()) { - DragSource.this.drag(event); - } + } + if (event.type == SWT.DragDetect) { + if (!DragSource.this.isDisposed()) { + DragSource.this.drag(event); } } }; @@ -197,12 +194,7 @@ public DragSource(Control control, int style) { dragEffect = new TableDragSourceEffect((Table) control); } - this.addListener(SWT.Dispose, new Listener() { - @Override - public void handleEvent(Event e) { - onDispose(); - } - }); + this.addListener(SWT.Dispose, e -> onDispose()); } static int checkStyle (int style) { |