01: package nl.hippo.cms.wizard.widgets;
02:
03: import nl.hippo.cms.wizard.Constants;
04: import nl.hippo.cms.wizard.components.AbstractComponentContainer;
05: import nl.hippo.cms.wizard.components.Configuration;
06: import nl.hippo.util.NameUtil;
07:
08: public abstract class AbstractContainerWidget extends
09: AbstractComponentContainer implements Widget {
10:
11: //@Override
12: public void configure(Configuration config) throws Exception {
13: super .configure(config);
14: boolean skip = (config.get(Constants.SKIP_ATTRIBUTE_NAME) != null) ? config
15: .get(Constants.SKIP_ATTRIBUTE_NAME).equals("true")
16: : false;
17: boolean lowercase = (config
18: .get(Constants.LOWERCASE_ATTRIBUTE_NAME) != null) ? config
19: .get(Constants.LOWERCASE_ATTRIBUTE_NAME).equals("true")
20: : false;
21: if (skip)
22: skipPath();
23: if (lowercase)
24: lowerCasePath();
25: }
26:
27: //@Override
28: public String getPath() {
29: return getURIValue();
30: }
31:
32: public String getURIValue() {
33: if (getValue() != null) {
34: return new NameUtil().convertToValidName(getValue()
35: .toString());
36: }
37: return "";
38: }
39:
40: public Object getValue() {
41: return getCurrent();
42: }
43:
44: public void setValue(Object object) {
45: setCurrent((String) object);
46: }
47:
48: public void reset() {
49: super .reset();
50: setValue("");
51: }
52: }
|