Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Coulon2016-01-13 09:28:29 +0000
committerXavier Coulon2016-01-19 19:49:57 +0000
commit71f1fb9f372667fabbf0b97237028482a49cf8e1 (patch)
treee2dcfbe41634e71e944213483d1852deee2d717a /containers/org.eclipse.linuxtools.docker.core/src/org/eclipse
parent014be453aac2ed06ac50c0e1126c76338c0f0e18 (diff)
downloadorg.eclipse.linuxtools-71f1fb9f372667fabbf0b97237028482a49cf8e1.tar.gz
org.eclipse.linuxtools-71f1fb9f372667fabbf0b97237028482a49cf8e1.tar.xz
org.eclipse.linuxtools-71f1fb9f372667fabbf0b97237028482a49cf8e1.zip
Bug 485350 - SWTException: Widget is disposed when DockerExplorer view is closed
Renoving listeners when Docker Explorer view is disposed Added SWTBot test to verify that the listeners were actually removed Removed code duplication in test utility classes. Change-Id: Iba939073614d22dd2368a8d13fa13ff0537d9fd1 Signed-off-by: Xavier Coulon <xcoulon@redhat.com> Reviewed-on: https://git.eclipse.org/r/64215 Tested-by: Hudson CI Tested-by: Roland Grunberg <rgrunber@redhat.com> Reviewed-by: Roland Grunberg <rgrunber@redhat.com> Reviewed-on: https://git.eclipse.org/r/64681
Diffstat (limited to 'containers/org.eclipse.linuxtools.docker.core/src/org/eclipse')
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
index e03cdc02de..ed4a5ed51f 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
@@ -18,6 +18,7 @@ import java.nio.ByteBuffer;
import java.nio.channels.WritableByteChannel;
import java.nio.file.FileSystems;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
@@ -379,6 +380,20 @@ public class DockerConnection implements IDockerConnection, Closeable {
}
}
+ /**
+ * @return an fixed-size list of all {@link IDockerContainerListener}
+ */
+ // TODO: include in IDockerConnection API
+ public List<IDockerContainerListener> getContainerListeners() {
+ final IDockerContainerListener[] result = new IDockerContainerListener[this.containerListeners
+ .size()];
+ final Object[] listeners = containerListeners.getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ result[i] = (IDockerContainerListener) listeners[i];
+ }
+ return Arrays.asList(result);
+ }
+
public Job getActionJob(String id) {
synchronized (actionLock) {
Job j = null;
@@ -680,6 +695,20 @@ public class DockerConnection implements IDockerConnection, Closeable {
}
}
+ /**
+ * @return an fixed-size list of all {@link IDockerImageListener}
+ */
+ // TODO: include in IDockerConnection API
+ public List<IDockerImageListener> getImageListeners() {
+ final IDockerImageListener[] result = new IDockerImageListener[this.imageListeners
+ .size()];
+ final Object[] listeners = imageListeners.getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ result[i] = (IDockerImageListener) listeners[i];
+ }
+ return Arrays.asList(result);
+ }
+
@Override
public List<IDockerImage> getImages() {
return getImages(false);

Back to the top