1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Use lamdbas.

Change-Id: Iece00d9c1af64bb0218a41519e995d33d8edee31
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
This commit is contained in:
Alexander Kurtakov 2018-03-09 09:35:34 +02:00
parent 88d52ef089
commit c158b0bdd2
2 changed files with 18 additions and 31 deletions

View file

@ -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);

View file

@ -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));