01: package nl.hippo.cms.wizard.widgets;
02:
03: import nl.hippo.cms.wizard.Constants;
04: import nl.hippo.cms.wizard.components.Configuration;
05:
06: public class ConstantWidget extends StringWidget {
07:
08: public static final String TYPE = "constant";
09:
10: //@Override
11: public void configure(Configuration config) throws Exception {
12: super .configure(config);
13: String value = config.get(Constants.VALUE_ATTRIBUTE_NAME);
14: if (value == null || value.equals(""))
15: throw new Exception("ConstantWidget[@id='" + getId()
16: + "']/@" + Constants.VALUE_ATTRIBUTE_NAME
17: + " is required and cannot be empty");
18: setValue(value);
19: }
20:
21: //@Override
22: public String getType() {
23: return TYPE;
24: }
25:
26: }
|