diff options
author | Alexander Kurtakov | 2017-05-18 13:27:35 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2017-05-18 14:56:01 +0000 |
commit | 57642a908d93abde7dbe77f92cdcf2fb960a1fa0 (patch) | |
tree | fd0e6ccf1e5dabc586a576c271227ba00934c25e /profiling | |
parent | 7cf4a497c86e0216748e457bbd8975e548905d72 (diff) | |
download | org.eclipse.linuxtools-57642a908d93abde7dbe77f92cdcf2fb960a1fa0.tar.gz org.eclipse.linuxtools-57642a908d93abde7dbe77f92cdcf2fb960a1fa0.tar.xz org.eclipse.linuxtools-57642a908d93abde7dbe77f92cdcf2fb960a1fa0.zip |
Make use of the new lambda listeners in SWT.
This saves hundreds of anonymous classes being created.
Change-Id: I3ca2b8a2add0f107d36728666adef8305f75e3a9
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Reviewed-on: https://git.eclipse.org/r/97445
Tested-by: Hudson CI
Diffstat (limited to 'profiling')
9 files changed, 71 insertions, 157 deletions
diff --git a/profiling/org.eclipse.linuxtools.binutils/src/org/eclipse/linuxtools/binutils/link2source/STCSourceNotFoundEditor.java b/profiling/org.eclipse.linuxtools.binutils/src/org/eclipse/linuxtools/binutils/link2source/STCSourceNotFoundEditor.java index 900b98026c..7dcefe0bdd 100644 --- a/profiling/org.eclipse.linuxtools.binutils/src/org/eclipse/linuxtools/binutils/link2source/STCSourceNotFoundEditor.java +++ b/profiling/org.eclipse.linuxtools.binutils/src/org/eclipse/linuxtools/binutils/link2source/STCSourceNotFoundEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 STMicroelectronics. + * Copyright (c) 2009, 2017 STMicroelectronics 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 @@ -32,8 +32,7 @@ import org.eclipse.jface.preference.PreferenceDialog; import org.eclipse.jface.window.Window; import org.eclipse.linuxtools.internal.Activator; 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.widgets.Button; import org.eclipse.swt.widgets.Composite; @@ -120,32 +119,21 @@ public class STCSourceNotFoundEditor extends CommonSourceNotFoundEditor { } @Override - protected void createButtons(Composite parent) { - locateFileButton = new Button(parent, SWT.PUSH); - GridData data = new GridData(); - data.grabExcessHorizontalSpace = false; - data.grabExcessVerticalSpace = false; - locateFileButton.setLayoutData(data); - locateFileButton.setText(Messages.STCSourceNotFoundEditor_locate_file); - locateFileButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent evt) { - locateFile(); - } - }); - - editLookupButton = new Button(parent, SWT.PUSH); - editLookupButton.setLayoutData(data); - editLookupButton - .setText(Messages.STCSourceNotFoundEditor_edit_source_lookup_path); - editLookupButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent evt) { - editSourceLookupPath(); - } - }); - syncButtons(); - } + protected void createButtons(Composite parent) { + locateFileButton = new Button(parent, SWT.PUSH); + GridData data = new GridData(); + data.grabExcessHorizontalSpace = false; + data.grabExcessVerticalSpace = false; + locateFileButton.setLayoutData(data); + locateFileButton.setText(Messages.STCSourceNotFoundEditor_locate_file); + locateFileButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> locateFile())); + + editLookupButton = new Button(parent, SWT.PUSH); + editLookupButton.setLayoutData(data); + editLookupButton.setText(Messages.STCSourceNotFoundEditor_edit_source_lookup_path); + editLookupButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> editSourceLookupPath())); + syncButtons(); + } @Override protected void editSourceLookupPath() { diff --git a/profiling/org.eclipse.linuxtools.dataviewers.charts/src/org/eclipse/linuxtools/internal/dataviewers/charts/dialogs/ChartDialog.java b/profiling/org.eclipse.linuxtools.dataviewers.charts/src/org/eclipse/linuxtools/internal/dataviewers/charts/dialogs/ChartDialog.java index 0ff2002410..23e7e161a2 100755 --- a/profiling/org.eclipse.linuxtools.dataviewers.charts/src/org/eclipse/linuxtools/internal/dataviewers/charts/dialogs/ChartDialog.java +++ b/profiling/org.eclipse.linuxtools.dataviewers.charts/src/org/eclipse/linuxtools/internal/dataviewers/charts/dialogs/ChartDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 STMicroelectronics. + * Copyright (c) 2009, 2017 STMicroelectronics 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 @@ -191,12 +191,8 @@ public class ChartDialog extends Dialog { barGraphButton = new Button(chartTypeGroup, SWT.RADIO); barGraphButton.setText(Messages.ChartConstants_BAR_GRAPH); barGraphButton.addSelectionListener(listener); - barGraphButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - verticalBarsButton.setEnabled(barGraphButton.getSelection()); - } - }); + barGraphButton.addSelectionListener(SelectionListener + .widgetSelectedAdapter(e -> verticalBarsButton.setEnabled(barGraphButton.getSelection()))); data = new GridData(); barGraphButton.setLayoutData(data); diff --git a/profiling/org.eclipse.linuxtools.dataviewers/src/org/eclipse/linuxtools/dataviewers/dialogs/STDataViewersExportToCSVDialog.java b/profiling/org.eclipse.linuxtools.dataviewers/src/org/eclipse/linuxtools/dataviewers/dialogs/STDataViewersExportToCSVDialog.java index 51bdad1f60..08391a1ec9 100644 --- a/profiling/org.eclipse.linuxtools.dataviewers/src/org/eclipse/linuxtools/dataviewers/dialogs/STDataViewersExportToCSVDialog.java +++ b/profiling/org.eclipse.linuxtools.dataviewers/src/org/eclipse/linuxtools/dataviewers/dialogs/STDataViewersExportToCSVDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 STMicroelectronics. + * Copyright (c) 2009, 2017 STMicroelectronics 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 @@ -24,7 +24,6 @@ import org.eclipse.linuxtools.dataviewers.abstractviewers.STDataViewersCSVExport import org.eclipse.linuxtools.dataviewers.abstractviewers.STDataViewersCSVExporterConstants; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Color; @@ -166,23 +165,14 @@ public class STDataViewersExportToCSVDialog extends Dialog { Button browseOutputButton = new Button(browseComposite, SWT.PUSH); browseOutputButton.setText("File System..."); - browseOutputButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - handleBrowse(); - } - }); + browseOutputButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> handleBrowse())); layoutData = new GridData(SWT.RIGHT, SWT.FILL, false, false, 1, 1); browseOutputButton.setLayoutData(layoutData); Button browseOutputInWorkspaceButton = new Button(browseComposite, SWT.PUSH); browseOutputInWorkspaceButton.setText("Workspace..."); - browseOutputInWorkspaceButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - handleBrowseWorkspace(); - } - }); + browseOutputInWorkspaceButton + .addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> handleBrowseWorkspace())); layoutData = new GridData(SWT.RIGHT, SWT.FILL, false, false, 1, 1); browseOutputInWorkspaceButton.setLayoutData(layoutData); } diff --git a/profiling/org.eclipse.linuxtools.dataviewers/src/org/eclipse/linuxtools/dataviewers/dialogs/STDataViewersSortDialog.java b/profiling/org.eclipse.linuxtools.dataviewers/src/org/eclipse/linuxtools/dataviewers/dialogs/STDataViewersSortDialog.java index 6e46444ecb..6bc7c35f6f 100644 --- a/profiling/org.eclipse.linuxtools.dataviewers/src/org/eclipse/linuxtools/dataviewers/dialogs/STDataViewersSortDialog.java +++ b/profiling/org.eclipse.linuxtools.dataviewers/src/org/eclipse/linuxtools/dataviewers/dialogs/STDataViewersSortDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 STMicroelectronics. + * Copyright (c) 2009, 2017 STMicroelectronics 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 @@ -24,6 +24,7 @@ import org.eclipse.osgi.util.NLS; 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; @@ -120,20 +121,10 @@ public class STDataViewersSortDialog extends TrayDialog { ascendingButtons[i] = new Button(directionGroup, SWT.RADIO); ascendingButtons[i].setText(getAscendingText(i)); - ascendingButtons[i].addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - markDirty(); - } - }); + ascendingButtons[i].addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> markDirty())); descendingButtons[i] = new Button(directionGroup, SWT.RADIO); descendingButtons[i].setText(getDescendingText(i)); - descendingButtons[i].addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - markDirty(); - } - }); + descendingButtons[i].addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> markDirty())); if (i < priorityCombos.length - 1) { priorityCombos[i].addSelectionListener(new SelectionAdapter() { @@ -171,12 +162,7 @@ public class STDataViewersSortDialog extends TrayDialog { } }); } else { - priorityCombos[i].addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - markDirty(); - } - }); + priorityCombos[i].addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> markDirty())); } } @@ -234,13 +220,10 @@ public class STDataViewersSortDialog extends TrayDialog { Button defaultsButton = new Button(parent, SWT.PUSH); defaultsButton.setText(STDataViewersMessages.restoreDefaults_text); setButtonSize(defaultsButton, new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.FILL_HORIZONTAL)); - defaultsButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - restoreDefaults(); - markDirty(); - } - }); + defaultsButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> { + restoreDefaults(); + markDirty(); + })); } private void createSeparatorLine(Composite parent) { diff --git a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/internal/profiling/launch/AbstractProfilingOptionsTab.java b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/internal/profiling/launch/AbstractProfilingOptionsTab.java index 83a8e21c00..51d47c2848 100644 --- a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/internal/profiling/launch/AbstractProfilingOptionsTab.java +++ b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/internal/profiling/launch/AbstractProfilingOptionsTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013, 2015 Red Hat, Inc. + * Copyright (c) 2013, 2017 Red Hat, Inc. * 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 @@ -29,8 +29,7 @@ import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CTabFolder; import org.eclipse.swt.custom.CTabItem; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; @@ -88,19 +87,16 @@ public abstract class AbstractProfilingOptionsTab extends AbstractLaunchConfigur tabgroup.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true)); - providerCombo.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - String curProviderId = comboItems.get(providerCombo.getText()); - loadTabGroupItems(tabgroup, curProviderId); - initializeFrom(initial); - // Since we are calling initializeFrom manually, we have to - // update the launch configuration dialog manually to ensure - // initial validation on the configuration. - updateLaunchConfigurationDialog(); - top.layout(); - } - }); + providerCombo.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> { + String curProviderId = comboItems.get(providerCombo.getText()); + loadTabGroupItems(tabgroup, curProviderId); + initializeFrom(initial); + // Since we are calling initializeFrom manually, we have to + // update the launch configuration dialog manually to ensure + // initial validation on the configuration. + updateLaunchConfigurationDialog(); + top.layout(); + })); } /** diff --git a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/internal/profiling/launch/provider/AbstractProviderPropertyTab.java b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/internal/profiling/launch/provider/AbstractProviderPropertyTab.java index 55a78f05df..51d5d349f6 100644 --- a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/internal/profiling/launch/provider/AbstractProviderPropertyTab.java +++ b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/internal/profiling/launch/provider/AbstractProviderPropertyTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 Red Hat, Inc. + * Copyright (c) 2012, 2017 Red Hat, Inc. * 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 @@ -24,8 +24,7 @@ import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.linuxtools.internal.profiling.launch.provider.launch.Messages; import org.eclipse.linuxtools.internal.profiling.launch.provider.launch.ProviderFramework; 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; @@ -76,12 +75,7 @@ public abstract class AbstractProviderPropertyTab extends AbstractCPropertyTab { useProjectSetting.setText(Messages.UseProjectSetting_0); useProjectSetting.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false, 1, 1)); useProjectSetting.setSelection(getPreferenceStore().getBoolean(ProviderProfileConstants.USE_PROJECT_SETTINGS + getType())); - useProjectSetting.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - updateOptionsEnable(); - } - }); + useProjectSetting.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> updateOptionsEnable())); String highestProviderId = ProviderFramework.getHighestProviderId(getType()); if (highestProviderId != null) { @@ -93,12 +87,8 @@ public abstract class AbstractProviderPropertyTab extends AbstractCPropertyTab { fLink= new Link(usercomp, SWT.NULL); fLink.setText(Messages.PreferenceLink_0); fLink.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, true, false, 1, 1)); - fLink.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - PreferencesUtil.createPreferenceDialogOn(parent.getShell(), getPrefPageId(), null, null).open(); - } - }); + fLink.addSelectionListener(SelectionListener.widgetSelectedAdapter( + e -> PreferencesUtil.createPreferenceDialogOn(parent.getShell(), getPrefPageId(), null, null).open())); HashMap<String, String> map = ProviderFramework @@ -147,12 +137,8 @@ public abstract class AbstractProviderPropertyTab extends AbstractCPropertyTab { radio.setText(labelAndValue[0]); radio.setData(labelAndValue[1]); radio.setFont(parent.getFont()); - radio.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent event) { - value = (String) event.widget.getData(); - } - }); + radio.addSelectionListener( + SelectionListener.widgetSelectedAdapter(event -> value = (String) event.widget.getData())); } projectSettingsGroup.addDisposeListener(event -> { projectSettingsGroup = null; diff --git a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyCMainTab.java b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyCMainTab.java index e049a09d7c..abe97c5d9b 100644 --- a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyCMainTab.java +++ b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyCMainTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 QNX Software Systems and others. + * Copyright (c) 2005, 2017 QNX Software Systems 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 @@ -49,8 +49,7 @@ import org.eclipse.linuxtools.internal.profiling.launch.ProfileLaunchPlugin; import org.eclipse.linuxtools.profiling.launch.ui.ResourceSelectorWidget; import org.eclipse.osgi.util.NLS; 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.graphics.Image; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; @@ -174,13 +173,8 @@ public class RemoteProxyCMainTab extends CAbstractMainTab { fTerminalButton = createCheckButton(mainComp, LaunchMessages.CMainTab_UseTerminal); - fTerminalButton.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent evt) { - updateLaunchConfigurationDialog(); - } - }); + fTerminalButton + .addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> updateLaunchConfigurationDialog())); fTerminalButton.setEnabled(PTY.isSupported()); } @@ -386,14 +380,10 @@ public class RemoteProxyCMainTab extends CAbstractMainTab { fProjButton = createPushButton(projComp, LaunchMessages.Launch_common_Browse_1, null); - fProjButton.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent evt) { - handleProjectButtonSelected(); - updateLaunchConfigurationDialog(); - } - }); + fProjButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> { + handleProjectButtonSelected(); + updateLaunchConfigurationDialog(); + })); } @Override @@ -463,14 +453,11 @@ public class RemoteProxyCMainTab extends CAbstractMainTab { toLabel.setEnabled(false); - enableCopyFromExeButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - boolean copyEnabled = enableCopyFromExeButton.getSelection(); - setEnableCopyFromSection(copyEnabled); - updateLaunchConfigurationDialog(); - } - }); + enableCopyFromExeButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> { + boolean copyEnabled = enableCopyFromExeButton.getSelection(); + setEnableCopyFromSection(copyEnabled); + updateLaunchConfigurationDialog(); + })); copyFromExeText = copyFromExeSelector.getURIText(); copyFromExeText.addModifyListener(evt -> updateLaunchConfigurationDialog()); diff --git a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/ui/ResourceSelectorWidget.java b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/ui/ResourceSelectorWidget.java index 73cf5cbe44..4193826004 100644 --- a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/ui/ResourceSelectorWidget.java +++ b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/ui/ResourceSelectorWidget.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 IBM Corporation and others. + * Copyright (c) 2012, 2017 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 @@ -19,8 +19,7 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.linuxtools.internal.profiling.launch.ProfileLaunchPlugin; import org.eclipse.osgi.util.TextProcessor; 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.FillLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; @@ -174,12 +173,7 @@ public class ResourceSelectorWidget { // browse button browseButton = new Button(browserComp, SWT.PUSH); browseButton.setText(BROWSE_LABEL); - browseButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent event) { - handleURIBrowseButtonPressed(); - } - }); + browseButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> handleURIBrowseButtonPressed())); uriField.addModifyListener(e -> updateFilesystemSelector(uriField.getText())); } diff --git a/profiling/org.eclipse.linuxtools.tools.launch.ui/src/org/eclipse/linuxtools/internal/tools/launch/ui/properties/LinuxtoolsPathPropertyPage.java b/profiling/org.eclipse.linuxtools.tools.launch.ui/src/org/eclipse/linuxtools/internal/tools/launch/ui/properties/LinuxtoolsPathPropertyPage.java index f534b2c448..9a0410f506 100644 --- a/profiling/org.eclipse.linuxtools.tools.launch.ui/src/org/eclipse/linuxtools/internal/tools/launch/ui/properties/LinuxtoolsPathPropertyPage.java +++ b/profiling/org.eclipse.linuxtools.tools.launch.ui/src/org/eclipse/linuxtools/internal/tools/launch/ui/properties/LinuxtoolsPathPropertyPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2014 IBM Corporation + * Copyright (c) 2011, 2017 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 @@ -26,8 +26,7 @@ import org.eclipse.jface.preference.StringFieldEditor; import org.eclipse.linuxtools.tools.launch.core.LaunchCoreConstants; import org.eclipse.linuxtools.tools.launch.core.properties.LinuxtoolsPathProperty; 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; @@ -116,12 +115,7 @@ public class LinuxtoolsPathPropertyPage extends PropertyPage { systemEnvButton = new Button(radios, SWT.RADIO); systemEnvButton.setText(Messages.LINUXTOOLS_PATH_SYSTEM_ENV); systemEnvButton.setSelection(systemPathSelected); - systemEnvButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - updateOptionsEnable(); - } - }); + systemEnvButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> updateOptionsEnable())); customButton = new Button(radios, SWT.RADIO); customButton.setText(Messages.LINUXTOOLS_PATH_CUSTOM); |