01: /*
02: * Created on 23 Sep 2006
03: */
04: package uk.org.ponder.rsf.evolvers.support;
05:
06: import uk.org.ponder.rsf.components.UIInput;
07: import uk.org.ponder.rsf.components.UIJointContainer;
08: import uk.org.ponder.rsf.evolvers.TextInputEvolver;
09:
10: /** A plain implementation of a TextInputEvolver, that will simply upgrade
11: * the supplied UIInput into a Joint named "plainTextEditor:", giving it
12: * the ID "textarea".
13: *
14: * @author Antranig Basman (antranig@caret.cam.ac.uk)
15: */
16:
17: public class PlainTextInputEvolver implements TextInputEvolver {
18: public static final String COMPONENT_ID = "plainTextEditor:";
19:
20: public UIJointContainer evolveTextInput(UIInput toevolve) {
21: UIJointContainer joint = new UIJointContainer(toevolve.parent,
22: toevolve.ID, COMPONENT_ID);
23: toevolve.parent.remove(toevolve);
24: toevolve.ID = SEED_ID;
25: joint.addComponent(toevolve);
26: return joint;
27: }
28: }
|