Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Grunberg2016-03-02 22:25:11 +0000
committerJeff Johnston2016-03-17 19:20:57 +0000
commit14619fc70c7cc7d1c8fcf9d3e12d699a6ed657bd (patch)
treecda54bd315e445f02f4405675dad3ba187d72a7d
parente992a681f0d24a165c877a23a3775d0f5e2baee7 (diff)
downloadorg.eclipse.linuxtools-14619fc70c7cc7d1c8fcf9d3e12d699a6ed657bd.tar.gz
org.eclipse.linuxtools-14619fc70c7cc7d1c8fcf9d3e12d699a6ed657bd.tar.xz
org.eclipse.linuxtools-14619fc70c7cc7d1c8fcf9d3e12d699a6ed657bd.zip
Force property testers to run once again after viewers are refreshed.
Even if a selection is preserved, the property testers do not seem to run again (forcing enablement updates). Therefore we need to manually select the proper element. Change-Id: Iff3b92411d8a36f375dcae79c4c769f5624ce0e8 Reviewed-on: https://git.eclipse.org/r/67702 Reviewed-by: Jeff Johnston <jjohnstn@redhat.com> Tested-by: Jeff Johnston <jjohnstn@redhat.com> Tested-by: Hudson CI Reviewed-on: https://git.eclipse.org/r/68703
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerContainersView.java9
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerExplorerView.java11
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImagesView.java10
3 files changed, 29 insertions, 1 deletions
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerContainersView.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerContainersView.java
index 3b39a0fdac..28899d93e9 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerContainersView.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerContainersView.java
@@ -381,7 +381,16 @@ public class DockerContainersView extends ViewPart implements
if (DockerContainersView.this.viewer != null
&& !DockerContainersView.this.viewer.getTable()
.isDisposed()) {
+ // following is to force Container property testers
+ // to run again after list is updated. They won't do so by
+ // default.
+ final ISelection currentSelection = DockerContainersView.this.viewer
+ .getSelection();
DockerContainersView.this.viewer.refresh();
+ // restore the selection
+ if (currentSelection != null) {
+ DockerContainersView.this.viewer.setSelection(currentSelection);
+ }
refreshViewTitle();
}
}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerExplorerView.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerExplorerView.java
index cfdd7b8f36..63704e5b36 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerExplorerView.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerExplorerView.java
@@ -20,6 +20,7 @@ import java.util.Map.Entry;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.viewers.AbstractTreeViewer;
+import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeViewer;
@@ -348,8 +349,16 @@ public class DockerExplorerView extends CommonNavigator implements
@Override
public void run() {
if (getCommonViewer().getTree() != null
- && !getCommonViewer().getTree().isDisposed())
+ && !getCommonViewer().getTree().isDisposed()) {
+ // following is to force Container property testers
+ // to run again after list is updated. They won't do so by
+ // default.
+ final ISelection selection = getCommonViewer().getSelection();
getCommonViewer().refresh(connection, true);
+ if (selection != null) {
+ getCommonViewer().setSelection(selection, false);
+ }
+ }
}
});
}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImagesView.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImagesView.java
index 5950d85671..309146bdfe 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImagesView.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImagesView.java
@@ -375,7 +375,17 @@ public class DockerImagesView extends ViewPart implements IDockerImageListener,
if (DockerImagesView.this.viewer != null
&& !DockerImagesView.this.viewer.getTable()
.isDisposed()) {
+ // following is to force Image property testers
+ // to run again after list is updated. They won't do so by
+ // default.
+ final ISelection currentSelection = DockerImagesView.this.viewer
+ .getSelection();
DockerImagesView.this.viewer.refresh();
+ // restore the selection
+ if (currentSelection != null) {
+ DockerImagesView.this.viewer
+ .setSelection(currentSelection);
+ }
refreshViewTitle();
}
}

Back to the top