Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Grunberg2015-12-23 15:51:13 +0000
committerJeff Johnston2016-01-04 22:57:14 +0000
commit6b2f3dcc35077e6440c6fd90f1599154ea0047e1 (patch)
tree9da12afda88cc9822baeb0cf9b909d8bcc22c07f /containers/org.eclipse.linuxtools.docker.core/src/org/eclipse
parent211e5180f9fc9d7fd922213ff47e49f581bf5776 (diff)
downloadorg.eclipse.linuxtools-6b2f3dcc35077e6440c6fd90f1599154ea0047e1.tar.gz
org.eclipse.linuxtools-6b2f3dcc35077e6440c6fd90f1599154ea0047e1.tar.xz
org.eclipse.linuxtools-6b2f3dcc35077e6440c6fd90f1599154ea0047e1.zip
Bug 481300: Fix various refresh issues in Docker Views.
The get -> refresh -> set logic is not what's responsible for preserving a selection after refreshes occur. The UI already knows how to preserve a selection. As long as the objects given to the content provider override equals() and hasCode(), the selection will be preserved without any intervention. Change-Id: Ib1cd804080f7d44053b4d6806583f610fbdb166b Reviewed-on: https://git.eclipse.org/r/63219 Tested-by: Hudson CI Reviewed-by: Jeff Johnston <jjohnstn@redhat.com> (cherry picked from commit 7b6e6aa274be46e04f3adbc2cd5cb868e76f828a) Reviewed-on: https://git.eclipse.org/r/63511
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/DockerImage.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerImage.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerImage.java
index 47a9233135..d83f964ed5 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerImage.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerImage.java
@@ -186,4 +186,29 @@ public class DockerImage implements IDockerImage {
+ " virtualSize=" + virtualSize() + "\n";
}
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ DockerImage other = (DockerImage) obj;
+ if (id == null) {
+ if (other.id != null)
+ return false;
+ } else if (!id.equals(other.id))
+ return false;
+ return true;
+ }
+
}

Back to the top