1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 02:06:01 +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.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Button;
@ -65,21 +64,13 @@ public class MesonBuildTab extends CommonBuildTab {
unixGenButton = new Button(genComp, SWT.RADIO); unixGenButton = new Button(genComp, SWT.RADIO);
unixGenButton.setText(Messages.MesonBuildTab_UnixMakefiles); unixGenButton.setText(Messages.MesonBuildTab_UnixMakefiles);
unixGenButton.addSelectionListener(new SelectionAdapter() { unixGenButton
@Override .addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> updateLaunchConfigurationDialog()));
public void widgetSelected(SelectionEvent e) {
updateLaunchConfigurationDialog();
}
});
ninjaGenButton = new Button(genComp, SWT.RADIO); ninjaGenButton = new Button(genComp, SWT.RADIO);
ninjaGenButton.setText(Messages.MesonBuildTab_Ninja); ninjaGenButton.setText(Messages.MesonBuildTab_Ninja);
ninjaGenButton.addSelectionListener(new SelectionAdapter() { ninjaGenButton
@Override .addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> updateLaunchConfigurationDialog()));
public void widgetSelected(SelectionEvent e) {
updateLaunchConfigurationDialog();
}
});
label = new Label(mesonGroup, SWT.NONE); label = new Label(mesonGroup, SWT.NONE);
label.setText(Messages.MesonBuildTab_MesonArgs); label.setText(Messages.MesonBuildTab_MesonArgs);

View file

@ -18,9 +18,9 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.core.build.IToolChain; 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.IMesonToolChainFile;
import org.eclipse.cdt.meson.core.IMesonToolChainManager; import org.eclipse.cdt.meson.core.IMesonToolChainManager;
import org.eclipse.cdt.meson.core.Activator;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.layout.TableColumnLayout; 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.window.Window;
import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Button;
@ -97,9 +96,7 @@ public class MesonPreferencePage extends PreferencePage implements IWorkbenchPre
Button addButton = new Button(buttonsComp, SWT.PUSH); Button addButton = new Button(buttonsComp, SWT.PUSH);
addButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); addButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
addButton.setText(Messages.MesonPreferencePage_Add); addButton.setText(Messages.MesonPreferencePage_Add);
addButton.addSelectionListener(new SelectionAdapter() { addButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
@Override
public void widgetSelected(SelectionEvent e) {
NewMesonToolChainFileWizard wizard = new NewMesonToolChainFileWizard(); NewMesonToolChainFileWizard wizard = new NewMesonToolChainFileWizard();
WizardDialog dialog = new WizardDialog(getShell(), wizard); WizardDialog dialog = new WizardDialog(getShell(), wizard);
if (dialog.open() == Window.OK) { if (dialog.open() == Window.OK) {
@ -111,8 +108,7 @@ public class MesonPreferencePage extends PreferencePage implements IWorkbenchPre
filesToAdd.put(file.getPath(), file); filesToAdd.put(file.getPath(), file);
updateTable(); updateTable();
} }
} }));
});
removeButton = new Button(buttonsComp, SWT.PUSH); removeButton = new Button(buttonsComp, SWT.PUSH);
removeButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); removeButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));