diff options
author | Alexander Kurtakov | 2018-01-26 19:30:17 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2018-01-26 19:30:17 +0000 |
commit | 86643c0b8be9a53a0c29011e5199202e68a92aa1 (patch) | |
tree | 9bad080a2a278c4134d7aabaa4285226b66ef809 /bundles/org.eclipse.equinox.p2.ui.admin | |
parent | 631cdd4b4d83bc5cd89e9d8d9118dc9faa420588 (diff) | |
download | rt.equinox.p2-86643c0b8be9a53a0c29011e5199202e68a92aa1.tar.gz rt.equinox.p2-86643c0b8be9a53a0c29011e5199202e68a92aa1.tar.xz rt.equinox.p2-86643c0b8be9a53a0c29011e5199202e68a92aa1.zip |
Bug 530396 - Move UI code to lambdas
Change-Id: I92c7b5c6cbde04280da91a9ee617495ff0381a73
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui.admin')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/ProfileGroup.java | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/ProfileGroup.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/ProfileGroup.java index 784c78f37..3f00b59bf 100644 --- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/ProfileGroup.java +++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/ProfileGroup.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2017 IBM Corporation and others. + * Copyright (c) 2007, 2018 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,7 +19,8 @@ import org.eclipse.core.runtime.Status; import org.eclipse.equinox.internal.p2.ui.admin.*; import org.eclipse.equinox.p2.engine.IProfile; import org.eclipse.swt.SWT; -import org.eclipse.swt.events.*; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.*; @@ -73,17 +74,14 @@ public class ProfileGroup { Button locationButton = new Button(composite, SWT.PUSH); locationButton.setText(ProvAdminUIMessages.ProfileGroup_Browse); - locationButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent event) { - DirectoryDialog dialog = new DirectoryDialog(parent.getShell(), SWT.APPLICATION_MODAL); - dialog.setMessage(ProvAdminUIMessages.ProfileGroup_SelectProfileMessage); - String dir = dialog.open(); - if (dir != null) { - location.setText(dir); - } + locationButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(event -> { + DirectoryDialog dialog = new DirectoryDialog(parent.getShell(), SWT.APPLICATION_MODAL); + dialog.setMessage(ProvAdminUIMessages.ProfileGroup_SelectProfileMessage); + String dir = dialog.open(); + if (dir != null) { + location.setText(dir); } - }); + })); setEditable(locationButton, profile == null, listener); label = new Label(composite, SWT.NONE); @@ -94,17 +92,14 @@ public class ProfileGroup { locationButton = new Button(composite, SWT.PUSH); locationButton.setText(ProvAdminUIMessages.ProfileGroup_Browse2); - locationButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent event) { - DirectoryDialog dialog = new DirectoryDialog(parent.getShell(), SWT.APPLICATION_MODAL); - dialog.setMessage(ProvAdminUIMessages.ProfileGroup_SelectBundlePoolCache); - String dir = dialog.open(); - if (dir != null) { - cache.setText(dir); - } + locationButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(event -> { + DirectoryDialog dialog = new DirectoryDialog(parent.getShell(), SWT.APPLICATION_MODAL); + dialog.setMessage(ProvAdminUIMessages.ProfileGroup_SelectBundlePoolCache); + String dir = dialog.open(); + if (dir != null) { + cache.setText(dir); } - }); + })); setEditable(locationButton, profile == null, listener); label = new Label(composite, SWT.NONE); |