Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2020-01-24 12:01:49 +0000
committerLars Vogel2020-02-04 17:37:35 +0000
commit5d8c6ed6887db4f3ba645355c4dd7f58e60e89a7 (patch)
tree5df323fbb2d5262b68036655e202a5c87948086c
parent3993e40aa139f672bd72d8bcf0a83e37458ad8c0 (diff)
downloadeclipse.platform.ua-5d8c6ed6887db4f3ba645355c4dd7f58e60e89a7.tar.gz
eclipse.platform.ua-5d8c6ed6887db4f3ba645355c4dd7f58e60e89a7.tar.xz
eclipse.platform.ua-5d8c6ed6887db4f3ba645355c4dd7f58e60e89a7.zip
Use method reference instead of lambdasI20200205-1800
Method references are slightly faster than lambdas and better readable. Change-Id: Id199208162c6ac69c3fa808eb8f8ff19aad6a07a Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkLabel.java2
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserAdapter.java2
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserFactory.java2
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterPage.java2
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpView.java2
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPart.java4
-rw-r--r--org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/explorer/TreeExplorerMenu.java2
-rw-r--r--org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationContentsArea.java2
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/IntroLaunchBar.java4
9 files changed, 11 insertions, 11 deletions
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkLabel.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkLabel.java
index 40e862b49..0418fee14 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkLabel.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkLabel.java
@@ -68,7 +68,7 @@ public class HyperlinkLabel extends Canvas {
this.label = new Label(this, style);
- addPaintListener(e -> paint(e));
+ addPaintListener(this::paint);
addKeyListener(new KeyAdapter() {
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserAdapter.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserAdapter.java
index d815416ab..2aa078617 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserAdapter.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserAdapter.java
@@ -118,7 +118,7 @@ public class EmbeddedBrowserAdapter implements IBrowser, IBrowserCloseListener{
if (getBrowserDisplay() == Display.getCurrent()) {
uiClose();
} else {
- getBrowserDisplay().syncExec(() -> uiClose());
+ getBrowserDisplay().syncExec(this::uiClose);
}
}
/*
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserFactory.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserFactory.java
index 08abf474a..166b11c6c 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserFactory.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserFactory.java
@@ -48,7 +48,7 @@ public class EmbeddedBrowserFactory implements IBrowserFactory {
if (BaseHelpSystem.getMode() == BaseHelpSystem.MODE_STANDALONE) {
try {
if (HelpUIEventLoop.isRunning()) {
- Display.getDefault().syncExec(() -> test());
+ Display.getDefault().syncExec(this::test);
}
} catch (Exception e) {
// just in case
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterPage.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterPage.java
index 2f682a048..c59217086 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterPage.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterPage.java
@@ -188,7 +188,7 @@ public class InfoCenterPage extends RootScopePage {
initializeControls();
- tree.addCheckStateListener(event -> handleCheckStateChange(event));
+ tree.addCheckStateListener(this::handleCheckStateChange);
tree.addTreeListener(new ITreeViewerListener() {
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpView.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpView.java
index 765bc8fde..94567091c 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpView.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpView.java
@@ -312,7 +312,7 @@ public class HelpView extends ViewPart implements IPartListener2,
public void selectionChanged(SelectionChangedEvent event) {
if (!visible)
return;
- getSite().getShell().getDisplay().asyncExec(() -> updateActivePart());
+ getSite().getShell().getDisplay().asyncExec(this::updateActivePart);
}
/*
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPart.java
index a623130df..d037df1e9 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPart.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPart.java
@@ -193,7 +193,7 @@ public class ReusableHelpPart implements IHelpUIConstants,
@Override
public void run() {
- BusyIndicator.showWhile(getControl().getDisplay(), () -> busyRun());
+ BusyIndicator.showWhile(getControl().getDisplay(), this::busyRun);
}
protected abstract void busyRun();
@@ -1013,7 +1013,7 @@ public class ReusableHelpPart implements IHelpUIConstants,
mform.getForm().setDelayedReflow(false);
toolkit.decorateFormHeading(mform.getForm().getForm());
MenuManager manager = new MenuManager();
- IMenuListener listener = manager1 -> contextMenuAboutToShow(manager1);
+ IMenuListener listener = this::contextMenuAboutToShow;
manager.setRemoveAllWhenShown(true);
manager.addMenuListener(listener);
Menu contextMenu = manager.createContextMenu(form.getForm());
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/explorer/TreeExplorerMenu.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/explorer/TreeExplorerMenu.java
index 3f69ce531..e09abb7f6 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/explorer/TreeExplorerMenu.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/explorer/TreeExplorerMenu.java
@@ -36,7 +36,7 @@ public class TreeExplorerMenu {
this.explorer = explorer;
MenuManager menuMgr = new MenuManager(null);
menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(manager -> fillContextMenu(manager));
+ menuMgr.addMenuListener(this::fillContextMenu);
Menu menu = menuMgr.createContextMenu(explorer.getControl());
explorer.getControl().setMenu(menu);
}
diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationContentsArea.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationContentsArea.java
index 5508b54bf..73b66c7b5 100644
--- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationContentsArea.java
+++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationContentsArea.java
@@ -725,7 +725,7 @@ public class CustomizationContentsArea {
public boolean performOk() {
saveData();
- BusyIndicator.showWhile(shell.getDisplay(), () -> restartIntro());
+ BusyIndicator.showWhile(shell.getDisplay(), this::restartIntro);
return true;
}
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/IntroLaunchBar.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/IntroLaunchBar.java
index e8a7e311b..81e9f8196 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/IntroLaunchBar.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/IntroLaunchBar.java
@@ -324,9 +324,9 @@ public class IntroLaunchBar {
toolBar.setBackground(bg);
// coolBar.setBackground(bg);
}
- container.addPaintListener(e -> onPaint(e));
+ container.addPaintListener(this::onPaint);
MenuManager manager = new MenuManager();
- IMenuListener listener = manager1 -> contextMenuAboutToShow(manager1);
+ IMenuListener listener = this::contextMenuAboutToShow;
manager.setRemoveAllWhenShown(true);
manager.addMenuListener(listener);
Menu contextMenu = manager.createContextMenu(toolBarManager.getControl());

Back to the top