Skip to main content
summaryrefslogtreecommitdiffstats
path: root/launch
diff options
context:
space:
mode:
authorAlexander Kurtakov2019-08-10 10:36:47 -0400
committerAlexander Kurtakov2019-08-12 07:11:40 -0400
commit1e42e5f0e1e6591b5b609db0b864affc746ed5bf (patch)
treeb640c6d31ef982f1428dcb1077d4ea8fba7fbce4 /launch
parent51da3eb3a619c85b31c74d0a1bedacfa94f5db58 (diff)
downloadorg.eclipse.cdt-1e42e5f0e1e6591b5b609db0b864affc746ed5bf.tar.gz
org.eclipse.cdt-1e42e5f0e1e6591b5b609db0b864affc746ed5bf.tar.xz
org.eclipse.cdt-1e42e5f0e1e6591b5b609db0b864affc746ed5bf.zip
Convert new Runnable to lambda.
Change-Id: I8b827013a29802a3f3ae6400ddce8d8753eb6399 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'launch')
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java30
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java26
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java22
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java26
4 files changed, 39 insertions, 65 deletions
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java
index de3cf48514..02c0744a7e 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java
@@ -977,26 +977,22 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
public void listChanged(IDockerConnection c, java.util.List<IDockerImage> list) {
final IDockerImage[] finalList = list.toArray(new IDockerImage[0]);
if (c.getName().equals(connection.getName())) {
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- connection.removeImageListener(containerTab);
- ArrayList<String> imageNames = new ArrayList<>();
- displayedImages = new ArrayList<>();
- for (IDockerImage image : finalList) {
- java.util.List<String> tags = image.repoTags();
- if (tags != null) {
- for (String tag : tags) {
- imageNames.add(tag);
- displayedImages.add(image);
- }
+ Display.getDefault().syncExec(() -> {
+ connection.removeImageListener(containerTab);
+ ArrayList<String> imageNames = new ArrayList<>();
+ displayedImages = new ArrayList<>();
+ for (IDockerImage image : finalList) {
+ java.util.List<String> tags = image.repoTags();
+ if (tags != null) {
+ for (String tag : tags) {
+ imageNames.add(tag);
+ displayedImages.add(image);
}
}
- if (!imageCombo.isDisposed())
- imageCombo.setItems(imageNames.toArray(new String[0]));
- connection.addImageListener(containerTab);
}
-
+ if (!imageCombo.isDisposed())
+ imageCombo.setItems(imageNames.toArray(new String[0]));
+ connection.addImageListener(containerTab);
});
}
}
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java
index a86960e804..3b312994f0 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java
@@ -736,24 +736,20 @@ public class ContainerTab extends AbstractLaunchConfigurationTab
setErrorMessage(Messages.ContainerTab_Error_No_Images);
}
if (c.getName().equals(connection.getName())) {
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- connection.removeImageListener(containerTab);
- ArrayList<String> imageNames = new ArrayList<>();
- for (IDockerImage image : finalList) {
- java.util.List<String> tags = image.repoTags();
- if (tags != null) {
- for (String tag : tags) {
- imageNames.add(tag);
- }
+ Display.getDefault().syncExec(() -> {
+ connection.removeImageListener(containerTab);
+ ArrayList<String> imageNames = new ArrayList<>();
+ for (IDockerImage image : finalList) {
+ java.util.List<String> tags = image.repoTags();
+ if (tags != null) {
+ for (String tag : tags) {
+ imageNames.add(tag);
}
}
- if (!imageCombo.isDisposed())
- imageCombo.setItems(imageNames.toArray(new String[0]));
- connection.addImageListener(containerTab);
}
-
+ if (!imageCombo.isDisposed())
+ imageCombo.setItems(imageNames.toArray(new String[0]));
+ connection.addImageListener(containerTab);
});
}
}
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java
index 4372251be5..52354d28c8 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java
@@ -467,15 +467,8 @@ public class LaunchShortcut implements ILaunchShortcut {
}
// issue error message if no connections exist
if (connection == null) {
- Display.getDefault().syncExec(new Runnable() {
-
- @Override
- public void run() {
- MessageDialog.openError(Display.getCurrent().getActiveShell(),
- Messages.LaunchShortcut_Error_Launching, Messages.LaunchShortcut_No_Connections);
- }
-
- });
+ Display.getDefault().syncExec(() -> MessageDialog.openError(Display.getCurrent().getActiveShell(),
+ Messages.LaunchShortcut_Error_Launching, Messages.LaunchShortcut_No_Connections));
return null;
}
@@ -495,15 +488,8 @@ public class LaunchShortcut implements ILaunchShortcut {
// issue error msg if no images exist
if (image == null) {
- Display.getDefault().syncExec(new Runnable() {
-
- @Override
- public void run() {
- MessageDialog.openError(Display.getCurrent().getActiveShell(),
- Messages.LaunchShortcut_Error_Launching, Messages.LaunchShortcut_No_Images);
- }
-
- });
+ Display.getDefault().syncExec(() -> MessageDialog.openError(Display.getCurrent().getActiveShell(),
+ Messages.LaunchShortcut_Error_Launching, Messages.LaunchShortcut_No_Images));
return null;
}
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java
index de8e86e96f..986d441745 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java
@@ -273,24 +273,20 @@ public class NewContainerTargetWizardPage extends WizardPage
setErrorMessage(Messages.NewContainerTargetWizardPage_no_images);
}
if (c.getName().equals(connection.getName())) {
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- connection.removeImageListener(wizardPage);
- ArrayList<String> imageNames = new ArrayList<>();
- for (IDockerImage image : finalList) {
- java.util.List<String> tags = image.repoTags();
- if (tags != null) {
- for (String tag : tags) {
- imageNames.add(tag);
- }
+ Display.getDefault().syncExec(() -> {
+ connection.removeImageListener(wizardPage);
+ ArrayList<String> imageNames = new ArrayList<>();
+ for (IDockerImage image : finalList) {
+ java.util.List<String> tags = image.repoTags();
+ if (tags != null) {
+ for (String tag : tags) {
+ imageNames.add(tag);
}
}
- if (!imageCombo.isDisposed())
- imageCombo.setItems(imageNames.toArray(new String[0]));
- connection.addImageListener(wizardPage);
}
-
+ if (!imageCombo.isDisposed())
+ imageCombo.setItems(imageNames.toArray(new String[0]));
+ connection.addImageListener(wizardPage);
});
}
}

Back to the top