Author: adietish
Date: 2010-12-10 11:55:28 -0500 (Fri, 10 Dec 2010)
New Revision: 27369
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
Log:
[JBIDE-7738] made ImageView and InstanceView adaptable, so that RefreshImageHandler and
RefreshInstanceHandler may pick the cloud it shows
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-10
16:53:29 UTC (rev 27368)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java 2010-12-10
16:55:28 UTC (rev 27369)
@@ -10,11 +10,12 @@
*******************************************************************************/
package org.jboss.tools.deltacloud.ui.views.cloudelements;
-import java.util.ArrayList;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
import java.util.List;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.layout.TableColumnLayout;
import org.eclipse.jface.viewers.ColumnWeightData;
@@ -65,7 +66,7 @@
* @author Andre Dietisheim
*/
public abstract class AbstractCloudElementTableView<CLOUDELEMENT extends
IDeltaCloudElement> extends ViewPart implements
- IDeltaCloudManagerListener, PropertyChangeListener {
+ IDeltaCloudManagerListener, PropertyChangeListener, IAdaptable {
private final static String CLOUD_SELECTOR_LABEL = "CloudSelector.label";
//$NON-NLS-1$
@@ -434,4 +435,13 @@
DeltaCloudManager.getDefault().removeCloudManagerListener(this);
super.dispose();
}
+
+ @SuppressWarnings("rawtypes")
+ public Object getAdapter(Class adapter) {
+ if (adapter == DeltaCloud.class) {
+ return currentCloud;
+ } else {
+ return super.getAdapter(adapter);
+ }
+ }
}