Author: amarkhel
Date: 2010-12-02 04:59:09 -0500 (Thu, 02 Dec 2010)
New Revision: 20287
Added:
sandbox/trunk/ui/dropdown-menu/
sandbox/trunk/ui/dropdown-menu/pom.xml
sandbox/trunk/ui/dropdown-menu/ui/
sandbox/trunk/ui/dropdown-menu/ui/pom.xml
sandbox/trunk/ui/dropdown-menu/ui/src/
sandbox/trunk/ui/dropdown-menu/ui/src/main/
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/AbstractDropDownMenu.java
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/AbstractMenuItem.java
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/AbstractMenuSeparator.java
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/MenuComponent.java
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/package-info.java
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/MenuSeparatorRendererBase.java
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/images/
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/images/MenuNodeImage.java
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/resources/
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/resources/org.richfaces/
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/richfaces/
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties
sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/
sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/dropdownmenu.template.xml
sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menugroup.template.xml
sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menuitem.template.xml
sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menuseparator.template.xml
Log:
RF-9676 : Dropdown menu component
Added: sandbox/trunk/ui/dropdown-menu/pom.xml
===================================================================
--- sandbox/trunk/ui/dropdown-menu/pom.xml (rev 0)
+++ sandbox/trunk/ui/dropdown-menu/pom.xml 2010-12-02 09:59:09 UTC (rev 20287)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of
+ individual contributors. This is free software; you can
+ redistribute it and/or modify it under the terms of the GNU
+ Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your
+ option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without
+ even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St,
+ Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
+
http://www.fsf.org.
+-->
+
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-root-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../../parent/pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.richfaces.ui.output</groupId>
+ <artifactId>richfaces-ui-output-aggregator</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>Richfaces UI Components: Output Aggregator</name>
+
+ <modules>
+ <module>ui</module>
+ </modules>
+
+ <scm>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/o...
+
<
developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trun...
+ <
url>http://fisheye.jboss.org/browse/richfaces</url>
+ </scm>
+</project>
\ No newline at end of file
Added: sandbox/trunk/ui/dropdown-menu/ui/pom.xml
===================================================================
--- sandbox/trunk/ui/dropdown-menu/ui/pom.xml (rev 0)
+++ sandbox/trunk/ui/dropdown-menu/ui/pom.xml 2010-12-02 09:59:09 UTC (rev 20287)
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of
+ individual contributors. This is free software; you can
+ redistribute it and/or modify it under the terms of the GNU
+ Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your
+ option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without
+ even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St,
+ Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
+
http://www.fsf.org.
+-->
+
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../../parent/pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.richfaces.ui.output</groupId>
+ <artifactId>richfaces-ui-output-ui</artifactId>
+ <name>Richfaces UI Components: Output </name>
+ <packaging>jar</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+
<suppressionsLocation>${project.basedir}/richfaces-suppressions.xml</suppressionsLocation>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.common</groupId>
+ <artifactId>richfaces-ui-common-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.core</groupId>
+ <artifactId>richfaces-ui-core-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.output</groupId>
+ <artifactId>richfaces-ui-output-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>xmlunit</groupId>
+ <artifactId>xmlunit</artifactId>
+ <version>1.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <scm>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/o...
+
<
developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trun...
+ <
url>http://fisheye.jboss.org/browse/richfaces</url>
+ </scm>
+
+</project>
\ No newline at end of file
Added:
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/AbstractDropDownMenu.java
===================================================================
---
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/AbstractDropDownMenu.java
(rev 0)
+++
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/AbstractDropDownMenu.java 2010-12-02
09:59:09 UTC (rev 20287)
@@ -0,0 +1,63 @@
+package org.richfaces.component;
+
+import javax.faces.component.UIComponentBase;
+
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.renderkit.html.DropDownMenuRendererBase;
+
+@JsfComponent(family = AbstractDropDownMenu.COMPONENT_FAMILY, type =
AbstractDropDownMenu.COMPONENT_TYPE,
+ renderer=@JsfRenderer(type = DropDownMenuRendererBase.RENDERER_TYPE),
+ tag = @Tag(name="dropDownMenu"),
+ attributes = {"events-props.xml", "core-props.xml",
"i18n-props.xml"})
+public abstract class AbstractDropDownMenu extends UIComponentBase
+ implements MenuComponent {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.DropDownMenu";
+
+ public static final String COMPONENT_FAMILY =
"org.richfaces.DropDownMenu";
+
+ @Attribute
+ public abstract String getShowEvent();
+
+ @Attribute
+ public abstract String getMode();
+
+ @Attribute
+ public abstract boolean isDisabled();
+
+ @Attribute(defaultValue = "800")
+ public abstract int getHideDelay();
+
+ @Attribute(defaultValue = "800")
+ public abstract int getShowDelay();
+
+ @Attribute(events = @EventName("groupshow"))
+ public abstract String getOngroupshow();
+
+ @Attribute(events = @EventName("grouphide"))
+ public abstract String getOngrouphide();
+
+ @Attribute(events = @EventName("show"))
+ public abstract String getOnshow();
+
+ @Attribute(events = @EventName("hide"))
+ public abstract String getOnhide();
+
+ public enum Facets {
+ LABEL("label"), LABEL_DISABLED("labelDisabled");
+
+ private String facetName;
+ private Facets(String name) {
+ this.facetName = name;
+ }
+
+ @Override
+ public String toString() {
+ return facetName;
+ }
+ }
+}
Added:
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java
===================================================================
---
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java
(rev 0)
+++
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java 2010-12-02
09:59:09 UTC (rev 20287)
@@ -0,0 +1,66 @@
+package org.richfaces.component;
+
+import javax.faces.component.UIOutput;
+
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.renderkit.html.MenuGroupRendererBase;
+
+@JsfComponent(family = AbstractDropDownMenu.COMPONENT_FAMILY, type =
AbstractMenuGroup.COMPONENT_TYPE,
+ renderer=@JsfRenderer(type = MenuGroupRendererBase.RENDERER_TYPE),
+ tag = @Tag(name="menuGroup"),
+ attributes = {"events-props.xml", "core-props.xml",
"i18n-props.xml"})
+public abstract class AbstractMenuGroup extends UIOutput {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.MenuGroup";
+
+ @Attribute
+ public abstract boolean isDisabled();
+
+ @Attribute
+ public abstract String getIcon();
+
+ @Attribute
+ public abstract String getIconDisabled();
+
+ @Attribute
+ public abstract String getIconFolder();
+
+ @Attribute
+ public abstract String getIconFolderDisabled();
+
+ @Attribute
+ public abstract String getStyleClass();
+
+ @Attribute
+ public abstract String getStyle();
+
+ @Attribute(defaultValue = "0")
+ public abstract int getVerticalOffset();
+
+ @Attribute(defaultValue = "0")
+ public abstract int getHorizontalOffset();
+
+ @Attribute(events = @EventName("show"))
+ public abstract String getOnshow();
+
+ @Attribute(events = @EventName("hide"))
+ public abstract String getOnhide();
+
+ public enum Facets {
+ ICON("icon"), ICON_DISABLED("iconDisabled");
+
+ private String facetName;
+ private Facets(String name) {
+ this.facetName = name;
+ }
+
+ @Override
+ public String toString() {
+ return facetName;
+ }
+ }
+}
Added:
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/AbstractMenuItem.java
===================================================================
---
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/AbstractMenuItem.java
(rev 0)
+++
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/AbstractMenuItem.java 2010-12-02
09:59:09 UTC (rev 20287)
@@ -0,0 +1,55 @@
+package org.richfaces.component;
+
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.renderkit.html.MenuItemRendererBase;
+
+@JsfComponent(
+ family = AbstractDropDownMenu.COMPONENT_FAMILY,
+ type = AbstractMenuItem.COMPONENT_TYPE,
+ renderer=@JsfRenderer(type = MenuItemRendererBase.RENDERER_TYPE),
+ tag = @Tag(name="menuItem"),
+ attributes = {"events-props.xml", "core-props.xml",
"i18n-props.xml"})
+public abstract class AbstractMenuItem extends AbstractActionComponent
+ implements MenuComponent {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.MenuItem";
+
+ @Attribute
+ public abstract String getMode();
+
+ @Attribute
+ public abstract Object getLabel();
+
+ @Attribute
+ public abstract String getIcon();
+
+ @Attribute
+ public abstract String getIconDisabled();
+
+ @Attribute
+ public abstract boolean isDisabled();
+
+ @Attribute
+ public abstract String getStyleClass();
+
+ @Attribute
+ public abstract String getStyle();
+
+ public enum Facets {
+ ICON("icon"), ICON_DISABLED("iconDisabled");
+
+ private String facetName;
+ private Facets(String name) {
+ this.facetName = name;
+ }
+
+ @Override
+ public String toString() {
+ return facetName;
+ }
+ }
+
+}
Added:
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/AbstractMenuSeparator.java
===================================================================
---
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/AbstractMenuSeparator.java
(rev 0)
+++
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/AbstractMenuSeparator.java 2010-12-02
09:59:09 UTC (rev 20287)
@@ -0,0 +1,15 @@
+package org.richfaces.component;
+
+import javax.faces.component.UIComponentBase;
+
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.renderkit.html.MenuSeparatorRendererBase;
+
+@JsfComponent(family = AbstractDropDownMenu.COMPONENT_FAMILY, type =
AbstractMenuSeparator.COMPONENT_TYPE,
+ renderer=@JsfRenderer(type = MenuSeparatorRendererBase.RENDERER_TYPE), tag =
@Tag(name="menuSeparator"))
+public abstract class AbstractMenuSeparator extends UIComponentBase {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.MenuSeparator";
+}
Added:
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/MenuComponent.java
===================================================================
---
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/MenuComponent.java
(rev 0)
+++
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/MenuComponent.java 2010-12-02
09:59:09 UTC (rev 20287)
@@ -0,0 +1,44 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.component;
+
+
+/**
+ * Interface which main menu must implements in order to menu components could works
correctly.
+ * @author F. Antonov
+ *
+ */
+public interface MenuComponent {
+
+ /**
+ * Possible values for submit mode property.
+ */
+ public static final String MODE_AJAX = "ajax";
+ public static final String MODE_SERVER = "server";
+ public static final String MODE_CLIENT = "client";
+
+ /**
+ * Getter for submit mode property.
+ */
+ public String getMode();
+ public void setMode(String mode);
+}
Added:
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/package-info.java
===================================================================
---
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/package-info.java
(rev 0)
+++
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/component/package-info.java 2010-12-02
09:59:09 UTC (rev 20287)
@@ -0,0 +1,23 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+@org.richfaces.cdk.annotations.TagLibrary(uri="http://richfaces.org/dropDownMenu",
shortName="dropDownMenu")
+package org.richfaces.component;
Added:
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
===================================================================
---
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
(rev 0)
+++
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2010-12-02
09:59:09 UTC (rev 20287)
@@ -0,0 +1,101 @@
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.component.AbstractDropDownMenu;
+import org.richfaces.component.AbstractMenuGroup;
+import org.richfaces.component.AbstractMenuItem;
+import org.richfaces.component.AbstractMenuSeparator;
+import org.richfaces.renderkit.RenderKitUtils;
+import org.richfaces.renderkit.RenderKitUtils.ScriptHashVariableWrapper;
+import org.richfaces.renderkit.RendererBase;
+
+@ResourceDependencies({
+ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(name = "jquery.position.js"),
+ @ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(name = "richfaces-base-component.js"),
+ @ResourceDependency(name = "richfaces-event.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"popup.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"dropdownmenu.ecss", target="head"),
+ @ResourceDependency(library = "org.richfaces", name =
"menu.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"popupList.js")})
+public abstract class DropDownMenuRendererBase extends RendererBase {
+
+ public static final String RENDERER_TYPE =
"org.richfaces.DropDownMenuRenderer";
+
+ @Override
+ public void encodeChildren(FacesContext facesContext, UIComponent component) throws
IOException {
+ AbstractDropDownMenu dropDownMenu = (AbstractDropDownMenu) component;
+
+ for (UIComponent child : dropDownMenu.getChildren()) {
+ if (child.isRendered() && (
+ child instanceof AbstractMenuGroup ||
+ child instanceof AbstractMenuItem ||
+ child instanceof AbstractMenuSeparator)) {
+
+ child.encodeAll(facesContext);
+ }
+ }
+ }
+
+ protected boolean isDisabled(UIComponent component) {
+ if (component instanceof AbstractDropDownMenu) {
+ return ((AbstractDropDownMenu) component).isDisabled();
+ }
+ return false;
+ }
+
+ protected UIComponent getLabelFacet(UIComponent component) {
+ UIComponent facet = null;
+ AbstractDropDownMenu ddmenu = (AbstractDropDownMenu) component;
+ if (ddmenu != null) {
+
+ if (ddmenu.isDisabled()) {
+ facet =
ddmenu.getFacet(AbstractDropDownMenu.Facets.LABEL_DISABLED.toString());
+ } else {
+ facet = ddmenu.getFacet(AbstractDropDownMenu.Facets.LABEL.toString());
+ }
+ }
+ return facet;
+ }
+
+ public List<Map<String, Object>> getMenuGroups(FacesContext facesContext,
UIComponent component) {
+ List<Map<String, Object>> results = new ArrayList<Map<String,
Object>>();
+ List<AbstractMenuGroup> groups = new ArrayList<AbstractMenuGroup>();
+ getMenuGroups(component, groups);
+ for (AbstractMenuGroup group : groups) {
+ if (group.isRendered() && !group.isDisabled()) {
+ Map<String, Object> map = new HashMap<String, Object>();
+ map.put("id", group.getClientId());
+ map.put("horizontalOffset", group.getHorizontalOffset());
+ map.put("verticalOffset", group.getVerticalOffset());
+ RenderKitUtils.addToScriptHash(map, "onhide",
group.getOnhide(), null, ScriptHashVariableWrapper.eventHandler);
+ RenderKitUtils.addToScriptHash(map, "onshow",
group.getOnshow(), null, ScriptHashVariableWrapper.eventHandler);
+ results.add(map);
+ }
+ }
+ return results;
+ }
+
+ private void getMenuGroups(UIComponent component, List<AbstractMenuGroup> list)
{
+ if (component != null && list != null) {
+ for (UIComponent c : component.getChildren()) {
+ if (c instanceof AbstractMenuGroup) {
+ list.add((AbstractMenuGroup) c);
+ }
+ getMenuGroups(c, list);
+ }
+ }
+ }
+}
Added:
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java
===================================================================
---
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java
(rev 0)
+++
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java 2010-12-02
09:59:09 UTC (rev 20287)
@@ -0,0 +1,89 @@
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.component.AbstractDropDownMenu;
+import org.richfaces.component.AbstractMenuGroup;
+import org.richfaces.renderkit.RendererBase;
+
+public abstract class MenuGroupRendererBase extends RendererBase {
+
+ public static final String RENDERER_TYPE =
"org.richfaces.MenuGroupRenderer";
+
+ @Override
+ public void encodeChildren(FacesContext facesContext, UIComponent component) throws
IOException {
+
+ }
+
+ protected boolean isDisabled(UIComponent component) {
+ if (component instanceof AbstractMenuGroup) {
+ return ((AbstractMenuGroup) component).isDisabled();
+ }
+ return false;
+ }
+
+ @Override
+ public void renderChildren(FacesContext facesContext, UIComponent component) throws
IOException {
+ AbstractMenuGroup menuGroup = (AbstractMenuGroup) component;
+
+ for (UIComponent child : menuGroup.getChildren()) {
+ if (child.isRendered()) {
+ child.encodeAll(facesContext);
+ }
+ }
+ }
+
+ protected UIComponent getIconFacet(UIComponent component) {
+ UIComponent facet = null;
+ AbstractMenuGroup menuGroup = (AbstractMenuGroup) component;
+ if (menuGroup != null) {
+
+ if (menuGroup.isDisabled()) {
+ facet =
menuGroup.getFacet(AbstractMenuGroup.Facets.ICON_DISABLED.toString());
+ } else {
+ facet = menuGroup.getFacet(AbstractMenuGroup.Facets.ICON.toString());
+ }
+ }
+ return facet;
+ }
+
+ protected String getIconAttribute(UIComponent component) {
+ String icon = null;
+ AbstractMenuGroup menuGroup = (AbstractMenuGroup) component;
+ if (menuGroup != null) {
+
+ if (menuGroup.isDisabled()) {
+ icon = menuGroup.getIconDisabled();
+ } else {
+ icon = menuGroup.getIcon();
+ }
+ }
+ return icon;
+ }
+
+ protected String getStyleClass(UIComponent component, String styleDDMenu, String
styleMenuGroup) {
+ UIComponent ddMenu = getDDMenu(component);
+ String styleClass = "";
+ if (ddMenu != null) {
+ if (ddMenu.getAttributes().get(styleDDMenu) != null) {
+ styleClass = ddMenu.getAttributes().get(styleDDMenu).toString();
+ }
+ }
+
+ return concatClasses(styleClass, component.getAttributes().get(styleMenuGroup));
+ }
+
+ protected UIComponent getDDMenu(UIComponent component) {
+ UIComponent parent = component.getParent();
+ while (parent != null) {
+ if (parent instanceof AbstractDropDownMenu) {
+ return parent;
+ }
+ parent = parent.getParent();
+ }
+ return null;
+ }
+}
Added:
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
===================================================================
---
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
(rev 0)
+++
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2010-12-02
09:59:09 UTC (rev 20287)
@@ -0,0 +1,130 @@
+package org.richfaces.renderkit.html;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.component.AbstractDropDownMenu;
+import org.richfaces.component.AbstractMenuGroup;
+import org.richfaces.component.AbstractMenuItem;
+import org.richfaces.component.MenuComponent;
+import org.richfaces.renderkit.AjaxCommandRendererBase;
+
+public class MenuItemRendererBase extends AjaxCommandRendererBase {
+
+ public static final String RENDERER_TYPE =
"org.richfaces.MenuItemRenderer";
+
+ protected boolean isDisabled(UIComponent component) {
+ if (component instanceof AbstractMenuItem) {
+ return ((AbstractMenuItem) component).isDisabled();
+ }
+ return false;
+ }
+
+ protected UIComponent getIconFacet(UIComponent component) {
+ UIComponent facet = null;
+ AbstractMenuItem menuItem = (AbstractMenuItem) component;
+ if (menuItem != null) {
+
+ if (menuItem.isDisabled()) {
+ facet =
menuItem.getFacet(AbstractMenuItem.Facets.ICON_DISABLED.toString());
+ } else {
+ facet = menuItem.getFacet(AbstractMenuItem.Facets.ICON.toString());
+ }
+ }
+ return facet;
+ }
+
+ protected String getIconAttribute(UIComponent component) {
+ String icon = null;
+ AbstractMenuItem menuItem = (AbstractMenuItem) component;
+ if (menuItem != null) {
+
+ if (menuItem.isDisabled()) {
+ icon = menuItem.getIconDisabled();
+ } else {
+ icon = menuItem.getIcon();
+ }
+ }
+ return icon;
+ }
+
+ @Override
+ public void doDecode(FacesContext context, UIComponent component) {
+ AbstractMenuItem menuItem = (AbstractMenuItem) component;
+
+ if (menuItem != null) {
+ String mode = resolveSubmitMode(menuItem);
+ if (!MenuComponent.MODE_CLIENT.equalsIgnoreCase(mode)) {
+ super.doDecode(context, component);
+ }
+ }
+ }
+
+ protected String getOnClickFunction(UIComponent component) {
+ AbstractMenuItem menuItem = (AbstractMenuItem) component;
+ String subminMode = resolveSubmitMode(menuItem);
+ if (subminMode == null || MenuComponent.MODE_SERVER.equalsIgnoreCase(subminMode))
{
+ return "submit()";
+ } else if (MenuComponent.MODE_AJAX.equalsIgnoreCase(subminMode)) {
+ return getOnClick(FacesContext.getCurrentInstance(), menuItem);
+ } else if (menuItem.isDisabled()) {
+ return "";
+ } else if (MenuComponent.MODE_CLIENT.equalsIgnoreCase(subminMode)) {
+ return "";
+ }
+
+ return "";
+ }
+
+ protected String resolveSubmitMode(AbstractMenuItem menuItem) {
+ String submitMode = menuItem.getMode();
+ if (null != submitMode) {
+ return submitMode;
+ }
+ UIComponent parent = menuItem.getParent();
+ while (null != parent) {
+ if (parent instanceof MenuComponent) {
+ return ((MenuComponent) parent).getMode();
+ }
+ parent = parent.getParent();
+ }
+
+ return MenuComponent.MODE_SERVER;
+ }
+
+ protected String getStyleClass(UIComponent component, String ddMenuStyle, String
menuGroupStyle, String menuItemStyle) {
+ UIComponent ddMenu = getDDMenu(component);
+ UIComponent menuGroup = getMenuGroup(component);
+ Object styleClass = null;
+ if (ddMenu != null && ddMenuStyle != null && ddMenuStyle.length()
> 0) {
+ styleClass = ddMenu.getAttributes().get(ddMenuStyle);
+ }
+ if (menuGroup != null && menuGroupStyle != null &&
menuGroupStyle.length() > 0) {
+ styleClass = concatClasses(styleClass,
menuGroup.getAttributes().get(menuGroupStyle));
+ }
+
+ return concatClasses(styleClass, component.getAttributes().get(menuItemStyle));
+ }
+
+ protected UIComponent getDDMenu(UIComponent component) {
+ UIComponent parent = component.getParent();
+ while (parent != null) {
+ if (parent instanceof AbstractDropDownMenu) {
+ return parent;
+ }
+ parent = parent.getParent();
+ }
+ return null;
+ }
+
+ protected UIComponent getMenuGroup(UIComponent component) {
+ UIComponent parent = component.getParent();
+ while (parent != null) {
+ if (parent instanceof AbstractMenuGroup) {
+ return parent;
+ }
+ parent = parent.getParent();
+ }
+ return null;
+ }
+}
Added:
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/MenuSeparatorRendererBase.java
===================================================================
---
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/MenuSeparatorRendererBase.java
(rev 0)
+++
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/MenuSeparatorRendererBase.java 2010-12-02
09:59:09 UTC (rev 20287)
@@ -0,0 +1,10 @@
+package org.richfaces.renderkit.html;
+
+import org.richfaces.renderkit.RendererBase;
+
+
+public class MenuSeparatorRendererBase extends RendererBase {
+
+ public static final String RENDERER_TYPE =
"org.richfaces.MenuSeparatorRenderer";
+
+}
Added:
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/images/MenuNodeImage.java
===================================================================
---
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/images/MenuNodeImage.java
(rev 0)
+++
sandbox/trunk/ui/dropdown-menu/ui/src/main/java/org/richfaces/renderkit/html/images/MenuNodeImage.java 2010-12-02
09:59:09 UTC (rev 20287)
@@ -0,0 +1,129 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.renderkit.html.images;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Date;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+import org.richfaces.resource.DynamicUserResource;
+import org.richfaces.resource.ImageType;
+import org.richfaces.resource.Java2DUserResource;
+import org.richfaces.resource.PostConstructResource;
+import org.richfaces.resource.StateHolderResource;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
+
+@DynamicUserResource
+public class MenuNodeImage implements Java2DUserResource, StateHolderResource {
+
+ private static final Dimension DIMENSIONS = new Dimension(7, 14);
+
+ private Integer disabledColor;
+ private Integer generalColor;
+
+ public Integer getDisabledColor() {
+ return disabledColor;
+ }
+
+ public void setDisabledColor(Integer disabledColor) {
+ this.disabledColor = disabledColor;
+ }
+
+ public Integer getGeneralColor() {
+ return generalColor;
+ }
+
+ public void setGeneralColor(Integer generalColor) {
+ this.generalColor = generalColor;
+ }
+
+ public boolean isTransient() {
+ return false;
+ }
+
+ public void writeState(FacesContext context, DataOutput dataOutput) throws
IOException {
+ dataOutput.writeInt(disabledColor);
+ dataOutput.writeInt(generalColor);
+ }
+ public void readState(FacesContext context, DataInput dataInput) throws IOException
{
+ this.disabledColor = dataInput.readInt();
+ this.generalColor = dataInput.readInt();
+ }
+ public Map<String, String> getResponseHeaders() {
+ return null;
+ }
+ public Date getLastModified() {
+ return null;
+ }
+ public ImageType getImageType() {
+ return ImageType.GIF;
+ }
+ public Dimension getDimension() {
+ return DIMENSIONS;
+ }
+ public void paint(Graphics2D g2d) {
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
+
+ g2d.setColor(new Color(getGeneralColor().intValue()));
+ drawTriangle(g2d, 2, 0);
+
+ g2d.setColor(new Color(getDisabledColor().intValue()));
+ drawTriangle(g2d, 2, DIMENSIONS.height / 2);
+ }
+
+ private void drawTriangle(Graphics2D g2d, int startPosX, int startPosY) {
+ int dTriangle = 6;
+ for (int i = 0; i < 4; i++) {
+ g2d.drawLine(startPosX + i, startPosY + i, startPosX + i, startPosY +
dTriangle - i);
+ }
+ }
+
+ @PostConstructResource
+ public final void initialize() {
+ FacesContext context = FacesContext.getCurrentInstance();
+ Skin skin = SkinFactory.getInstance(context).getSkin(context);
+ Skin defaultSkin = SkinFactory.getInstance(context).getDefaultSkin(context);
+
+ String skinParameter = "generalTextColor";
+ String tmp = (String) skin.getParameter(context, skinParameter);
+ if (null == tmp || "".equals(tmp)) {
+ tmp = (String) defaultSkin.getParameter(context, skinParameter);
+ }
+
+ this.setGeneralColor(Color.decode(tmp == null ? "#4A75B5" :
tmp).getRGB());
+
+ skinParameter = "tabDisabledTextColor";
+ tmp = (String) skin.getParameter(context, skinParameter);
+ if (null == tmp || "".equals(tmp)) {
+ tmp = (String) defaultSkin.getParameter(context, skinParameter);
+ }
+ this.setDisabledColor(Color.decode(tmp == null ? "#6A92CF" :
tmp).getRGB());
+ }
+}
Added:
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss
===================================================================
---
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss
(rev 0)
+++
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss 2010-12-02
09:59:09 UTC (rev 20287)
@@ -0,0 +1,107 @@
+.rf-ddm-lbl, .rf-ddm-lbl-dis {
+ font-family:Arial, Verdana, sans-serif;
+ font-size:11px;
+ position:relative;
+}
+.rf-ddm-lbl-unsel {
+ border:0 solid transparent;
+ padding:3px 6px;
+}
+.rf-ddm-lbl, .rf-ddm-lbl-dis {
+ height:auto;
+ padding:2px 5px;
+ white-space:nowrap;
+ width:auto;
+}
+.rf-ddm-pos{
+ top:20px;
+ left:0;
+ position:absolute;
+}
+.rf-ddm-lbl-dec {
+ font-weight:bold;
+}
+.rf-ddm-lst {
+ border:1px solid; /*#bfbfc0*/ /*panelBorderColor*/
+ border-color: '#{richSkin.panelBorderColor}';
+ background-color: '#{richSkin.additionalBackgroundColor}'; /*#e7f2fb;/
/*additionalBackgroundColor*/
+ min-width:250px;
+ position:absolute;
+}
+.rf-ddm-sublst {
+ position:absolute;
+ top:-8px;
+ left:13px;
+}
+.rf-ddm-lst-bg {
+ border: 1px solid; /* #e7f2fb;*/ /*additionalBackgroundColor*/
+ border-color: '#{richSkin.additionalBackgroundColor}';
+ background-repeat: repeat-y;
+ background-position: left;
+ background-image:
"url(#{resource['org.richfaces.images:menu_list_bg.gif']})"; /*from
additionalBackgroundColor (left) to tabBackgroundColor (right)*/
+}
+
+.rf-ddm-itm {
+ padding : 1px 35px 1px 1px;
+ white-space : nowrap;
+ font-family : '#{richSkin.generalFamilyFont}'; /*verdana;*/
/*generalFamilyFont*/
+ font-size : '#{richSkin.generalSizeFont}'; /*12px;*/ /*generalSizeFont*/
+ position : relative;
+}
+.rf-ddm-itm-unsel {
+ border : 1px solid transparent;
+ padding : 1px 36px 2px 2px;
+}
+.rf-ddm-itm-sel {
+ border : 1px solid; /* #4a70ab;*/ /*headerBackgroundColor*/
+ border-color: '#{richSkin.headerBackgroundColor}';
+ cursor : pointer;
+ padding : 1px 36px 2px 2px;
+ background-color: '#{richSkin.tabBackgroundColor}';
+ background-repeat: repeat-x;
+ background-position: top;
+ background-image:
"url(#{resource['org.richfaces.images:menu_item_bg.gif']})";
+ z-index:10;
+}
+.rf-ddm-itm-dis {
+ border : 1px solid transparent;
+ cursor : default;
+ color : '#{richSkin.tabDisabledTextColor}'; /*#839eca;*/
/*tabDisabledTextColor*/
+}
+.rf-ddm-itm-ic {
+ display:inline-block;
+ margin: 0 10px 0 0;
+ vertical-align:middle;
+}
+.rf-ddm-itm-lbl {
+ color : '#{richSkin.generalTextColor}'; /*#000000;*/ /*generalTextColor*/
+ display:inline-block;
+ text-decoration : none;
+ z-index:2;
+}
+.rf-ddm-sep {
+ font-size : 0px;
+ border-top: 1px solid; /* #bfbfc0;*/ /*panelBorderColor*/
+ border-top-color: '#{richSkin.panelBorderColor}';
+ margin : 2px 0px 2px 24px;
+}
+.rf-ddm-nd {
+ background-image:
"url(#{resource['org.richfaces.renderkit.html.images.MenuNodeImage']})";
+ background-repeat: no-repeat;
+ background-position: top;
+ font-size: 1px;
+ width: 7px;
+ height: 7px;
+ top: 7px;
+ right: 6px;
+ position : absolute;
+}
+.rf-ddm-itm-dis .rf-ddm-nd {
+ background-position : bottom;
+}
+
+.rf-ddm-emptyIcon {
+ width: 16px;
+ height: 16px;
+ line-height: 16px;
+}
Added:
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js
===================================================================
---
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js
(rev 0)
+++
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js 2010-12-02
09:59:09 UTC (rev 20287)
@@ -0,0 +1,214 @@
+(function($, rf) {
+ rf.ui = rf.ui || {};
+ var defaultPopupListOptions = {
+ showEvent: 'mouseover',
+ attachToBody: false,
+ positionOffset: [0, 0],
+ selectItemCss: "rf-ddm-itm-sel",
+ listCss: "rf-ddm-lst"
+ };
+ var defaultOptions = {
+ mode: 'server',
+ attachToBody: false,
+ positionOffset: [0, 0],
+ showDelay: 50,
+ hideDelay: 800,
+ verticalOffset: 10,
+ horisantalOffset: 10,
+ showEvent: 'mouseover',
+ direction: "AA",
+ jointPoint: "AA",
+ itemCss: "rf-ddm-itm",
+ selectItemCss: "rf-ddm-itm-sel",
+ unselectItemCss: "rf-ddm-itm-unsel",
+ disabledItemCss: "rf-ddm-itm-dis",
+ listCss: "rf-ddm-lst"
+
+ };
+
+ //constructor definition
+ rf.ui.Menu = function(componentId, options) {
+ this.id = componentId;
+ $super.constructor.call(this, componentId);
+ this.id = componentId;
+ this.groupList = new Array();
+ this.options = {};
+ $.extend(this.options, defaultOptions, options || {});
+ this.attachToDom(componentId);
+
+ //bindEventHandlers.call(this);
+ this.element = rf.getDomElement(this.id);
+
+ this.selectItemCss = this.options.selectItemCss;
+ this.unselectItemCss = this.options.unselectItemCss;
+
+ //menu items list
+ //this.target = 'dd_menu_id_label_container';
+ //popup for item menu list
+ var base = rf.getDomElement(this.id);
+ this.popup = $(rf.getDomElement(this.id + "_list"));
+ //this.initiatePopup(this.popup, base, this.options.showEvent);
+ //this.initiateMenu(this.popup, base, this.options.showEvent);
+ this.options.attachTo = this.id;
+ this.popupList = new RichFaces.ui.PopupList(this.id + "_list", this,
this.options);
+ this.selectedGroup = null;
+ rf.Event.bindById(this.id, this.options.showEvent, $.proxy(this.showPopup, this),
this);
+ rf.Event.bindById(this.id, 'mouseenter', $.proxy(this.__enterHandler,
this), this);
+ rf.Event.bindById(this.id, "mouseleave", $.proxy(this.__leaveHandler,
this), this);
+ rf.Event.bindById(this.id, "mouseover", $.proxy(this.__overHandler,
this), this);
+ rf.Event.bindById(this.id, "blur", $.proxy(this.__blurHandler, this),
this);
+ rf.Event.bindById(this.id, "focus", $.proxy(this.__focusHandler, this),
this);
+ //this.popupList.show();
+ };
+
+ rf.BaseComponent.extend(rf.ui.Menu);
+
+ // define super class link
+ var $super = rf.ui.Menu.$super;
+ $.extend(rf.ui.Menu.prototype, (function() {
+ return {
+ name: "Menu",
+ initiateGroups: function(groupOptions) {
+
+ for (var i in groupOptions) {
+ var groupId = groupOptions[i].id;
+ var horizontalOffset = groupOptions[i].horizontalOffset;
+ var verticalOffset = groupOptions[i].verticalOffset;
+
+ var eventType = "mouseover";
+
+ if (null != groupId) {
+ var options = defaultPopupListOptions;
+ options.attachTo = groupId;
+ var base = rf.getDomElement(groupId);
+ //var popup=$("#"+groupId+"
.rf-ddm-sublst:first");
+ var menu = this;
+ var popup = new RichFaces.ui.Popup(groupId + '_list',
options);
+ this.groupList[groupId] = popup;
+
+ rf.Event.bindById(groupId, "mouseenter",
+ function(event) {
+ var id = event.target.id;
+ if (menu.groupList[id]) {
+ menu.invokeEvent("groupshow",
rf.getDomElement(menu.id), null);
+ menu.invokeEvent("show", rf.getDomElement(id),
null);
+ menu.groupList[id].popup.show();
+ }
+ },
+ this);
+ rf.Event.bindById(groupId, "mouseleave",
+ function(event) {
+ var id = event.target.id;
+ if (menu.groupList[id]) {
+ //this.invokeEvent("grouphide",
rf.getDomElement(menu.id), null);
+ menu.invokeEvent("hide", rf.getDomElement(id),
null);
+ menu.groupList[id].popup.hide();
+ }
+ });
+ }
+ }
+ },
+
+ submitForm: function(item) {
+ var form = this.__getParentForm(item);
+ if (this.options.mode == "server") {
+ console.info('server submit ' + item.attr('id'));
+ //rf.submitForm(form, {selectedMenuItem: item.id});
+ }
+ if (this.options.mode == "ajax") {
+ console.info('ajax submit');
+ //rf.ajax(item.id);
+ }
+ },
+
+ processItem: function(item) {
+ if (item && !this.isDisabled(item) &&
item.attr('id').search('group') == -1) {
+ this.hidePopup();
+ this.submitForm(item);
+ }
+ },
+
+ selectItem: function(item) {
+ if(item.attr('id') && !this.isDisabled(item)){
+ item.addClass(this.selectItemCss);
+ if(item.attr('id').search('group') != -1){
+ this.selectedGroup=item.attr('id');
+ } else {
+ this.selectedGroup = null;
+ }
+ }
+ },
+ unselectItem: function(item) {
+ var nextItem = this.popupList.nextSelectItem();
+ if (item.attr('id') && (nextItem.attr('id') !=
this.selectedGroup) && !this.isWithin(nextItem) ){
+ item.removeClass(this.selectItemCss);
+ item.addClass(this.unselectItemCss);
+ }
+
+ },
+ isDisabled: function(item){
+ return item.hasClass(this.options.disabledItemCss);
+ },
+ isWithin: function(item){
+ if (this.selectedGroup &&
item.parents().is('#'+this.selectedGroup)){
+ return true;
+ } else {
+ return false;
+ }
+ },
+
+ showPopup: function() {
+ this.invokeEvent("show", rf.getDomElement(this.id), null);
+ this.popupList.show();
+ },
+
+ hidePopup: function() {
+ for (var i in this.groupList) {
+ this.groupList[i].popup.hide();
+ }
+ this.invokeEvent("hide", rf.getDomElement(this.id), null);
+ this.popupList.hide();
+ },
+ ___showHandler: function() {
+ this.showTimeoutId = window.setTimeout($.proxy(function(){
+ this.showPopup();
+ }, this), this.options.showDelay)
+ },
+ __getParentForm: function(item) {
+ return item.parents("form")[0];
+ },
+ __enterHandler: function(e) {
+ // this.showPopup();
+ },
+ __leaveHandler: function(e) {
+ this.hideTimeoutId = window.setTimeout($.proxy(function(){
+ this.hidePopup();
+ }, this), this.options.hideDelay);
+ },
+ __overHandler: function(e) {
+ window.clearTimeout(this.hideTimeoutId);
+ },
+ __clickHandler: function(e) {
+ //this.showPopup();
+ },
+ __blurHandler: function(event) {
+// this.timeoutId = window.setTimeout($.proxy(function(){
+// this.onblur();
+// this.hidePopup();
+// }, this), this.hidePopup);
+
+ },
+ __focusHandler: function(event) {
+ //window.clearTimeout(this.timeoutId);
+
+ },
+ destroy: function() {
+ // clean up code here
+
+ // call parent's destroy method
+ $super.destroy.call(this);
+ }
+
+ };
+ })());
+})(jQuery, RichFaces)
\ No newline at end of file
Added:
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
===================================================================
---
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
(rev 0)
+++
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js 2010-12-02
09:59:09 UTC (rev 20287)
@@ -0,0 +1,220 @@
+(function($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.PopupList = function(id, listener, options) {
+ var mergedOptions = $.extend({},
+ defaultOptions, options);
+ $super.constructor.call(this, id, mergedOptions);
+ this.selectListener = listener;
+ this.selectItemCss = mergedOptions.selectItemCss;
+ this.scrollContainer = $(mergedOptions.scrollContainer);
+ this.itemCss = mergedOptions.itemCss;
+ this.listCss = mergedOptions.listCss;
+ this.index = -1;
+ this.id = id;
+
+ this.__updateItemsList();
+
+ //for (var i in this.items){
+ // rf.Event.bindById(this.items[i].id, "mouseenter",
$.proxy(this.__onMouseOver, this), this );
+ // rf.Event.bindById(this.items[i].id, "click", $.proxy(this.__onClick,
this), this );
+ //}
+ rf.Event.bindById(this.id, "mouseover", $.proxy(this.__onMouseOver, this),
this );
+ rf.Event.bindById(this.id, "click", $.proxy(this.__onClick, this), this );
+
+ //this.popup.bind("mouseover", $.proxy(this.__onMouseOver, this));
+ //this.popup.bind("click", $.proxy(this.__onClick, this));
+
+
+ };
+
+ rf.ui.Popup.extend(rf.ui.PopupList);
+ var $super = rf.ui.PopupList.$super;
+
+ var defaultOptions = {
+ attachToBody: true,
+ positionType: "DROPDOWN",
+ positionOffset: [0, 20],
+ positionTo: "AA",
+ potiosionFrom: "AA"
+ };
+
+ $.extend(rf.ui.PopupList.prototype, (function() {
+
+ return {
+
+ name: "popupList",
+
+ processItem: function(item) {
+ if (this.selectListener.processItem && typeof this.selectListener.processItem
== 'function') {
+ this.selectListener.processItem(item);
+ }
+ },
+
+ selectItem: function(item) {
+ if (this.selectListener.selectItem && typeof this.selectListener.selectItem
== 'function') {
+ this.selectListener.selectItem(item);
+ } else {
+ item.addClass(this.selectItemCss);
+ }
+ this.__scrollToSelectedItem(this);
+ },
+
+ unselectItem: function(item) {
+ if (this.selectListener.unselectItem && typeof
this.selectListener.unselectItem == 'function') {
+ this.selectListener.unselectItem(item);
+ } else {
+ item.removeClass(this.selectItemCss);
+ }
+ },
+
+ nextSelectItem: function() {
+ var item = this.items.eq(this.nextSelectItemIndex);
+ if (item){
+ return item;
+ }
+
+ },
+
+ currentSelectItem: function() {
+ if (this.items && this.index != -1) {
+ return this.items[this.index];
+ }
+ },
+
+ getSelectedItemIndex: function() {
+ return this.index;
+ },
+
+ getItemByIndex: function(i) {
+ if (i >= 0 && i <= this.items.length) {
+ return this.items[i];
+ }
+ },
+
+ resetItemsSelection: function() {
+ if (this.items) {
+ var popup = this;
+ this.items.each(function(i, item) {
+ popup.unselectItem($(item));
+ });
+ }
+ },
+
+ isPopupList: function(target) {
+ var parentId = target.parents("." + this.listCss).attr("id");
+ return (parentId && (parentId == this.getId()));
+ },
+
+ __updateItemsList: function() {
+ return (this.items = this.popup.find("." + this.itemCss));
+ },
+
+ __select: function(item) {
+ var index = this.items.index(item);
+ this.__selectByIndex(index);
+ },
+
+ __selectByIndex: function(index, isOffset) {
+ if (this.items.length == 0 || (!isOffset && this.index == index)) return;
+
+ var item;
+
+ if (this.index != -1) {
+ item = this.items.eq(this.index);
+ this.nextSelectItemIndex=index;
+ this.unselectItem(item);
+ }
+
+ if (index == undefined) {
+ this.index = -1;
+ return;
+ }
+
+ if (isOffset) {
+ this.index += index;
+ if (this.index < 0) {
+ this.index = this.items.length - 1;
+ } else if (this.index >= this.items.length) {
+ this.index = 0;
+ }
+ } else {
+ if (index < 0) {
+ index = 0;
+ } else if (index >= this.items.length) {
+ index = this.items.length - 1;
+ }
+ this.index = index;
+ }
+
+ item = this.items.eq(this.index);
+
+ this.selectItem(item);
+ },
+
+ __selectCurrent: function() {
+ var item;
+ if (this.items && this.index >= 0) {
+ item = this.items.eq(this.index);
+ this.processItem(item);
+ }
+ },
+
+ __selectPrev: function() {
+ this.__selectByIndex( - 1, true);
+ },
+
+ __selectNext: function() {
+ this.__selectByIndex(1, true);
+ },
+
+ __onMouseOver: function(e) {
+ var item = this.__getItem(e);
+ if (item) {
+ this.__select(item);
+ }
+ },
+
+ __onClick: function(e) {
+ console.info("e.target: "+$(e.target).attr('id')+";
e.currentTarget:"+$(e.currentTarget).attr('id'));
+ var item = this.__getItem(e);
+ //this.processItem($(item));
+ //this.__select(item);
+ },
+
+ __getItem: function(e) {
+ return $(e.target).closest("." + this.itemCss, e.currentTarget).get(0);
+ },
+
+ __getItems: function() {
+ return this.items;
+ },
+
+ __setItems: function(items) {
+ this.items = items;
+ },
+
+ __scrollToSelectedItem: function() {
+ if (this.scrollContainer && this.scrollContainer.lenght < 1) {
+ var offset = 0;
+
+ this.items.slice(0, this.index).each(function() {
+ offset += this.offsetHeight;
+ });
+
+ var parentContainer = this.scrollContainer;
+ if (offset < parentContainer.scrollTop()) {
+ parentContainer.scrollTop(offset);
+ } else {
+ offset += this.items.get(this.index).offsetHeight;
+ if (offset - parentContainer.scrollTop() > parentContainer.get(0).clientHeight)
{
+ parentContainer.scrollTop(offset - parentContainer.innerHeight());
+ }
+ }
+ }
+ }
+ }
+ })());
+
+})(jQuery, window.RichFaces);
\ No newline at end of file
Added:
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties
===================================================================
---
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties
(rev 0)
+++
sandbox/trunk/ui/dropdown-menu/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties 2010-12-02
09:59:09 UTC (rev 20287)
@@ -0,0 +1,5 @@
+org.richfaces.images\:menu_list_bg.gif=org.richfaces.renderkit.html.BaseGradient\
+ {width=22, height=3, baseColorParam=additionalBackgroundColor,
gradientColorParam=tabBackgroundColor, horizontal=true}
+org.richfaces.images\:menu_item_bg.gif=org.richfaces.renderkit.html.BaseGradient\
+ {width=3, height=16, baseColorParam=additionalBackgroundColor,
gradientColorParam=tabBackgroundColor}
+
\ No newline at end of file
Added: sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/dropdownmenu.template.xml
===================================================================
--- sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/dropdownmenu.template.xml
(rev 0)
+++
sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/dropdownmenu.template.xml 2010-12-02
09:59:09 UTC (rev 20287)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<cdk:root
xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el"
+
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
+
xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
+
xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite"
+
xmlns:javaee="http://java.sun.com/xml/ns/javaee">
+
+ <cc:interface>
+
<cdk:class>org.richfaces.renderkit.html.DropDownMenuRenderer</cdk:class>
+
<cdk:superclass>org.richfaces.renderkit.html.DropDownMenuRendererBase</cdk:superclass>
+
<cdk:component-family>org.richfaces.DropDownMenu</cdk:component-family>
+
<cdk:renderer-type>org.richfaces.DropDownMenuRenderer</cdk:renderer-type>
+ <cdk:renders-children>true</cdk:renders-children>
+ </cc:interface>
+
+ <cc:implementation>
+ <cdk:object name="style"
value="#{component.attributes['style']}" />
+ <cdk:object name="styleClass" value="#{not empty
component.attributes['styleClass'] ?
component.attributes['styleClass']:''}" />
+
+ <cdk:object name="label" value="#{getLabelFacet(component)}"
type="javax.faces.component.UIComponent" />
+ <cdk:object name="isDisabled" type="boolean"
value="#{isDisabled(component)}" />
+
+ <div id="#{clientId}" class="rf-ddm-lbl #{isDisabled ?
'rf-ddm-lbl-dis' : 'rf-ddm-lbl-unsel '+styleClass} "
style="#{style}"
+ cdk:passThroughWithExclusions="">
+ <div class="#{isDisabled ? 'rf-ddm-lbl-dis' :
'rf-ddm-lbl-dec'}">
+
+ <c:choose>
+ <c:when test="#{label != null and label.isRendered()}">
+ <cdk:call expression="label.encodeAll(facesContext)" />
+ </c:when>
+ <c:when test="#{not empty component.attributes['label']}">
+ #{component.attributes['label']}
+ </c:when>
+ <c:otherwise>
+
+ </c:otherwise>
+ </c:choose>
+
+ </div>
+ <div class="rf-ddm-pos">
+ <div id="#{clientId}_list" class="rf-ddm-lst"
style="display:none;">
+ <div class="rf-ddm-lst-bg">
+ <cdk:body />
+ </div>
+ </div>
+ </div>
+ <script type="text/javascript">
+ <cdk:scriptObject name="options">
+ <cdk:scriptOption attributes="hideDelay showDelay" />
+ <cdk:scriptOption attributes="onshow onhide ongroupshow
ongrouphide" wrapper="eventHandler"/>
+ </cdk:scriptObject>
+
+ new
RichFaces.ui.Menu("#{clientId}",#{toScriptArgs(options)}).initiateGroups(#{toScriptArgs(getMenuGroups(facesContext,
component))});
+ </script>
+ </div>
+ </cc:implementation>
+
+</cdk:root>
Added: sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menugroup.template.xml
===================================================================
--- sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menugroup.template.xml
(rev 0)
+++ sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menugroup.template.xml 2010-12-02
09:59:09 UTC (rev 20287)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<cdk:root
xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el"
+
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
+
xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
+
xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite"
+
xmlns:javaee="http://java.sun.com/xml/ns/javaee">
+
+ <cc:interface>
+
<cdk:class>org.richfaces.renderkit.html.MenuGroupRenderer</cdk:class>
+
<cdk:superclass>org.richfaces.renderkit.html.MenuGroupRendererBase</cdk:superclass>
+
<cdk:component-family>org.richfaces.DropDownMenu</cdk:component-family>
+
<cdk:renderer-type>org.richfaces.MenuGroupRenderer</cdk:renderer-type>
+ <cdk:renders-children>true</cdk:renders-children>
+ </cc:interface>
+
+ <cc:implementation>
+ <cdk:object name="style"
value="#{component.attributes['style']}" />
+ <cdk:object name="iconClass"
value="#{component.attributes['iconClass']}" />
+ <cdk:object name="labelClass"
value="#{component.attributes['labelClass']}" />
+ <cdk:object name="styleClass" type="java.lang.String"
value="#{getStyleClass(component, 'groupClass', 'styleClass')}"
/>
+ <cdk:object name="selectedClass" type="java.lang.String"
value="#{getStyleClass(component, 'selectedGroupClass',
'selectedClass')}" />
+ <cdk:object name="disabledClass" type="java.lang.String"
value="#{getStyleClass(component, 'disabledGroupClass',
'disabledClass')}" />
+
+ <cdk:object name="isDisabled" type="boolean"
value="#{isDisabled(component)}" />
+ <cdk:object name="iconFacet" value="#{getIconFacet(component)}"
type="javax.faces.component.UIComponent" />
+ <cdk:object name="iconAttribute"
value="#{getIconAttribute(component)}" type="java.lang.String" />
+
+ <cdk:object name="onmouseover" type="java.lang.String"
value="this.className='rf-ddm-itm rf-ddm-itm-sel #{selectedClass}'"
/>
+ <cdk:object name="onmouseout" type="java.lang.String"
value="this.className='rf-ddm-itm rf-ddm-itm-unsel'" />
+
+ <div id="#{clientId}_group" class="rf-ddm-itm #{isDisabled ?
'rf-ddm-itm-dis '+disabledClass : 'rf-ddm-itm-unsel '+styleClass}"
style="#{style}"
+ onmouseover="#{isDisabled ? '' : onmouseover}"
+ onmouseout="#{isDisabled ? '' : onmouseout}"
+ cdk:passThroughWithExclusions="" >
+ <span class="rf-ddm-itm-ic #{iconClass}">
+ <c:choose>
+ <c:when test="iconFacet != null and iconFacet.isRendered()">
+ <cdk:call expression="iconFacet.encodeAll(facesContext)" />
+ </c:when>
+ <c:when test="#{not empty iconAttribute}">
+ <img width="16" height="16" src="#{iconAttribute}"
alt="" />
+ </c:when>
+ <c:otherwise>
+ <div class="rf-ddm-emptyIcon"></div>
+ </c:otherwise>
+ </c:choose>
+ </span>
+
+ <c:choose>
+ <c:when test="#{not isDisabled}">
+ <span class="rf-ddm-itm-lbl
#{labelClass}">#{component.attributes['label']}</span>
+ </c:when>
+ <c:otherwise>
+ #{component.attributes['label']}
+ </c:otherwise>
+ </c:choose>
+
+ <div class="rf-ddm-nd">
+ <c:choose>
+ <c:when test="#{not isDisabled}">
+ <div class="rf-ddm-lst rf-ddm-sublst"
style="display:none;">
+ <div class="rf-ddm-lst-bg">
+ <cdk:call expression="renderChildren(facesContext, component)"
/>
+ </div>
+ </div>
+ </c:when>
+ </c:choose>
+ </div>
+ </div>
+ </cc:implementation>
+
+</cdk:root>
Added: sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menuitem.template.xml
===================================================================
--- sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menuitem.template.xml
(rev 0)
+++ sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menuitem.template.xml 2010-12-02
09:59:09 UTC (rev 20287)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<cdk:root
xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el"
+
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
+
xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
+
xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite"
+
xmlns:javaee="http://java.sun.com/xml/ns/javaee">
+
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.MenuItemRenderer</cdk:class>
+
<cdk:superclass>org.richfaces.renderkit.html.MenuItemRendererBase</cdk:superclass>
+
<cdk:component-family>org.richfaces.DropDownMenu</cdk:component-family>
+
<cdk:renderer-type>org.richfaces.MenuItemRenderer</cdk:renderer-type>
+ <cdk:renders-children>true</cdk:renders-children>
+ </cc:interface>
+
+ <cc:implementation>
+ <cdk:object name="style"
value="#{component.attributes['style']}" />
+ <cdk:object name="iconClass" type="java.lang.String"
value="#{getStyleClass(component, '', 'iconClass',
'iconClass')}" />
+ <cdk:object name="labelClass" type="java.lang.String"
value="#{getStyleClass(component, '', 'labelClass',
'labelClass')}" />
+ <cdk:object name="styleClass" type="java.lang.String"
value="#{getStyleClass(component, 'itemClass', 'styleClass',
'styleClass')}" />
+ <cdk:object name="selectedClass" type="java.lang.String"
value="#{getStyleClass(component, 'selectedItemClass',
'selectedClass', 'selectedClass')}" />
+ <cdk:object name="disabledClass" type="java.lang.String"
value="#{getStyleClass(component, 'disabledItemClass',
'disabledClass', 'disabledClass')}" />
+
+ <cdk:object name="isDisabled" type="boolean"
value="#{isDisabled(component)}" />
+ <cdk:object name="onmouseover" type="java.lang.String"
value="this.className='rf-ddm-itm rf-ddm-itm-sel #{selectedClass}'"
/>
+ <cdk:object name="onmouseout" type="java.lang.String"
value="this.className='rf-ddm-itm rf-ddm-itm-unsel #{styleClass}'"
/>
+
+ <cdk:object name="iconFacet"
value="#{getIconFacet(component)}"
type="javax.faces.component.UIComponent" />
+ <cdk:object name="iconAttribute"
value="#{getIconAttribute(component)}" type="java.lang.String" />
+
+ <div id="#{clientId}" class="rf-ddm-itm #{isDisabled ?
'rf-ddm-itm-dis '+disabledClass : 'rf-ddm-itm-unsel '+styleClass}"
style="#{style}"
+ onmouseover="#{isDisabled ? '' : onmouseover}"
+ onmouseout="#{isDisabled ? '' : onmouseout}"
+ onclick="#{getOnClickFunction(component)}"
+ cdk:passThroughWithExclusions="">
+ <span class="rf-ddm-itm-ic #{iconClass}">
+ <c:choose>
+ <c:when test="#{iconFacet != null and iconFacet.isRendered()}">
+ <cdk:call expression="iconFacet.encodeAll(facesContext)" />
+ </c:when>
+ <c:when test="#{not empty iconAttribute}">
+ <img width="16" height="16" src="#{iconAttribute}"
alt="" />
+ </c:when>
+ <c:otherwise>
+ <div class="rf-ddm-emptyIcon"></div>
+ </c:otherwise>
+ </c:choose>
+ </span>
+
+ <c:choose>
+ <c:when test="#{not isDisabled}">
+ <span class="rf-ddm-itm-lbl #{labelClass}">
+ <c:choose>
+ <c:when test="#{not empty
component.attributes['label']}">
+ #{component.attributes['label']}
+ </c:when>
+ <c:otherwise>
+ <cdk:call expression="renderChildren(facesContext, component);"
/>
+ </c:otherwise>
+ </c:choose>
+ </span>
+ </c:when>
+ <c:otherwise>
+ <c:choose>
+ <c:when test="#{not empty component.attributes['label']}">
+ #{component.attributes['label']}
+ </c:when>
+ <c:otherwise>
+ <cdk:call expression="renderChildren(facesContext, component);"
/>
+ </c:otherwise>
+ </c:choose>
+ </c:otherwise>
+ </c:choose>
+
+ </div>
+ </cc:implementation>
+</cdk:root>
Added: sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menuseparator.template.xml
===================================================================
--- sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menuseparator.template.xml
(rev 0)
+++
sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menuseparator.template.xml 2010-12-02
09:59:09 UTC (rev 20287)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<cdk:root
xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el"
+
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
+
xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
+
xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite"
+
xmlns:javaee="http://java.sun.com/xml/ns/javaee">
+
+ <cc:interface>
+
<cdk:class>org.richfaces.renderkit.html.MenuSeparatorRenderer</cdk:class>
+
<cdk:superclass>org.richfaces.renderkit.html.MenuSeparatorRendererBase</cdk:superclass>
+
<cdk:component-family>org.richfaces.DropDownMenu</cdk:component-family>
+
<cdk:renderer-type>org.richfaces.MenuSeparatorRenderer</cdk:renderer-type>
+ <cdk:renders-children>true</cdk:renders-children>
+ </cc:interface>
+
+ <cc:implementation>
+ <div class="rf-ddm-sep"></div>
+ </cc:implementation>
+
+</cdk:root>