KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > facelets > tag > jstl > core > ChooseWhenHandler


1 /**
2  * Licensed under the Common Development and Distribution License,
3  * you may not use this file except in compliance with the License.
4  * You may obtain a copy of the License at
5  *
6  * http://www.sun.com/cddl/
7  *
8  * Unless required by applicable law or agreed to in writing, software
9  * distributed under the License is distributed on an "AS IS" BASIS,
10  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
11  * implied. See the License for the specific language governing
12  * permissions and limitations under the License.
13  */

14
15 package com.sun.facelets.tag.jstl.core;
16
17 import javax.faces.component.UIComponent;
18
19 import com.sun.facelets.tag.TagAttribute;
20 import com.sun.facelets.tag.TagConfig;
21 import java.io.IOException JavaDoc;
22
23 import javax.el.ELException;
24 import javax.faces.FacesException;
25
26 import com.sun.facelets.FaceletContext;
27 import com.sun.facelets.FaceletException;
28 import com.sun.facelets.tag.TagHandler;
29
30 /**
31  * @author Jacob Hookom
32  * @version $Id: ChooseWhenHandler.java,v 1.2 2005/08/24 04:38:51 jhook Exp $
33  */

34 public final class ChooseWhenHandler extends TagHandler {
35
36     private final TagAttribute test;
37     
38     public ChooseWhenHandler(TagConfig config) {
39         super(config);
40         this.test = this.getRequiredAttribute("test");
41     }
42
43     public void apply(FaceletContext ctx, UIComponent parent)
44             throws IOException JavaDoc, FacesException, FaceletException, ELException {
45         this.nextHandler.apply(ctx, parent);
46     }
47     
48     public boolean isTestTrue(FaceletContext ctx) {
49         return this.test.getBoolean(ctx);
50     }
51 }
52
Popular Tags