diff options
author | Roland Grunberg | 2016-03-04 21:09:53 +0000 |
---|---|---|
committer | Roland Grunberg | 2016-03-17 01:46:46 +0000 |
commit | ce5441e3665db7d44422c07bab2a5562d0d1c378 (patch) | |
tree | 5cf118839b4cbf58b732bea8f1aed6bffc9ba82a | |
parent | 34590544c895599cb2a13a3b37829df0add8c457 (diff) | |
download | org.eclipse.linuxtools-ce5441e3665db7d44422c07bab2a5562d0d1c378.tar.gz org.eclipse.linuxtools-ce5441e3665db7d44422c07bab2a5562d0d1c378.tar.xz org.eclipse.linuxtools-ce5441e3665db7d44422c07bab2a5562d0d1c378.zip |
Revert "Remove unnecessary get/set selection calls from Vagrant views."
This reverts commit d2ebb42a239e3db61b13ea2b5d1df291e729d710.
Change-Id: I58ffdcc2064371afde98a590194f2980dafc81d6
Reviewed-on: https://git.eclipse.org/r/67835
Tested-by: Hudson CI
Reviewed-by: Roland Grunberg <rgrunber@redhat.com>
Reviewed-on: https://git.eclipse.org/r/68578
2 files changed, 14 insertions, 0 deletions
diff --git a/vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/views/VagrantBoxView.java b/vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/views/VagrantBoxView.java index 64a2d60ff9..f0bdd3c172 100644 --- a/vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/views/VagrantBoxView.java +++ b/vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/views/VagrantBoxView.java @@ -210,7 +210,14 @@ public class VagrantBoxView extends ViewPart implements IVagrantBoxListener { final List<IVagrantBox> images) { if (!viewer.getControl().isDisposed()) { Display.getDefault().asyncExec(() -> { + // remember the current selection before the viewer is refreshed + final ISelection currentSelection = VagrantBoxView.this.viewer + .getSelection(); VagrantBoxView.this.viewer.refresh(); + // restore the selection + if (currentSelection != null) { + VagrantBoxView.this.viewer.setSelection(currentSelection); + } refreshViewTitle(); }); } diff --git a/vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/views/VagrantVMView.java b/vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/views/VagrantVMView.java index 8e686ef9bd..91cbc2bab3 100644 --- a/vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/views/VagrantVMView.java +++ b/vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/views/VagrantVMView.java @@ -236,8 +236,15 @@ public class VagrantVMView extends ViewPart implements IVagrantVMListener { final List<IVagrantVM> containers) { if (!viewer.getControl().isDisposed()) { Display.getDefault().asyncExec(() -> { + // remember the current selection before the viewer is refreshed + final ISelection currentSelection = VagrantVMView.this.viewer + .getSelection(); VagrantVMView.this.viewer.refresh(); refreshViewTitle(); + // restore the selection + if (currentSelection != null) { + VagrantVMView.this.viewer.setSelection(currentSelection); + } }); } } |