1 package pl.caltha.forms.internal.ui.actions;
2
3 import org.xml.sax.Attributes;
4
5 import pl.caltha.forms.ConstructionException;
6 import pl.caltha.forms.internal.ui.Reference;
7 import pl.caltha.forms.internal.ui.ReferenceNode;
8 import pl.caltha.forms.internal.ui.UI;
9
10 /*** Action that has an instance Reference.
11 *
12 * @author <a href="mailto:zwierzem@ngo.pl">Damian Gajda</a>
13 * @version $Id: BaseReferenceAction.java,v 1.1 2005/01/19 06:55:32 pablo Exp $
14 */
15 public abstract class BaseReferenceAction extends pl.caltha.forms.internal.ui.Action
16 implements ReferenceNode
17 {
18 public BaseReferenceAction(String type, Attributes atts) throws ConstructionException
19 {
20 super(type, atts);
21 }
22
23 /*** Used when copying parts of UI tree for repeat nodes processing.
24 * <p>Fields which are deep copied:</p>
25 * <ul>
26 * <li>{@link #ref} - ref is also set a new container Node, see
27 * {@link Reference#clone()}</li>
28 * </ul>
29 */
30 protected Object clone()
31 {
32 BaseReferenceAction next = (BaseReferenceAction)(super.clone());
33
34 next.ref = (Reference)(ref.clone());
35
36 next.ref.setContainerNode(next);
37 return next;
38 }
39
40
41
42 protected Reference ref;
43
44
45
46
47 public Reference getRef()
48 {
49 return ref;
50 }
51
52
53
54
55
56
57 /*** Initialisation for action embeded reference. */
58 protected void init(UI ui)
59 throws ConstructionException
60 {
61 super.init(ui);
62 ref.init(ui);
63 }
64 }