diff options
author | Alexander Kurtakov | 2016-01-14 09:28:47 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2016-01-15 07:34:12 +0000 |
commit | 7ea03d5ad5365ff1ae53219e5549fc9ceee1192f (patch) | |
tree | 331a076ef1b9a07108f2abb5b351e250b3dba787 /examples/org.eclipse.swt.examples.watchdog | |
parent | bb8275c21d162c7b5dfb6cfa635c2c509e88e7af (diff) | |
download | eclipse.platform.swt-7ea03d5ad5365ff1ae53219e5549fc9ceee1192f.tar.gz eclipse.platform.swt-7ea03d5ad5365ff1ae53219e5549fc9ceee1192f.tar.xz eclipse.platform.swt-7ea03d5ad5365ff1ae53219e5549fc9ceee1192f.zip |
Bug 485821 - Make examples/snippets use lambdas
Convert Display.syncExec/asyncExec.
Change-Id: I9327a1bc93e1a0f2981162b8f15a814692a9635b
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'examples/org.eclipse.swt.examples.watchdog')
-rw-r--r-- | examples/org.eclipse.swt.examples.watchdog/src/org/eclipse/swt/examples/watchdog/WatchdogPlugin.java | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/examples/org.eclipse.swt.examples.watchdog/src/org/eclipse/swt/examples/watchdog/WatchdogPlugin.java b/examples/org.eclipse.swt.examples.watchdog/src/org/eclipse/swt/examples/watchdog/WatchdogPlugin.java index 4712bab223..8f00ae0343 100644 --- a/examples/org.eclipse.swt.examples.watchdog/src/org/eclipse/swt/examples/watchdog/WatchdogPlugin.java +++ b/examples/org.eclipse.swt.examples.watchdog/src/org/eclipse/swt/examples/watchdog/WatchdogPlugin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013, Google Inc. and others. + * Copyright (c) 2013, 2016 Google Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -40,12 +40,9 @@ public class WatchdogPlugin extends AbstractUIPlugin implements IStartup { @Override public void earlyStartup() { if (display != null) { - display.asyncExec(new Runnable() { - @Override - public void run() { - display.addListener(SWT.PreEvent, watchdog); - display.addListener(SWT.PostEvent, watchdog); - } + display.asyncExec(() -> { + display.addListener(SWT.PreEvent, watchdog); + display.addListener(SWT.PostEvent, watchdog); }); } } @@ -54,13 +51,10 @@ public class WatchdogPlugin extends AbstractUIPlugin implements IStartup { public void stop(BundleContext context) throws Exception { try { if (display != null && !display.isDisposed()) { - display.asyncExec(new Runnable() { - @Override - public void run() { - if (!display.isDisposed()) { - display.removeListener(SWT.PreEvent, watchdog); - display.removeListener(SWT.PostEvent, watchdog); - } + display.asyncExec(() -> { + if (!display.isDisposed()) { + display.removeListener(SWT.PreEvent, watchdog); + display.removeListener(SWT.PostEvent, watchdog); } }); } |