Author: adietish
Date: 2011-03-24 07:05:50 -0400 (Thu, 24 Mar 2011)
New Revision: 29990
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudResourceAction.java
Log:
[JBIDE-8622] corrected retrieval of available actions for instances
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2011-03-24 11:03:41
UTC (rev 29989)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2011-03-24 11:05:50
UTC (rev 29990)
@@ -1,3 +1,9 @@
+2011-03-24 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/deltacloud/core/DeltaCloudResourceAction.java (getByName):
+ * src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java (getActions):
+ [JBIDE-8622] corrected retrieval of available actions for instances
+
2011-03-16 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
* src/org/jboss/tools/internal/deltacloud/core/observable/ObservablePojo.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java 2011-03-24
11:03:41 UTC (rev 29989)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java 2011-03-24
11:05:50 UTC (rev 29990)
@@ -100,11 +100,14 @@
}
public List<DeltaCloudResourceAction> getActions() {
- List<DeltaCloudResourceAction> actions = new
ArrayList<DeltaCloudResourceAction>();
+ List<DeltaCloudResourceAction> deltaCloudActions = new
ArrayList<DeltaCloudResourceAction>();
for (Action<Instance> action : instance.getActions()) {
- actions.add(DeltaCloudResourceAction.valueOf(action.getName()));
+ DeltaCloudResourceAction deltaCloudAction =
DeltaCloudResourceAction.getByName(action.getName());
+ if (deltaCloudAction != null) {
+ deltaCloudActions.add(deltaCloudAction);
+ }
}
- return actions;
+ return deltaCloudActions;
}
public String getProfileId() {
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudResourceAction.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudResourceAction.java 2011-03-24
11:03:41 UTC (rev 29989)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudResourceAction.java 2011-03-24
11:05:50 UTC (rev 29990)
@@ -34,4 +34,16 @@
return name;
}
+ public static DeltaCloudResourceAction getByName(String name) {
+ DeltaCloudResourceAction action = null;
+ if (name != null) {
+ for (DeltaCloudResourceAction availableAction : values()) {
+ if (name.equalsIgnoreCase(availableAction.name)) {
+ action = availableAction;
+ break;
+ }
+ }
+ }
+ return action;
+ }
}
Show replies by date