root/org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/tag/handler/MetaActionSourceTagHandler.java

Revision 28612, 1.6 kB (checked in by sfermigier, 8 months ago)

Forward port of [28607], [28609], [28610].

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 /*
2  * (C) Copyright 2007 Nuxeo SAS (http://nuxeo.com/) and contributors.
3  *
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the GNU Lesser General Public License
6  * (LGPL) version 2.1 which accompanies this distribution, and is available at
7  * http://www.gnu.org/licenses/lgpl.html
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * Contributors:
15  *     Nuxeo - initial API and implementation
16  *
17  * $Id$
18  */
19
20 package org.nuxeo.ecm.platform.ui.web.tag.handler;
21
22 import javax.faces.component.ActionSource;
23
24 import org.nuxeo.ecm.platform.ui.web.tag.jsf.MetaActionSourceRule;
25
26 import com.sun.facelets.tag.MetaRuleset;
27 import com.sun.facelets.tag.jsf.ComponentConfig;
28 import com.sun.facelets.tag.jsf.html.HtmlComponentHandler;
29
30 /**
31  * Component tag handler that wires an action source attributes to a
32  * {@link MetaActionSourceRule} set.
33  *
34  * @author <a href="mailto:at@nuxeo.com">Anahide Tchertchian</a>
35  *
36  */
37 public class MetaActionSourceTagHandler extends HtmlComponentHandler {
38
39     public MetaActionSourceTagHandler(ComponentConfig config) {
40         super(config);
41     }
42
43     @Override
44     protected MetaRuleset createMetaRuleset(Class type) {
45         MetaRuleset mr = super.createMetaRuleset(type);
46         if (ActionSource.class.isAssignableFrom(type)) {
47             mr.addRule(MetaActionSourceRule.Instance);
48         }
49         return mr;
50     }
51 }
Note: See TracBrowser for help on using the browser.