01: // Copyright 2007 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // Unless required by applicable law or agreed to in writing, software
10: // distributed under the License is distributed on an "AS IS" BASIS,
11: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: // See the License for the specific language governing permissions and
13: // limitations under the License.
14:
15: package org.apache.tapestry.integration.app1.pages;
16:
17: import org.apache.tapestry.annotations.OnEvent;
18: import org.apache.tapestry.integration.app1.base.BaseEventHandlerDemo;
19:
20: public class EventHandlerDemo extends BaseEventHandlerDemo {
21: @SuppressWarnings("unused")
22: private void onAction() {
23: addMethodName("child.onAction()");
24: }
25:
26: @SuppressWarnings("unused")
27: private void onAction(String value) {
28: addMethodName("child.onAction(String)");
29: }
30:
31: @SuppressWarnings("unused")
32: private void onActionFromFred() {
33: addMethodName("child.onActionFromFred()");
34: }
35:
36: @SuppressWarnings("unused")
37: private void onActionFromFred(String value) {
38: addMethodName("child.onActionFromFred(String)");
39: }
40:
41: @SuppressWarnings("unused")
42: private void onAnyEventFromFred() {
43: addMethodName("child.onAnyEventFromFred()");
44: }
45:
46: @SuppressWarnings("unused")
47: private void onAnyEventFromFred(String value) {
48: addMethodName("child.onAnyEventFromFred(String)");
49: }
50:
51: @OnEvent(value="action")
52: void eventHandlerZeroChild() {
53: addMethodName("child.eventHandlerZeroChild()");
54: }
55:
56: @OnEvent(value="action")
57: void eventHandlerOneChild(String value) {
58: addMethodName("child.eventHandlerOneChild()");
59: }
60:
61: @OnEvent(component="fred")
62: void eventHandlerForFred() {
63: addMethodName("child.eventHandlerForFred()");
64: }
65:
66: public Object[] getTwoContext() {
67: return new Object[] { 1, 2 };
68: }
69: }
|