| Classes in this File | Line Coverage | Branch Coverage | Complexity | |||||||
| ListCallback |
|
| 1.0;1 |
| 1 | /* |
|
| 2 | * Created on Feb 28, 2005 |
|
| 3 | * |
|
| 4 | * Copyright 2004 Chris Nelson |
|
| 5 | * |
|
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
|
| 7 | * you may not use this file except in compliance with the License. |
|
| 8 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 |
|
| 9 | * Unless required by applicable law or agreed to in writing, |
|
| 10 | * software 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 limitations under the License. |
|
| 13 | */ |
|
| 14 | package org.trails.callback; |
|
| 15 | ||
| 16 | import org.apache.tapestry.IRequestCycle; |
|
| 17 | import org.trails.page.ListPage; |
|
| 18 | ||
| 19 | /** |
|
| 20 | * Returns control to a ListPage |
|
| 21 | * |
|
| 22 | * @author Chris Nelson |
|
| 23 | */ |
|
| 24 | public class ListCallback extends TrailsCallback |
|
| 25 | { |
|
| 26 | ||
| 27 | private Class clazz; |
|
| 28 | ||
| 29 | public ListCallback(String pageName, Class clazz) |
|
| 30 | { |
|
| 31 | 35 | super(pageName); |
| 32 | 35 | this.clazz = clazz; |
| 33 | 35 | } |
| 34 | ||
| 35 | /** |
|
| 36 | * (non-Javadoc)T |
|
| 37 | * |
|
| 38 | * @see org.apache.tapestry.callback.ICallback#performCallback(org.apache.tapestry.IRequestCycle) |
|
| 39 | */ |
|
| 40 | public void performCallback(IRequestCycle cycle) |
|
| 41 | { |
|
| 42 | 4 | ListPage listPage = (ListPage) cycle.getPage(getPageName()); |
| 43 | 4 | preparePageForCycleActivate(listPage); |
| 44 | 4 | cycle.activate(listPage); |
| 45 | 4 | } |
| 46 | ||
| 47 | protected void preparePageForCycleActivate(ListPage listPage) |
|
| 48 | { |
|
| 49 | 4 | listPage.setType(clazz); |
| 50 | // listPage.reloadInstances(); //@todo: mmmm do we really need to reloadtheInstances? |
|
| 51 | 4 | } |
| 52 | } |