Author: adietish
Date: 2010-12-10 09:37:03 -0500 (Fri, 10 Dec 2010)
New Revision: 27356
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/InstanceItem.java
Log:
[JBIDE-7856]
* removed DeltaCloudManager#notifyCloudRename and IDeltaCloudManagerListener#RENAME_EVENT.
DeltaCloud now notifies about changes in its properties (images, instances, name), no
manual triggering of change notification needed any more
* switched the observer pattern in DeltaCloud to PropertyChangeSupport, listening to
changes in name, image and instances of the cloud
* updating CloudViewItem in tree if cloud name changes
* updating cloud combo in InstanceView and ImageView if cloud name changes
* now using Generics in the various Items to gain strict typing
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/InstanceItem.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/InstanceItem.java 2010-12-10
14:33:08 UTC (rev 27355)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/InstanceItem.java 2010-12-10
14:37:03 UTC (rev 27356)
@@ -26,17 +26,16 @@
}
public String getName() {
- Object element = getModel();
+ DeltaCloudInstance instance = getModel();
StringBuilder sb = new StringBuilder();
- if (element instanceof DeltaCloudInstance) {
- DeltaCloudInstance instance = (DeltaCloudInstance) element;
+ if (instance != null) {
if (instance.getName() != null) {
sb.append(instance.getName());
}
if (instance.getId() != null) {
sb.append(" [").append(instance.getId()).append("] ");
}
- }
+ }
return sb.toString();
}