Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ActionListenerTag |
|
| 0.0;0 |
1 | /* | |
2 | * Licensed to the Apache Software Foundation (ASF) under one | |
3 | * or more contributor license agreements. See the NOTICE file | |
4 | * distributed with this work for additional information | |
5 | * regarding copyright ownership. The ASF licenses this file | |
6 | * to you under the Apache License, Version 2.0 (the | |
7 | * "License"); you may not use this file except in compliance | |
8 | * with the License. You may obtain a copy of the License at | |
9 | * | |
10 | * http://www.apache.org/licenses/LICENSE-2.0 | |
11 | * | |
12 | * Unless required by applicable law or agreed to in writing, | |
13 | * software distributed under the License is distributed on an | |
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
15 | * KIND, either express or implied. See the License for the | |
16 | * specific language governing permissions and limitations | |
17 | * under the License. | |
18 | */ | |
19 | package org.apache.myfaces.taglib.core; | |
20 | ||
21 | import javax.el.ValueExpression; | |
22 | import javax.faces.component.ActionSource; | |
23 | import javax.faces.event.ActionListener; | |
24 | ||
25 | import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspAttribute; | |
26 | import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspTag; | |
27 | ||
28 | /** | |
29 | * This tag creates an instance of the specified ActionListener, and | |
30 | * associates it with the nearest parent UIComponent. | |
31 | * <p> | |
32 | * Unless otherwise specified, all attributes accept static values | |
33 | * or EL expressions. | |
34 | * </p> | |
35 | * @author Manfred Geiler (latest modification by $Author: lu4242 $) | |
36 | * @version $Revision: 693358 $ $Date: 2008-09-08 22:54:29 -0500 (Mon, 08 Sep 2008) $ | |
37 | */ | |
38 | 0 | @JSFJspTag( |
39 | name="f:actionListener", | |
40 | bodyContent="empty") | |
41 | public class ActionListenerTag | |
42 | extends GenericListenerTag<ActionSource, ActionListener> | |
43 | { | |
44 | private static final long serialVersionUID = -2021978765020549175L; | |
45 | ||
46 | public ActionListenerTag() | |
47 | { | |
48 | 0 | super(ActionSource.class); |
49 | 0 | } |
50 | ||
51 | protected void addListener(ActionSource actionSource, ActionListener actionListener) | |
52 | { | |
53 | 0 | actionSource.addActionListener(actionListener); |
54 | 0 | } |
55 | ||
56 | protected ActionListener createDelegateListener(ValueExpression type, | |
57 | ValueExpression binding) | |
58 | { | |
59 | 0 | return new DelegateActionListener(type,binding); |
60 | } | |
61 | ||
62 | /** | |
63 | * The fully qualified class name of the ActionListener class. | |
64 | */ | |
65 | @JSFJspAttribute( | |
66 | className="java.lang.String", | |
67 | rtexprvalue=true) | |
68 | public void setType(ValueExpression type) | |
69 | { | |
70 | 0 | super.setType(type); |
71 | 0 | } |
72 | ||
73 | /** | |
74 | * Value binding expression that evaluates to an object that | |
75 | * implements javax.faces.event.ActionListener. | |
76 | */ | |
77 | @JSFJspAttribute( | |
78 | className="javax.faces.event.ActionListener", | |
79 | rtexprvalue=true) | |
80 | public void setBinding(ValueExpression binding) | |
81 | { | |
82 | 0 | super.setBinding(binding); |
83 | 0 | } |
84 | } | |
85 | ||
86 |