Author: adietish
Date: 2011-03-24 07:03:41 -0400 (Thu, 24 Mar 2011)
New Revision: 29989
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java
Log:
[JBIDE-8622] corrected retrieval of available actions for instances
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2011-03-24
07:23:15 UTC (rev 29988)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2011-03-24
11:03:41 UTC (rev 29989)
@@ -1,3 +1,10 @@
+2011-03-24 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java
+ (getActions):
+ (Action.getByName):
+ [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:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java 2011-03-24
07:23:15 UTC (rev 29988)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java 2011-03-24
11:03:41 UTC (rev 29989)
@@ -71,6 +71,19 @@
public String getName() {
return name;
}
+
+ public static Action getByName(String name) {
+ Action action = null;
+ if (name != null) {
+ for (Action availableAction : values()) {
+ if (name.equalsIgnoreCase(availableAction.name)) {
+ action = availableAction;
+ break;
+ }
+ }
+ }
+ return action;
+ }
}
private Instance instance;
@@ -117,15 +130,18 @@
public String getKeyId() {
return instance.getKeyId();
}
-
+
public List<Action> getActions() {
List<Action> actions = new ArrayList<Action>();
for (InstanceAction action : instance.getActions()) {
- actions.add(Action.valueOf(action.getName()));
+ Action deltaCloudAction = Action.getByName(action.getName());
+ if (deltaCloudAction != null) {
+ actions.add(deltaCloudAction);
+ }
}
return actions;
}
-
+
public String getProfileId() {
return instance.getProfileId();
}
@@ -165,7 +181,7 @@
public boolean isRunning() {
return instance.isRunning();
}
-
+
protected void setInstance(Instance instance) {
this.instance = instance;
}
Show replies by date