Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-03-09 07:35:34 +0000
committerAlexander Kurtakov2018-03-09 08:23:00 +0000
commitc158b0bdd2171bb1ae3b05dd1eeff6c64841dc48 (patch)
treed2b1bb58fbeec712a6deb4fa27bca6f06b9fdbab /build/org.eclipse.cdt.meson.ui
parent88d52ef0891f44776b76c7274862fbe65a6bcb78 (diff)
downloadorg.eclipse.cdt-c158b0bdd2171bb1ae3b05dd1eeff6c64841dc48.tar.gz
org.eclipse.cdt-c158b0bdd2171bb1ae3b05dd1eeff6c64841dc48.tar.xz
org.eclipse.cdt-c158b0bdd2171bb1ae3b05dd1eeff6c64841dc48.zip
Use lamdbas.
Change-Id: Iece00d9c1af64bb0218a41519e995d33d8edee31 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'build/org.eclipse.cdt.meson.ui')
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonBuildTab.java19
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonPreferencePage.java30
2 files changed, 18 insertions, 31 deletions
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonBuildTab.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonBuildTab.java
index 4470a62f095..b1635f56401 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonBuildTab.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonBuildTab.java
@@ -19,8 +19,7 @@ import org.eclipse.cdt.meson.core.IMesonConstants;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -65,21 +64,13 @@ public class MesonBuildTab extends CommonBuildTab {
unixGenButton = new Button(genComp, SWT.RADIO);
unixGenButton.setText(Messages.MesonBuildTab_UnixMakefiles);
- unixGenButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
+ unixGenButton
+ .addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> updateLaunchConfigurationDialog()));
ninjaGenButton = new Button(genComp, SWT.RADIO);
ninjaGenButton.setText(Messages.MesonBuildTab_Ninja);
- ninjaGenButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
+ ninjaGenButton
+ .addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> updateLaunchConfigurationDialog()));
label = new Label(mesonGroup, SWT.NONE);
label.setText(Messages.MesonBuildTab_MesonArgs);
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonPreferencePage.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonPreferencePage.java
index 3d548fd7f82..fb011687ebf 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonPreferencePage.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonPreferencePage.java
@@ -18,9 +18,9 @@ import java.util.List;
import java.util.Map;
import org.eclipse.cdt.core.build.IToolChain;
+import org.eclipse.cdt.meson.core.Activator;
import org.eclipse.cdt.meson.core.IMesonToolChainFile;
import org.eclipse.cdt.meson.core.IMesonToolChainManager;
-import org.eclipse.cdt.meson.core.Activator;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.layout.TableColumnLayout;
@@ -29,8 +29,7 @@ import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -97,22 +96,19 @@ public class MesonPreferencePage extends PreferencePage implements IWorkbenchPre
Button addButton = new Button(buttonsComp, SWT.PUSH);
addButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
addButton.setText(Messages.MesonPreferencePage_Add);
- addButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- NewMesonToolChainFileWizard wizard = new NewMesonToolChainFileWizard();
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- if (dialog.open() == Window.OK) {
- IMesonToolChainFile file = wizard.getNewFile();
- IMesonToolChainFile oldFile = manager.getToolChainFile(file.getPath());
- if (oldFile != null) {
- filesToRemove.put(oldFile.getPath(), oldFile);
- }
- filesToAdd.put(file.getPath(), file);
- updateTable();
+ addButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ NewMesonToolChainFileWizard wizard = new NewMesonToolChainFileWizard();
+ WizardDialog dialog = new WizardDialog(getShell(), wizard);
+ if (dialog.open() == Window.OK) {
+ IMesonToolChainFile file = wizard.getNewFile();
+ IMesonToolChainFile oldFile = manager.getToolChainFile(file.getPath());
+ if (oldFile != null) {
+ filesToRemove.put(oldFile.getPath(), oldFile);
}
+ filesToAdd.put(file.getPath(), file);
+ updateTable();
}
- });
+ }));
removeButton = new Button(buttonsComp, SWT.PUSH);
removeButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));

Back to the top