Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Grunberg2015-12-23 17:30:45 +0000
committerRoland Grunberg2016-03-17 01:38:30 +0000
commitff59f4d1aa225eef73176bc0ca5268773b284bd0 (patch)
tree2a4ec5ba2ce520a3a23e53c9d06f20e8533ec873
parent00201e7ae80223adc9a5aebd2cc94e2987f4f9fd (diff)
downloadorg.eclipse.linuxtools-ff59f4d1aa225eef73176bc0ca5268773b284bd0.tar.gz
org.eclipse.linuxtools-ff59f4d1aa225eef73176bc0ca5268773b284bd0.tar.xz
org.eclipse.linuxtools-ff59f4d1aa225eef73176bc0ca5268773b284bd0.zip
Remove unnecessary get/set selection calls from Vagrant 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: If5c96f79ae61a022dcdef680d0dcf065dd543394 Reviewed-on: https://git.eclipse.org/r/63225 Tested-by: Hudson CI Reviewed-by: Roland Grunberg <rgrunber@redhat.com> Reviewed-on: https://git.eclipse.org/r/68576
-rw-r--r--vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/views/VagrantBoxView.java7
-rw-r--r--vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/views/VagrantVMView.java7
2 files changed, 0 insertions, 14 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 c19141ed15..cce11c33c3 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
@@ -209,14 +209,7 @@ public class VagrantBoxView extends ViewPart implements IVagrantBoxListener {
public void listChanged(final IVagrantConnection connection,
final List<IVagrantBox> images) {
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 8af568753b..2ce234bedd 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
@@ -235,14 +235,7 @@ public class VagrantVMView extends ViewPart implements IVagrantVMListener {
public void listChanged(final IVagrantConnection connection,
final List<IVagrantVM> containers) {
Display.getDefault().asyncExec(() -> {
- // remember the current selection before the viewer is refreshed
- final ISelection currentSelection = VagrantVMView.this.viewer
- .getSelection();
VagrantVMView.this.viewer.refresh();
- // restore the selection
- if (currentSelection != null) {
- VagrantVMView.this.viewer.setSelection(currentSelection);
- }
refreshViewTitle();
});
}

Back to the top