1 package org.weda.action.impl;
2
3 import java.util.LinkedHashMap;
4 import java.util.Map;
5 import org.weda.action.ActionDescriptor;
6 import org.weda.action.ActionState;
7
8 /**
9 *
10 * @author tim
11 */
12 public class ActionStateImpl implements ActionState, java.io.Serializable {
13 private final static String DEFAULT_TARGET_FRAME="_self";
14
15 private boolean enabled;
16 private boolean available;
17 private String targetFrame;
18 private ActionDescriptor actionDescriptor;
19 private Map<String, Object> parameterValues =
20 new LinkedHashMap<String, Object>();
21
22 public ActionStateImpl(boolean available, boolean enabled){
23 this.available=available;
24 this.enabled=enabled;
25 }
26
27 public boolean isEnabled() {
28 return enabled;
29 }
30
31 public void setEnabled(boolean enabled) {
32 this.enabled = enabled;
33 }
34
35 public boolean isAvailable() {
36 return available;
37 }
38
39 public void setAvailable(boolean available) {
40 this.available = available;
41 }
42
43 public ActionDescriptor getActionDescriptor() {
44 return actionDescriptor;
45 }
46
47 public void setActionDescriptor(ActionDescriptor actionDescriptor) {
48 this.actionDescriptor = actionDescriptor;
49 }
50
51 public void setParameterValue(String parameterName, Object value) {
52 parameterValues.put(parameterName, value);
53 }
54
55 public Map<String, Object> getParameterValues() {
56 return parameterValues;
57 }
58
59 public String getTargetFrame() {
60 return targetFrame==null ? DEFAULT_TARGET_FRAME : targetFrame;
61 }
62
63 public void setTargetFrame(String targetFrame) {
64 this.targetFrame = targetFrame;
65 }
66
67 }