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.custom.navmenu.jscookmenu;
20
21 import javax.faces.component.UICommand;
22
23 import org.apache.myfaces.component.LocationAware;
24 import org.apache.myfaces.component.UserRoleAware;
25 import org.apache.myfaces.component.UserRoleUtils;
26
27 /**
28 * Renders a Javascript Menu. Nested NavigationMenuItem(s) are rendered
29 * as Javascript Menu.
30 *
31 * <p>
32 * This component is based based on the excellent
33 * <a href="http://jscook.sourceforge.net/JSCookMenu">JSCookMenu</a>
34 * by Heng Yuan.
35 * </p>
36 *
37 * Unless otherwise specified, all attributes accept static values or EL expressions.
38 *
39 * @JSFComponent
40 * name = "t:jscookMenu"
41 * class = "org.apache.myfaces.custom.navmenu.jscookmenu.HtmlCommandJSCookMenu"
42 * tagClass = "org.apache.myfaces.custom.navmenu.jscookmenu.HtmlJSCookMenuTag"
43 *
44 * @JSFJspProperty name = "value" tagExcluded = "true"
45 * @JSFJspProperty name = "actionListener" tagExcluded = "true"
46 * @JSFJspProperty name = "action" tagExcluded = "true"
47 * @since 1.1.7
48 * @author Thomas Spiegl (latest modification by $Author: lu4242 $)
49 * @version $Revision: 691856 $ $Date: 2008-09-03 21:40:30 -0500 (Wed, 03 Sep 2008) $
50 */
51 public abstract class AbstractHtmlCommandJSCookMenu
52 extends UICommand
53 implements UserRoleAware, LocationAware
54 {
55 //private static final Log log = LogFactory.getLog(HtmlCommandJSCookMenu.class);
56
57 public static final String COMPONENT_TYPE = "org.apache.myfaces.JSCookMenu";
58 public static final String COMPONENT_FAMILY = "javax.faces.Command";
59 private static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.JSCookMenu";
60
61 /**
62 * @JSFProperty
63 * required = "true"
64 */
65 public abstract String getLayout();
66
67 /**
68 * @JSFProperty
69 * required = "true"
70 */
71 public abstract String getTheme();
72
73 public boolean isRendered()
74 {
75 if (!UserRoleUtils.isVisibleOnUserRole(this)) return false;
76 return super.isRendered();
77 }
78
79 }