Author: adietish
Date: 2010-12-08 13:11:44 -0500 (Wed, 08 Dec 2010)
New Revision: 27247
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
Log:
[JBIDE-7847] corrected instance view listening to selection changes in itself.
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java 2010-12-08
17:48:54 UTC (rev 27246)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java 2010-12-08
18:11:44 UTC (rev 27247)
@@ -49,6 +49,7 @@
import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.deltacloud.ui.ErrorUtils;
import org.jboss.tools.deltacloud.ui.views.CVMessages;
+import org.jboss.tools.deltacloud.ui.views.cloud.DeltaCloudView;
import org.jboss.tools.internal.deltacloud.ui.preferences.TextPreferenceValue;
import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
@@ -87,8 +88,6 @@
return;
}
-// removeListener(currentCloud);
-
AbstractCloudElementTableView.this.currentCloud = getCurrentCloud(index,
getClouds());
if (currentCloud != null) {
lastSelectedCloudPref.store(currentCloud.getName());
@@ -97,7 +96,6 @@
@Override
public void run() {
setViewerInput(currentCloud);
-// addListener(currentCloud);
}
});
}
@@ -108,22 +106,16 @@
@Override
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- DeltaCloud cloud = UIUtils.getFirstAdaptedElement(selection, DeltaCloud.class);
- if (cloud != null) {
- currentCloudSelector.select(getCloudIndex(cloud, getClouds()));
+ if (DeltaCloudView.class.equals(part.getClass())) {
+ // we want to listen to selection changes in the deltacloud view only
+ DeltaCloud cloud = UIUtils.getFirstAdaptedElement(selection, DeltaCloud.class);
+ if (cloud != null) {
+ currentCloudSelector.select(getCloudIndex(cloud, getClouds()));
+ }
}
}
};
-// private Job viewerInputJob = new Job("") {
-//
-// @Override
-// protected IStatus run(IProgressMonitor monitor) {
-//
-// return Status.OK_STATUS;
-// }
-// };
-
public AbstractCloudElementTableView() {
lastSelectedCloudPref = new TextPreferenceValue(getSelectedCloudPrefsKey(),
Activator.getDefault());
}
@@ -181,7 +173,6 @@
currentCloud = getCurrentCloud(currentCloudSelector.getSelectionIndex(), clouds);
-// addListener(currentCloud);
setViewerInput(currentCloud);
setFilterLabelVisible(currentCloud, filterLabel);