Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ListCategories |
|
| 1.0;1 |
1 | /* | |
2 | * Licensed to the Apache Software Foundation (ASF) under one or more | |
3 | * contributor license agreements. See the NOTICE file distributed with | |
4 | * this work for additional information regarding copyright ownership. | |
5 | * The ASF licenses this file to you under the Apache License, Version 2.0 | |
6 | * (the "License"); you may not use this file except in compliance with | |
7 | * the License. You may obtain a copy of the License at | |
8 | * | |
9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
10 | * | |
11 | * Unless required by applicable law or agreed to in writing, software | |
12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
14 | * See the License for the specific language governing permissions and | |
15 | * limitations under the License. | |
16 | */ | |
17 | ||
18 | package org.apache.shale.usecases.lookup; | |
19 | ||
20 | import javax.faces.model.SelectItem; | |
21 | ||
22 | import org.apache.commons.logging.Log; | |
23 | import org.apache.commons.logging.LogFactory; | |
24 | import org.apache.shale.usecases.view.Domains; | |
25 | import org.apache.shale.util.Messages; | |
26 | import org.apache.shale.view.AbstractViewController; | |
27 | ||
28 | /** | |
29 | * <p>ViewController to retrieve the message categories that are | |
30 | * supported by this application.</p> | |
31 | * | |
32 | * $Id: ListCategories.java 464373 2006-10-16 04:21:54Z rahul $ | |
33 | */ | |
34 | 2 | public class ListCategories extends AbstractViewController { |
35 | ||
36 | ||
37 | // -------------------------------------------------------- Static Variables | |
38 | ||
39 | ||
40 | /** | |
41 | * <p>The <code>Log</code> instance for this class.</p> | |
42 | */ | |
43 | 2 | private static final Log log = LogFactory.getLog(ListCategories.class); |
44 | ||
45 | ||
46 | /** | |
47 | * <p>Localized messages for this application.</p> | |
48 | */ | |
49 | 1 | private static Messages messages = |
50 | new Messages("org.apache.shale.usecases.view.Bundle"); | |
51 | ||
52 | ||
53 | // -------------------------------------------------------------- Properties | |
54 | ||
55 | ||
56 | /** | |
57 | * <p>The set of supported message categories for this application.</p> | |
58 | */ | |
59 | 2 | private SelectItem supportedCategories[] = null; |
60 | public SelectItem[] getSupportedCategories() | |
61 | 3 | { return this.supportedCategories; } |
62 | public void setSupportedCategories(SelectItem[] supportedCategories) | |
63 | 3 | { this.supportedCategories = supportedCategories; } |
64 | ||
65 | ||
66 | // -------------------------------------------------- Event Handling Methods | |
67 | ||
68 | ||
69 | // -------------------------------------------------- ViewController Methods | |
70 | ||
71 | ||
72 | /** | |
73 | * <p>If any calculations were required to acquire the data required to | |
74 | * perform this rendering, that logic would go in this method.</p> | |
75 | */ | |
76 | public void prerender() { | |
77 | ||
78 | 2 | setSupportedCategories |
79 | (((Domains) getBean("domains")).getSupportedCategories()); | |
80 | ||
81 | 2 | } |
82 | ||
83 | ||
84 | /** | |
85 | * <p>If any resources were allocated in the <code>prerender()</code> method | |
86 | * that were needed for rendering, and now need to be cleaned up, that | |
87 | * logic would go in this method.</p> | |
88 | */ | |
89 | public void destroy() { | |
90 | ||
91 | 1 | setSupportedCategories(null); |
92 | ||
93 | 1 | } |
94 | ||
95 | ||
96 | } |