01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: InterfaceParent.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.engine.testelements.inheritance;
09:
10: import com.uwyn.rife.engine.ElementAware;
11: import com.uwyn.rife.engine.ElementChildTrigger;
12: import com.uwyn.rife.engine.ElementSupport;
13:
14: public class InterfaceParent implements ElementAware {
15: private ElementSupport mElement = null;
16:
17: public void noticeElement(ElementSupport element) {
18: mElement = element;
19: mElement.setChildTrigger(new ElementChildTrigger() {
20: public boolean childTriggered(String name, String[] values) {
21: if (name.equals("trigger") && values[0].equals("ok")) {
22: return true;
23: } else {
24: return false;
25: }
26: }
27: });
28: }
29:
30: public void processElement() {
31: if (mElement.hasSubmission("activatechild")) {
32: mElement.setOutput("trigger", "ok");
33: }
34:
35: mElement.print("<html><body><a href=\""
36: + mElement.getSubmissionQueryUrl("activatechild")
37: + "\">activate child</a></body></html>");
38: }
39: }
|