KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > html > ListenerFixture


1 // Copyright 2005 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// 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.html;
16
17 import org.apache.tapestry.event.PageAttachListener;
18 import org.apache.tapestry.event.PageBeginRenderListener;
19 import org.apache.tapestry.event.PageDetachListener;
20 import org.apache.tapestry.event.PageEndRenderListener;
21 import org.apache.tapestry.event.PageEvent;
22 import org.apache.tapestry.event.PageValidateListener;
23
24 /**
25  * @author Howard M. Lewis Ship
26  */

27 public class ListenerFixture implements PageAttachListener, PageBeginRenderListener,
28         PageDetachListener, PageEndRenderListener, PageValidateListener
29 {
30     private String JavaDoc _method;
31
32     public String JavaDoc getMethod()
33     {
34         return _method;
35     }
36
37     public void reset()
38     {
39         _method = null;
40     }
41
42     public void pageAttached(PageEvent event)
43     {
44         _method = "pageAttached";
45     }
46
47     public void pageBeginRender(PageEvent event)
48     {
49         _method = "pageBeginRender";
50     }
51
52     public void pageDetached(PageEvent event)
53     {
54         _method = "pageDetached";
55     }
56
57     public void pageEndRender(PageEvent event)
58     {
59         _method = "pageEndRender";
60     }
61
62     public void pageValidate(PageEvent event)
63     {
64         _method = "pageValidate";
65     }
66 }
Popular Tags