Author: adietish
Date: 2010-12-02 03:59:41 -0500 (Thu, 02 Dec 2010)
New Revision: 27080
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstanceElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java
Log:
[JBIDE-7779] changed label for instances in CloudView
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstanceElement.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstanceElement.java 2010-12-01
23:37:47 UTC (rev 27079)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstanceElement.java 2010-12-02
08:59:41 UTC (rev 27080)
@@ -11,13 +11,25 @@
package org.jboss.tools.deltacloud.ui.views;
import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+/**
+ * @author Jeff Johnston
+ * @author Andre Dietisheim
+ */
public class CVInstanceElement extends CloudViewElement {
- public CVInstanceElement(Object element, String name) {
- super(element, name);
+ public CVInstanceElement(Object element) {
+ super(element, getName((DeltaCloudInstance) element));
}
-
+
+ private static String getName(DeltaCloudInstance instance) {
+ return new StringBuilder(
+ instance.getName())
+ .append("[").append(instance.getId()).append("]")
+ .toString();
+ }
+
@Override
public IPropertySource getPropertySource() {
return new InstancePropertySource(this, getElement());
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java 2010-12-01
23:37:47 UTC (rev 27079)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java 2010-12-02
08:59:41 UTC (rev 27080)
@@ -20,6 +20,9 @@
import org.jboss.tools.deltacloud.core.IInstanceListListener;
import org.jboss.tools.deltacloud.ui.ErrorUtils;
+/**
+ * @author Andre Dietisheim
+ */
public class CVInstancesCategoryElement extends CVCategoryElement implements
IInstanceListListener {
public CVInstancesCategoryElement(Object element, String name, TreeViewer viewer) {
@@ -39,7 +42,7 @@
addChild(f);
for (int i = min; i < max; ++i) {
DeltaCloudInstance d = instances[i];
- CVInstanceElement element = new CVInstanceElement(d, d.getName());
+ CVInstanceElement element = new CVInstanceElement(d);
f.addChild(element);
}
min += CVNumericFoldingElement.FOLDING_SIZE;
@@ -52,14 +55,14 @@
addChild(f);
for (int i = min; i < min + length; ++i) {
DeltaCloudInstance d = instances[i];
- CVInstanceElement element = new CVInstanceElement(d, d.getName());
+ CVInstanceElement element = new CVInstanceElement(d);
f.addChild(element);
}
}
} else {
for (int i = 0; i < instances.length; ++i) {
DeltaCloudInstance d = instances[i];
- CVInstanceElement element = new CVInstanceElement(d, d.getName());
+ CVInstanceElement element = new CVInstanceElement(d);
addChild(element);
}
}