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.browser.demos | |
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.browser.demos')
-rw-r--r-- | examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/PawnTab.java | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/PawnTab.java b/examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/PawnTab.java index 3f7d803c89..a49679890e 100644 --- a/examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/PawnTab.java +++ b/examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/PawnTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation 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 @@ -151,11 +151,7 @@ public class PawnTab { game = new byte[8][8]; if (computer) ttr = new Pawns(); for (int i = 0; i < 5; i++) game[(int)(Math.random()*game.length)][(int)(Math.random()*game[0].length)] = WALL; - e.display.asyncExec(new Runnable() { - @Override - public void run() { - browser.setText(getHtml(TYPE_BOARD)); - }}); + e.display.asyncExec(() -> browser.setText(getHtml(TYPE_BOARD))); e.doit = false; return; } @@ -164,11 +160,7 @@ public class PawnTab { CSS_FOLDER = e.location.substring(index, index + 4); URL_CSS = PLUGIN_PATH+CSS_FOLDER+"/style.css"; URL_WELCOME = PLUGIN_PATH+CSS_FOLDER+"/welcome.html"; - e.display.asyncExec(new Runnable() { - @Override - public void run() { - browser.setUrl(URL_WELCOME); - }}); + e.display.asyncExec(() -> browser.setUrl(URL_WELCOME)); e.doit = false; return; } |