JBoss Rich Faces SVN: r20384 - trunk/ui/misc/ui/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-03 15:00:01 -0500 (Fri, 03 Dec 2010)
New Revision: 20384
Added:
trunk/ui/misc/ui/src/main/templates/fileupload.template.xml
Log:
RF-9921
Copied: trunk/ui/misc/ui/src/main/templates/fileupload.template.xml (from rev 20382, sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml)
===================================================================
--- trunk/ui/misc/ui/src/main/templates/fileupload.template.xml (rev 0)
+++ trunk/ui/misc/ui/src/main/templates/fileupload.template.xml 2010-12-03 20:00:01 UTC (rev 20384)
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright ${year}, 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.
+-->
+<cdk:root xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el" xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
+ xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite" xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.FileUploadRenderer</cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.FileUploadRendererBase</cdk:superclass>
+ <cdk:component-family>org.richfaces.FileUpload</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.FileUploadRenderer</cdk:renderer-type>
+ <cdk:resource-dependency library="org.richfaces" name="fileupload.ecss" />
+ <cdk:resource-dependency library="org.richfaces" name="ajax.reslib" />
+ <cdk:resource-dependency library="org.richfaces" name="base-component.reslib" />
+ <cdk:resource-dependency name="richfaces-event.js" />
+ <cdk:resource-dependency library="org.richfaces" name="fileupload.js" />
+ </cc:interface>
+ <cc:implementation>
+ <cdk:object name="attributes" value="#{component.attributes}"/>
+ <cdk:object name="enabled" value="#{attributes['enabled']}"/>
+ <div id="#{clientId}" class="rf-fu #{attributes['styleClass']}"
+ cdk:passThroughWithExclusions="">
+ <div class="rf-fu-hdr">
+ <span class="rf-fu-btns-lft">
+ <span class="rf-fu-btn-add#{enabled ? '' : '-dis'}">
+ <span class="rf-fu-btn-cnt-add#{enabled ? '' : '-dis'}">
+ <c:if test="#{enabled}">
+ <span class="rf-fu-inp-cntr"> <!-- This span is needed for IE7 only. -->
+ <input type="file" class="rf-fu-inp"/>
+ </span>
+ </c:if>
+ <cdk:object name="addLabel" value="#{attributes['addLabel']}"/>
+ #{addLabel != null ? addLabel : 'Add...'}
+ </span>
+ </span>
+ <c:if test="#{enabled}">
+ <span class="rf-fu-btn-upl">
+ <cdk:object name="uploadLabel" value="#{attributes['uploadLabel']}"/>
+ <span class="rf-fu-btn-cnt-upl">#{uploadLabel != null ? uploadLabel : 'Upload'}</span>
+ </span>
+ </c:if>
+ </span>
+ <c:if test="#{enabled}">
+ <span class="rf-fu-btns-rgh">
+ <span class="rf-fu-btn-clr">
+ <cdk:object name="clearAllLabel" value="#{attributes['clearAllLabel']}"/>
+ <span class="rf-fu-btn-cnt-clr">#{clearAllLabel != null ? clearAllLabel : 'Clear All'}</span>
+ </span>
+ </span>
+ </c:if>
+ </div>
+ <div class="rf-fu-lst"/>
+ <c:if test="#{enabled}">
+ <div class="rf-fu-cntr-hdn">
+ <iframe name="#{clientId}"/>
+ <cdk:object name="progressBar" value="#{component.facets['progress']}"/>
+ <c:if test="#{progressBar != null and progressBar.isRendered()}">
+ <cdk:call expression="progressBar.encodeAll(facesContext)" />
+ </c:if>
+ </div>
+ <cdk:scriptObject name="options">
+ <cdk:scriptOption attributes="acceptedTypes noDuplicate onfilesubmit onuploadcomplete doneLabel
+ sizeExceededLabel stoppedLabel serverErrorLabel clearLabel deleteLabel"/>
+ </cdk:scriptObject>
+ <script type="text/javascript">new RichFaces.ui.FileUpload(#{toScriptArgs(clientId, options)});</script>
+ </c:if>
+ </div>
+ </cc:implementation>
+</cdk:root>
14 years, 1 month
JBoss Rich Faces SVN: r20383 - trunk/ui/misc/ui/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-03 14:56:08 -0500 (Fri, 03 Dec 2010)
New Revision: 20383
Added:
trunk/ui/misc/ui/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
Log:
RF-9921
Copied: trunk/ui/misc/ui/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java (from rev 20382, sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java)
===================================================================
--- trunk/ui/misc/ui/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java (rev 0)
+++ trunk/ui/misc/ui/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2010-12-03 19:56:08 UTC (rev 20383)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.
+ */
+package org.richfaces.renderkit;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.event.UploadEvent;
+import org.richfaces.request.MultipartRequest;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public class FileUploadRendererBase extends RendererBase {
+
+ @Override
+ protected void doDecode(FacesContext context, UIComponent component) {
+ ExternalContext externalContext = context.getExternalContext();
+ Object request = externalContext.getRequest();
+ if (request instanceof MultipartRequest
+ && externalContext.getRequestParameterMap().containsKey(component.getClientId(context))) {
+ component.queueEvent(new UploadEvent(component, ((MultipartRequest) request).getUploadItems()));
+ }
+ }
+}
14 years, 1 month
JBoss Rich Faces SVN: r20382 - trunk/ui/misc/ui/src/main/java/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-03 14:45:31 -0500 (Fri, 03 Dec 2010)
New Revision: 20382
Added:
trunk/ui/misc/ui/src/main/java/org/richfaces/exception/
Removed:
sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/exception/
Log:
RF-9921
Copied: trunk/ui/misc/ui/src/main/java/org/richfaces/exception (from rev 20381, sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/exception)
14 years, 1 month
JBoss Rich Faces SVN: r20381 - trunk/ui/misc/ui/src/main/java/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-03 14:42:01 -0500 (Fri, 03 Dec 2010)
New Revision: 20381
Added:
trunk/ui/misc/ui/src/main/java/org/richfaces/cotext/
Removed:
sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/context/
Log:
RF-9921
Copied: trunk/ui/misc/ui/src/main/java/org/richfaces/cotext (from rev 20380, sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/context)
14 years, 1 month
JBoss Rich Faces SVN: r20380 - trunk/ui/misc/ui/src/main/java/org/richfaces/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-03 14:40:33 -0500 (Fri, 03 Dec 2010)
New Revision: 20380
Added:
trunk/ui/misc/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java
Removed:
sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java
Log:
RF-9921
Deleted: sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java
===================================================================
--- sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java 2010-12-03 18:53:03 UTC (rev 20379)
+++ sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java 2010-12-03 19:40:33 UTC (rev 20380)
@@ -1,123 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, 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.
- */
-package org.richfaces.component;
-
-import java.util.Map;
-
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIComponentBase;
-import javax.faces.context.FacesContext;
-import javax.faces.event.AbortProcessingException;
-import javax.faces.event.ComponentSystemEvent;
-import javax.faces.event.ListenerFor;
-import javax.faces.event.PostAddToViewEvent;
-
-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.context.FileUploadPartialViewContextFactory;
-import org.richfaces.event.FileUploadListener;
-import org.richfaces.request.MultipartRequest;
-
-/**
- * @author Konstantin Mishin
- *
- */
-@JsfComponent(tag = @Tag(handler = "org.richfaces.view.facelets.FileUploadHandler"),
- renderer = @JsfRenderer(type = "org.richfaces.FileUploadRenderer"),
- attributes = {"events-props.xml", "core-props.xml", "i18n-props.xml"})
-@ListenerFor(systemEventClass = PostAddToViewEvent.class)
-public abstract class AbstractFileUpload extends UIComponentBase {
-
- @Attribute
- public abstract String getAcceptedTypes();
-
- @Attribute(defaultValue = "true")
- public abstract boolean isEnabled();
-
- @Attribute(defaultValue = "false")
- public abstract boolean isNoDuplicate();
-
- @Attribute(events = @EventName("filesubmit"))
- public abstract String getOnfilesubmit();
-
- @Attribute(events = @EventName("uploadcomplete"))
- public abstract String getOnuploadcomplete();
-
- @Override
- public void processEvent(ComponentSystemEvent event) throws AbortProcessingException {
- super.processEvent(event);
- FacesContext context = getFacesContext();
- Map<String, UIComponent> facets = getFacets();
- UIComponent component = facets.get("progress");
- if (component == null) {
- component = context.getApplication().createComponent(context, "org.richfaces.ProgressBar",
- "org.richfaces.ProgressBarRenderer");
- if (component != null) {
- component.setId(getId() + "_pb");
- facets.put("progress", component);
- }
- }
- if (component != null) {
- component.setValueExpression("value", context.getApplication().getExpressionFactory()
- .createValueExpression(context.getELContext(),
- "#{" + MultipartRequest.PERCENT_BEAN_NAME + "[param['"
- + FileUploadPartialViewContextFactory.UID_KEY + "']]}", Integer.class));
- }
- }
-
- /**
- * <p>Add a new {@link FileUploadListener} to the set of listeners
- * interested in being notified when {@link UploadEvent}s occur.</p>
- *
- * @param listener The {@link FileUploadListener} to be added
- * @throws NullPointerException if <code>listener</code>
- * is <code>null</code>
- */
- public void addFileUploadListener(FileUploadListener listener) {
- addFacesListener(listener);
- }
-
- /**
- * <p>Return the set of registered {@link FileUploadListener}s for this
- * {@link AbstractFileUpload} instance. If there are no registered listeners,
- * a zero-length array is returned.</p>
- */
- public FileUploadListener[] getFileUploadListeners() {
- return (FileUploadListener[]) getFacesListeners(FileUploadListener.class);
- }
-
- /**
- * <p>Remove an existing {@link FileUploadListener} (if any) from the
- * set of listeners interested in being notified when
- * {@link FileUploadListener}s occur.</p>
- *
- * @param listener The {@link FileUploadListener} to be removed
- * @throws NullPointerException if <code>listener</code>
- * is <code>null</code>
- */
- public void removeFileUploadListener(FileUploadListener listener) {
- removeFacesListener(listener);
- }
-}
\ No newline at end of file
Copied: trunk/ui/misc/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java (from rev 20379, sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java)
===================================================================
--- trunk/ui/misc/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java (rev 0)
+++ trunk/ui/misc/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java 2010-12-03 19:40:33 UTC (rev 20380)
@@ -0,0 +1,123 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.
+ */
+package org.richfaces.component;
+
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ComponentSystemEvent;
+import javax.faces.event.ListenerFor;
+import javax.faces.event.PostAddToViewEvent;
+
+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.context.FileUploadPartialViewContextFactory;
+import org.richfaces.event.FileUploadListener;
+import org.richfaces.request.MultipartRequest;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+@JsfComponent(tag = @Tag(handler = "org.richfaces.view.facelets.FileUploadHandler"),
+ renderer = @JsfRenderer(type = "org.richfaces.FileUploadRenderer"),
+ attributes = {"events-props.xml", "core-props.xml", "i18n-props.xml"})
+@ListenerFor(systemEventClass = PostAddToViewEvent.class)
+public abstract class AbstractFileUpload extends UIComponentBase {
+
+ @Attribute
+ public abstract String getAcceptedTypes();
+
+ @Attribute(defaultValue = "true")
+ public abstract boolean isEnabled();
+
+ @Attribute(defaultValue = "false")
+ public abstract boolean isNoDuplicate();
+
+ @Attribute(events = @EventName("filesubmit"))
+ public abstract String getOnfilesubmit();
+
+ @Attribute(events = @EventName("uploadcomplete"))
+ public abstract String getOnuploadcomplete();
+
+ @Override
+ public void processEvent(ComponentSystemEvent event) throws AbortProcessingException {
+ super.processEvent(event);
+ FacesContext context = getFacesContext();
+ Map<String, UIComponent> facets = getFacets();
+ UIComponent component = facets.get("progress");
+ if (component == null) {
+ component = context.getApplication().createComponent(context, "org.richfaces.ProgressBar",
+ "org.richfaces.ProgressBarRenderer");
+ if (component != null) {
+ component.setId(getId() + "_pb");
+ facets.put("progress", component);
+ }
+ }
+ if (component != null) {
+ component.setValueExpression("value", context.getApplication().getExpressionFactory()
+ .createValueExpression(context.getELContext(),
+ "#{" + MultipartRequest.PERCENT_BEAN_NAME + "[param['"
+ + FileUploadPartialViewContextFactory.UID_KEY + "']]}", Integer.class));
+ }
+ }
+
+ /**
+ * <p>Add a new {@link FileUploadListener} to the set of listeners
+ * interested in being notified when {@link UploadEvent}s occur.</p>
+ *
+ * @param listener The {@link FileUploadListener} to be added
+ * @throws NullPointerException if <code>listener</code>
+ * is <code>null</code>
+ */
+ public void addFileUploadListener(FileUploadListener listener) {
+ addFacesListener(listener);
+ }
+
+ /**
+ * <p>Return the set of registered {@link FileUploadListener}s for this
+ * {@link AbstractFileUpload} instance. If there are no registered listeners,
+ * a zero-length array is returned.</p>
+ */
+ public FileUploadListener[] getFileUploadListeners() {
+ return (FileUploadListener[]) getFacesListeners(FileUploadListener.class);
+ }
+
+ /**
+ * <p>Remove an existing {@link FileUploadListener} (if any) from the
+ * set of listeners interested in being notified when
+ * {@link FileUploadListener}s occur.</p>
+ *
+ * @param listener The {@link FileUploadListener} to be removed
+ * @throws NullPointerException if <code>listener</code>
+ * is <code>null</code>
+ */
+ public void removeFileUploadListener(FileUploadListener listener) {
+ removeFacesListener(listener);
+ }
+}
\ No newline at end of file
14 years, 1 month
JBoss Rich Faces SVN: r20379 - trunk/ui/misc and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-03 13:53:03 -0500 (Fri, 03 Dec 2010)
New Revision: 20379
Added:
trunk/ui/misc/api/
Removed:
sandbox/trunk/ui/fileupload/api/
Log:
RF-9921
Copied: trunk/ui/misc/api (from rev 20378, sandbox/trunk/ui/fileupload/api)
14 years, 1 month
JBoss Rich Faces SVN: r20377 - in trunk: ui/core/ui/src/main/resources/META-INF/resources/org.richfaces and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-12-03 12:53:27 -0500 (Fri, 03 Dec 2010)
New Revision: 20377
Modified:
trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js
trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/push.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.js
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/collapsible-subtable.js
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.js
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datatable.js
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenu.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuItem.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanel.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanelItem.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tooltip.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js
Log:
http://jira.jboss.com/jira/browse/RF-9858
detach calls moved to global cleanup functionality
Modified: trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-12-03 17:34:09 UTC (rev 20376)
+++ trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-12-03 17:53:27 UTC (rev 20377)
@@ -67,6 +67,14 @@
}
//dom cleaner
+ richfaces.cleanComponent = function (source) {
+ var component = richfaces.$(source);
+ if (component) {
+ richfaces.invokeMethod(component, "destroy");
+ richfaces.invokeMethod(component, "detach", source);
+ }
+ };
+
richfaces.cleanDom = function(source) {
var e = (typeof source == "string") ? document.getElementById(source) : jQuery('body').get(0);
if (e) {
@@ -75,9 +83,9 @@
jQuery.cleanData(elements);
jQuery.cleanData([e]);
jQuery.each(elements, function(index) {
- richfaces.invokeMethod(this, "destroy");
+ richfaces.cleanComponent(this);
});
- richfaces.invokeMethod(e, "destroy");
+ richfaces.cleanComponent(e);
}
}
}
Modified: trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js
===================================================================
--- trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js 2010-12-03 17:34:09 UTC (rev 20376)
+++ trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js 2010-12-03 17:53:27 UTC (rev 20377)
@@ -200,7 +200,6 @@
}
this.__contentsElement = null;
- this.detach();
$super.destroy.call(this);
},
Modified: trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/push.js
===================================================================
--- trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/push.js 2010-12-03 17:34:09 UTC (rev 20376)
+++ trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/push.js 2010-12-03 17:53:27 UTC (rev 20377)
@@ -231,7 +231,6 @@
this.__unbindErrorHandler();
richfaces.Push.decreaseSubscriptionCounters(this.__address);
- this.detach();
$super.destroy.call(this);
}
});
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js 2010-12-03 17:34:09 UTC (rev 20376)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js 2010-12-03 17:53:27 UTC (rev 20377)
@@ -460,7 +460,6 @@
var itemsContainer = rf.getDomElement(this.id+ID.ITEMS);
$(itemsContainer).removeData();
rf.Event.unbind(itemsContainer.parentNode, this.namespace);
- this.detach()
$super.destroy.call(this);
}
};
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js 2010-12-03 17:34:09 UTC (rev 20376)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js 2010-12-03 17:53:27 UTC (rev 20377)
@@ -538,7 +538,6 @@
this.scrollElements = null;
rf.Event.unbind(window.document, "click"+this.namespace);
}
- this.detach();
$super.destroy.call(this);
},
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js 2010-12-03 17:34:09 UTC (rev 20376)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js 2010-12-03 17:53:27 UTC (rev 20377)
@@ -73,7 +73,6 @@
destroy: function() {
rf.Event.unbindById(this.input, this.namespace);
this.input = null;
- this.detach();
$super.destroy.call(this);
}
}
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.js 2010-12-03 17:34:09 UTC (rev 20376)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.js 2010-12-03 17:53:27 UTC (rev 20377)
@@ -94,7 +94,6 @@
.unbind("mouseup", this.destroy);
this.intervalId = null;
}
- this.detach();
$super.destroy.call(this);
},
Modified: trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/collapsible-subtable.js
===================================================================
--- trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/collapsible-subtable.js 2010-12-03 17:34:09 UTC (rev 20376)
+++ trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/collapsible-subtable.js 2010-12-03 17:53:27 UTC (rev 20377)
@@ -107,7 +107,6 @@
return this.expandMode;
},
destroy: function() {
- this.detach();
$super.destroy.call(this);
}
};
Modified: trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.js
===================================================================
--- trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.js 2010-12-03 17:34:09 UTC (rev 20376)
+++ trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.js 2010-12-03 17:53:27 UTC (rev 20377)
@@ -160,7 +160,6 @@
return scrollEventName;
},
destroy: function() {
- this.detach();
$super.destroy.call(this);
}
}
Modified: trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datatable.js
===================================================================
--- trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datatable.js 2010-12-03 17:34:09 UTC (rev 20376)
+++ trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datatable.js 2010-12-03 17:53:27 UTC (rev 20377)
@@ -96,7 +96,6 @@
}
},
destroy: function() {
- this.detach();
$super.destroy.call(this);
}
}
Modified: trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js
===================================================================
--- trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js 2010-12-03 17:34:09 UTC (rev 20376)
+++ trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js 2010-12-03 17:53:27 UTC (rev 20377)
@@ -73,7 +73,6 @@
this.__rootElt = null;
- this.detach();
$superTreeNode.destroy.call(this);
},
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenu.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenu.js 2010-12-03 17:34:09 UTC (rev 20376)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenu.js 2010-12-03 17:53:27 UTC (rev 20377)
@@ -201,7 +201,6 @@
destroy: function () {
rf.Event.unbindById(this.id, "."+this.namespace);
- this.detach();
$super.destroy.call(this);
}
});
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuItem.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuItem.js 2010-12-03 17:34:09 UTC (rev 20376)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuItem.js 2010-12-03 17:53:27 UTC (rev 20377)
@@ -312,7 +312,6 @@
destroy: function () {
delete this.__rfPanelMenu().getItems()[this.itemName];
- this.detach();
$super.destroy.call(this);
}
});
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanel.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanel.js 2010-12-03 17:34:09 UTC (rev 20376)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanel.js 2010-12-03 17:53:27 UTC (rev 20377)
@@ -424,7 +424,6 @@
},
destroy: function () {
- this.detach();
$super.destroy.call(this);
}
});
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanelItem.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanelItem.js 2010-12-03 17:34:09 UTC (rev 20376)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanelItem.js 2010-12-03 17:53:27 UTC (rev 20377)
@@ -111,7 +111,6 @@
// class stuff
destroy: function () {
- this.detach();
$super.destroy.call(this);
}
});
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tooltip.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tooltip.js 2010-12-03 17:34:09 UTC (rev 20376)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tooltip.js 2010-12-03 17:53:27 UTC (rev 20377)
@@ -286,7 +286,6 @@
},
destroy: function () {
- this.detach();
$super.destroy.call(this);
}
});
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2010-12-03 17:34:09 UTC (rev 20376)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2010-12-03 17:53:27 UTC (rev 20377)
@@ -184,7 +184,6 @@
this.userOptions = null;
this.eIframe= null;
- this.detach(this.markerId);
$super.destroy.call(this);
},
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js 2010-12-03 17:34:09 UTC (rev 20376)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js 2010-12-03 17:53:27 UTC (rev 20377)
@@ -192,7 +192,6 @@
destroy: function() {
this.disable();
this.__elt = null;
- this.detach();
$super.destroy.call(this);
}
}
14 years, 1 month
JBoss Rich Faces SVN: r20376 - in sandbox/trunk: ui/dropdown-menu/ui/src/main/templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-12-03 12:34:09 -0500 (Fri, 03 Dec 2010)
New Revision: 20376
Modified:
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/index.xhtml
sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menugroup.template.xml
sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menuitem.template.xml
Log:
RF-9676 :Dropdown menu component. Resource url changes added.
Modified: sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/index.xhtml
===================================================================
--- sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/index.xhtml 2010-12-03 17:30:21 UTC (rev 20375)
+++ sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/index.xhtml 2010-12-03 17:34:09 UTC (rev 20376)
@@ -21,17 +21,17 @@
<ddm:dropDownMenu id="ddmenu" disabled="#{menuBean.disabled}" mode="#{menuBean.mode}">
<f:facet name="label">
<h:panelGroup>
- <h:graphicImage value="images/copy.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/copy.gif" styleClass="pic"/>
<h:outputText value="File"/>
</h:panelGroup>
</f:facet>
<f:facet name="labelDisabled">
<h:panelGroup>
- <h:graphicImage value="images/copy.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/copy.gif" styleClass="pic"/>
<h:outputText value="(disabled)File"/>
</h:panelGroup>
</f:facet>
- <ddm:menuItem id="menuNew" label="New" icon="images/create_doc.gif"
+ <ddm:menuItem id="menuNew" label="New" icon="/images/create_doc.gif"
action="#{menuBean.doNew}" execute="@form">
<f:facet name="icon">
<h:selectBooleanCheckbox id="checkbox" value="#{menuBean.checkbox}"/>
@@ -39,28 +39,28 @@
</ddm:menuItem>
<ddm:menuItem label="Open" action="#{menuBean.doOpen}">
<f:facet name="icon">
- <h:graphicImage value="images/open.gif" />
+ <h:graphicImage value="/images/open.gif" />
</f:facet>
</ddm:menuItem>
<ddm:menuGroup label="Save As..." disabled="true">
- <ddm:menuItem label="Save" icon="images/save.gif" >
+ <ddm:menuItem label="Save" icon="/images/save.gif" >
<f:facet name="icon">
- <h:graphicImage value="images/save.gif" />
+ <h:graphicImage value="/images/save.gif" />
</f:facet>
</ddm:menuItem>
- <ddm:menuItem label="Save All" icon="images/save_all.gif" >
+ <ddm:menuItem label="Save All" icon="/images/save_all.gif" >
<f:setPropertyActionListener target="#{menuBean.value}" value="Save All" />
</ddm:menuItem>
</ddm:menuGroup>
<ddm:menuGroup label="Save As...">
- <ddm:menuItem label="Save" icon="images/save.gif" >
+ <ddm:menuItem label="Save" icon="/images/save.gif" >
<f:setPropertyActionListener target="#{menuBean.value}" value="Save" />
</ddm:menuItem>
- <ddm:menuGroup label="Save All" icon="images/save_all.gif" >
- <ddm:menuItem label="Save All 1" icon="images/save_all.gif">
+ <ddm:menuGroup label="Save All" icon="/images/save_all.gif" >
+ <ddm:menuItem label="Save All 1" icon="/images/save_all.gif">
<f:setPropertyActionListener target="#{menuBean.value}" value="Save All 1" />
</ddm:menuItem>
- <ddm:menuItem label="Save All 2" icon="images/save_all.gif" >
+ <ddm:menuItem label="Save All 2" icon="/images/save_all.gif" >
<f:setPropertyActionListener target="#{menuBean.value}" value="Save All 2" />
</ddm:menuItem>
</ddm:menuGroup>
Modified: sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menugroup.template.xml
===================================================================
--- sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menugroup.template.xml 2010-12-03 17:30:21 UTC (rev 20375)
+++ sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menugroup.template.xml 2010-12-03 17:34:09 UTC (rev 20376)
@@ -41,7 +41,7 @@
<cdk:call expression="iconFacet.encodeAll(facesContext)" />
</c:when>
<c:when test="#{not empty iconAttribute}">
- <img width="16" height="16" src="#{iconAttribute}" alt="" />
+ <img width="16" height="16" src="#{RenderKitUtils.getResourceURL(iconAttribute, facesContext)}" alt="" />
</c:when>
<c:otherwise>
<div class="rf-ddm-emptyIcon"></div>
Modified: sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menuitem.template.xml
===================================================================
--- sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menuitem.template.xml 2010-12-03 17:30:21 UTC (rev 20375)
+++ sandbox/trunk/ui/dropdown-menu/ui/src/main/templates/menuitem.template.xml 2010-12-03 17:34:09 UTC (rev 20376)
@@ -44,7 +44,7 @@
<cdk:call expression="iconFacet.encodeAll(facesContext)" />
</c:when>
<c:when test="#{not empty iconAttribute}">
- <img width="16" height="16" src="#{iconAttribute}" alt="" />
+ <img width="16" height="16" src="#{RenderKitUtils.getResourceURL(iconAttribute, facesContext)}" alt="" />
</c:when>
<c:otherwise>
<div class="rf-ddm-emptyIcon"></div>
14 years, 1 month
JBoss Rich Faces SVN: r20375 - in trunk: examples/output-demo/src/main/webapp/WEB-INF and 11 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-12-03 12:30:21 -0500 (Fri, 03 Dec 2010)
New Revision: 20375
Added:
trunk/examples/output-demo/src/main/java/org/richfaces/MenuBean.java
trunk/examples/output-demo/src/main/webapp/examples/dropDownMenu.xhtml
trunk/examples/output-demo/src/main/webapp/images/ddmenu/
trunk/examples/output-demo/src/main/webapp/images/ddmenu/copy.gif
trunk/examples/output-demo/src/main/webapp/images/ddmenu/create_doc.gif
trunk/examples/output-demo/src/main/webapp/images/ddmenu/open.gif
trunk/examples/output-demo/src/main/webapp/images/ddmenu/save.gif
trunk/examples/output-demo/src/main/webapp/images/ddmenu/save_all.gif
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractDropDownMenu.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuItem.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuSeparator.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/MenuComponent.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/MenuSeparatorRendererBase.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/MenuNodeImage.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menugroup.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml
trunk/ui/output/ui/src/main/templates/menugroup.template.xml
trunk/ui/output/ui/src/main/templates/menuitem.template.xml
trunk/ui/output/ui/src/main/templates/menuseparator.template.xml
Modified:
trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/examples/output-demo/src/main/webapp/templates/template.xhtml
trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
trunk/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties
Log:
RF-9676 :Dropdown menu component was added.
Added: trunk/examples/output-demo/src/main/java/org/richfaces/MenuBean.java
===================================================================
--- trunk/examples/output-demo/src/main/java/org/richfaces/MenuBean.java (rev 0)
+++ trunk/examples/output-demo/src/main/java/org/richfaces/MenuBean.java 2010-12-03 17:30:21 UTC (rev 20375)
@@ -0,0 +1,70 @@
+package org.richfaces;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+
+@ManagedBean
+@SessionScoped
+public class MenuBean {
+ private String current;
+ private String mode = "server";
+ private boolean disabled = false;
+ private boolean checkbox = false;
+
+ public boolean isCheckbox() {
+ return checkbox;
+ }
+
+ public void setCheckbox(boolean checkbox) {
+ this.checkbox = checkbox;
+ }
+
+ public boolean isDisabled() {
+ return disabled;
+ }
+
+ public void setDisabled(boolean disabled) {
+ this.disabled = disabled;
+ }
+
+ public String getMode() {
+ return mode;
+ }
+
+ public void setMode(String mode) {
+ this.mode = mode;
+ }
+
+ public String getCurrent() {
+ return this.current;
+ }
+
+ public void setCurrent(String current) {
+ this.current = current;
+ }
+
+ public String doNew() {
+ this.current="New";
+ return null;
+ }
+ public String doOpen() {
+ this.current="Open";
+ return null;
+ }
+ public String doClose() {
+ this.current="Close";
+ return null;
+ }
+ public String doSave() {
+ this.current="Save";
+ return null;
+ }
+ public String doExit() {
+ this.current="Exit";
+ return null;
+ }
+
+ public void setValue(String value) {
+ this.current = value;
+ }
+}
Modified: trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-12-03 17:22:50 UTC (rev 20374)
+++ trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-12-03 17:30:21 UTC (rev 20375)
@@ -115,6 +115,12 @@
<from-outcome>toolbar</from-outcome>
<to-view-id>/examples/toolbar.xhtml</to-view-id>
</navigation-case>
-
+
+ <!-- DropDown Menu navigation -->
+ <navigation-case>
+ <from-outcome>dropDownMenu</from-outcome>
+ <to-view-id>/examples/dropDownMenu.xhtml</to-view-id>
+ </navigation-case>
+
</navigation-rule>
</faces-config>
Added: trunk/examples/output-demo/src/main/webapp/examples/dropDownMenu.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/dropDownMenu.xhtml (rev 0)
+++ trunk/examples/output-demo/src/main/webapp/examples/dropDownMenu.xhtml 2010-12-03 17:30:21 UTC (rev 20375)
@@ -0,0 +1,127 @@
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright ${year}, 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.
+-->
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:ddm="http://richfaces.org/output"
+ xmlns:a4j="http://richfaces.org/a4j">
+
+<body>
+<ui:composition template="/templates/template.xhtml">
+
+
+ <ui:define name="title">DROPDOWN MENU Development demo</ui:define>
+ <ui:define name="body_head">DROPDOWN MENU Development demo</ui:define>
+
+ <ui:define name="body">
+ <h:form id="form">
+ <h:panelGrid id="panel" columns="2">
+ <h:panelGroup layout="block" style="width:300px;">
+
+ <a4j:outputPanel ajaxRendered="true">
+ <h:outputText value="Current Selection: "></h:outputText>
+ <h:outputText style="font-weight:bold" value="#{menuBean.current}"></h:outputText>
+ </a4j:outputPanel>
+ <br />
+ <ddm:dropDownMenu id="ddmenu" disabled="#{menuBean.disabled}" mode="#{menuBean.mode}">
+ <f:facet name="label">
+ <h:panelGroup>
+ <h:graphicImage value="/images/ddmenu/copy.gif" styleClass="pic"/>
+ <h:outputText value="File"/>
+ </h:panelGroup>
+ </f:facet>
+ <f:facet name="labelDisabled">
+ <h:panelGroup>
+ <h:graphicImage value="/images/ddmenu/copy.gif" styleClass="pic"/>
+ <h:outputText value="(disabled)File"/>
+ </h:panelGroup>
+ </f:facet>
+ <ddm:menuItem id="menuNew" label="New" icon="/images/ddmenu/create_doc.gif"
+ action="#{menuBean.doNew}" execute="@form">
+ <f:facet name="icon">
+ <h:selectBooleanCheckbox id="checkbox" value="#{menuBean.checkbox}"/>
+ </f:facet>
+ </ddm:menuItem>
+ <ddm:menuItem label="Open" action="#{menuBean.doOpen}">
+ <f:facet name="icon">
+ <h:graphicImage value="/images/ddmenu/open.gif" />
+ </f:facet>
+ </ddm:menuItem>
+ <ddm:menuGroup label="Save As..." disabled="true">
+ <ddm:menuItem label="Save" icon="/images/ddmenu/save.gif" >
+ <f:facet name="icon">
+ <h:graphicImage value="/images/ddmenu/save.gif" />
+ </f:facet>
+ </ddm:menuItem>
+ <ddm:menuItem label="Save All" icon="/images/ddmenu/save_all.gif" >
+ <f:setPropertyActionListener target="#{menuBean.value}" value="Save All" />
+ </ddm:menuItem>
+ </ddm:menuGroup>
+ <ddm:menuGroup label="Save As...">
+ <ddm:menuItem label="Save" icon="/images/ddmenu/save.gif" >
+ <f:setPropertyActionListener target="#{menuBean.value}" value="Save" />
+ </ddm:menuItem>
+ <ddm:menuGroup label="Save All" icon="/images/ddmenu/save_all.gif" >
+ <ddm:menuItem label="Save All 1" icon="/images/ddmenu/save_all.gif">
+ <f:setPropertyActionListener target="#{menuBean.value}" value="Save All 1" />
+ </ddm:menuItem>
+ <ddm:menuItem label="Save All 2" icon="/images/ddmenu/save_all.gif" >
+ <f:setPropertyActionListener target="#{menuBean.value}" value="Save All 2" />
+ </ddm:menuItem>
+ </ddm:menuGroup>
+ </ddm:menuGroup>
+ <ddm:menuItem label="Close" action="#{menuBean.doClose}"/>
+ <ddm:menuItem label="Close" disabled="true"/>
+ <ddm:menuSeparator id="menuSeparator11" />
+ <ddm:menuItem label="Exit" action="#{menuBean.doExit}"/>
+ <ddm:menuItem action="#{menuBean.doExit}">
+ <h:inputText />
+ </ddm:menuItem>
+ </ddm:dropDownMenu>
+
+ </h:panelGroup>
+ <h:panelGrid columns="2">
+
+ <h:outputText value="Disabled" />
+ <h:selectBooleanCheckbox value="#{menuBean.disabled}">
+ <f:ajax event="click" execute="@form" render="ddmenu @this" />
+ </h:selectBooleanCheckbox>
+
+ <h:outputText value="Mode" />
+ <h:selectOneMenu value="#{menuBean.mode}" onchange="submit()">
+ <f:selectItem itemValue="server"/>
+ <f:selectItem itemValue="ajax"/>
+ <f:selectItem itemValue="client"/>
+ </h:selectOneMenu><br/>
+ </h:panelGrid>
+
+ </h:panelGrid>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</body>
+</html>
+
Added: trunk/examples/output-demo/src/main/webapp/images/ddmenu/copy.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/output-demo/src/main/webapp/images/ddmenu/copy.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/output-demo/src/main/webapp/images/ddmenu/create_doc.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/output-demo/src/main/webapp/images/ddmenu/create_doc.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/output-demo/src/main/webapp/images/ddmenu/open.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/output-demo/src/main/webapp/images/ddmenu/open.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/output-demo/src/main/webapp/images/ddmenu/save.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/output-demo/src/main/webapp/images/ddmenu/save.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/output-demo/src/main/webapp/images/ddmenu/save_all.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/output-demo/src/main/webapp/images/ddmenu/save_all.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/examples/output-demo/src/main/webapp/templates/template.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/templates/template.xhtml 2010-12-03 17:22:50 UTC (rev 20374)
+++ trunk/examples/output-demo/src/main/webapp/templates/template.xhtml 2010-12-03 17:30:21 UTC (rev 20375)
@@ -155,7 +155,20 @@
</ul>
</li>
</ul>
+
+ <p>DropDown Menu</p>
+ <ul>
+ <li>
+ <p>Examples</p>
+ <ul>
+ <li>
+ <h:commandLink value="DropDown Menu" action="dropDownMenu"/>
+ </li>
+ </ul>
+ </li>
+ </ul>
+
</h:form>
</td>
Added: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractDropDownMenu.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractDropDownMenu.java (rev 0)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractDropDownMenu.java 2010-12-03 17:30:21 UTC (rev 20375)
@@ -0,0 +1,75 @@
+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(defaultValue = MenuComponent.MODE_SERVER)
+ public abstract String getMode();
+
+ @Attribute
+ public abstract boolean isDisabled();
+
+ @Attribute(defaultValue = "800")
+ public abstract int getHideDelay();
+
+ @Attribute(defaultValue = "800")
+ public abstract int getShowDelay();
+
+ @Attribute(defaultValue = "250")
+ public abstract int getPopupWith();
+
+ @Attribute(defaultValue = "auto")
+ public abstract String getJointPoint();
+
+ @Attribute(defaultValue = "auto")
+ public abstract String getDirection();
+
+ @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();
+
+ @Attribute(events = @EventName("itemclick"))
+ public abstract String getOnitemclick();
+
+ 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: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java (rev 0)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java 2010-12-03 17:30:21 UTC (rev 20375)
@@ -0,0 +1,69 @@
+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 = "auto")
+ public abstract String getDirection();
+
+ @Attribute(defaultValue = "0")
+ public abstract String getVerticalOffset();
+
+ @Attribute(defaultValue = "0")
+ public abstract String 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: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuItem.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuItem.java (rev 0)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuItem.java 2010-12-03 17:30:21 UTC (rev 20375)
@@ -0,0 +1,54 @@
+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: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuSeparator.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuSeparator.java (rev 0)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuSeparator.java 2010-12-03 17:30:21 UTC (rev 20375)
@@ -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: trunk/ui/output/ui/src/main/java/org/richfaces/component/MenuComponent.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/MenuComponent.java (rev 0)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/MenuComponent.java 2010-12-03 17:30:21 UTC (rev 20375)
@@ -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: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java (rev 0)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2010-12-03 17:30:21 UTC (rev 20375)
@@ -0,0 +1,115 @@
+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";
+
+ public static final int DEFAULT_MIN_POPUP_WIDTH = 250;
+
+ @Override
+ public void renderChildren(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(FacesContext facesContext, UIComponent component) {
+ if (component instanceof AbstractDropDownMenu) {
+ return ((AbstractDropDownMenu) component).isDisabled();
+ }
+ return false;
+ }
+
+ protected UIComponent getLabelFacet(FacesContext facesContext, 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>();
+ if (component instanceof AbstractDropDownMenu) {
+ if (component.isRendered() && !((AbstractDropDownMenu) component).isDisabled()) {
+ 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());
+ map.put("direction", group.getDirection());
+ 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);
+ }
+ }
+ }
+
+ protected int getMinPopupWidth(FacesContext facesContext, UIComponent component) {
+ if (component instanceof AbstractDropDownMenu) {
+ ((AbstractDropDownMenu) component).getPopupWith();
+ }
+ return DEFAULT_MIN_POPUP_WIDTH;
+ }
+}
Added: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java (rev 0)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java 2010-12-03 17:30:21 UTC (rev 20375)
@@ -0,0 +1,94 @@
+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";
+
+ public static final int DEFAULT_MIN_POPUP_WIDTH = 250;
+
+ protected boolean isDisabled(FacesContext facesContext, 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(FacesContext facesContext, 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(FacesContext facesContext, 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(FacesContext facesContext, UIComponent component, String styleDDMenu, String styleMenuGroup) {
+ UIComponent ddMenu = getDDMenu(facesContext, 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(FacesContext facesContext, UIComponent component) {
+ UIComponent parent = component.getParent();
+ while (parent != null) {
+ if (parent instanceof AbstractDropDownMenu) {
+ return parent;
+ }
+ parent = parent.getParent();
+ }
+ return null;
+ }
+
+ protected int getMinPopupWidth(FacesContext facesContext, UIComponent component) {
+ UIComponent parent = getDDMenu(facesContext, component);
+ if (parent != null) {
+ return ((AbstractDropDownMenu) parent).getPopupWith();
+ }
+ return DEFAULT_MIN_POPUP_WIDTH;
+ }
+}
Added: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java (rev 0)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2010-12-03 17:30:21 UTC (rev 20375)
@@ -0,0 +1,176 @@
+package org.richfaces.renderkit.html;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIForm;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.javascript.JSFunction;
+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(FacesContext facesContext, UIComponent component) {
+ if (component instanceof AbstractMenuItem) {
+ return ((AbstractMenuItem) component).isDisabled();
+ }
+ return false;
+ }
+
+ protected UIComponent getIconFacet(FacesContext facesContext, 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(FacesContext facesContext, 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);
+ }
+ }
+ }
+
+ private UIComponent getUIForm(UIComponent component) {
+ if (component != null) {
+ UIComponent parent = component.getParent();
+ while (parent != null) {
+ if (parent instanceof UIForm) {
+ return parent;
+ }
+ parent = parent.getParent();
+ }
+ }
+ return null;
+ }
+
+ private String getServerSubmitFunction(UIComponent component) {
+ UIComponent form = getUIForm(component);
+ if (component != null && form != null) {
+ Map<String, Object> param = new HashMap<String, Object>();
+ param.put(component.getClientId(), component.getClientId());
+
+ JSFunction submitFunction = new JSFunction("RichFaces.submitForm");
+ submitFunction.addParameter(form.getClientId());
+ submitFunction.addParameter(param);
+
+ return submitFunction.toScript();
+ }
+
+ return "";
+ }
+
+ protected String getOnClickFunction(FacesContext facesContext, UIComponent component) {
+ AbstractMenuItem menuItem = (AbstractMenuItem) component;
+ String subminMode = resolveSubmitMode(menuItem);
+ if (subminMode == null || MenuComponent.MODE_SERVER.equalsIgnoreCase(subminMode)) {
+ return getServerSubmitFunction(menuItem);
+ } else if (MenuComponent.MODE_AJAX.equalsIgnoreCase(subminMode)) {
+ return getOnClick(facesContext, 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(FacesContext facesContext, UIComponent component, String ddMenuStyle, String menuGroupStyle, String menuItemStyle) {
+ UIComponent ddMenu = getDDMenu(facesContext, component);
+ UIComponent menuGroup = getMenuGroup(facesContext, 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));
+ }
+
+ /**
+ * Returns a parent <code>AbstractDropDownMenu</code> object of the given component.
+ * @param facesContext
+ * @param component
+ * @return <code>UIComponent</code>
+ */
+ protected UIComponent getDDMenu(FacesContext facesContext, UIComponent component) {
+ UIComponent parent = component.getParent();
+ while (parent != null) {
+ if (parent instanceof AbstractDropDownMenu) {
+ return parent;
+ }
+ parent = parent.getParent();
+ }
+ return null;
+ }
+
+ /**
+ * Returns a parent <code>AbstractMenuGroup</code> object of the given component.
+ * @param facesContext
+ * @param component
+ * @return <code>UIComponent</code>
+ */
+ protected UIComponent getMenuGroup(FacesContext facesContext, UIComponent component) {
+ UIComponent parent = component.getParent();
+ while (parent != null) {
+ if (parent instanceof AbstractMenuGroup) {
+ return parent;
+ }
+ parent = parent.getParent();
+ }
+ return null;
+ }
+}
Added: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/MenuSeparatorRendererBase.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/MenuSeparatorRendererBase.java (rev 0)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/MenuSeparatorRendererBase.java 2010-12-03 17:30:21 UTC (rev 20375)
@@ -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: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/MenuNodeImage.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/MenuNodeImage.java (rev 0)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/MenuNodeImage.java 2010-12-03 17:30:21 UTC (rev 20375)
@@ -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());
+ }
+}
Modified: trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-12-03 17:22:50 UTC (rev 20374)
+++ trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-12-03 17:30:21 UTC (rev 20375)
@@ -5,8 +5,591 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd" version="2.0" id="output">
<namespace>http://richfaces.org/output</namespace>
-
<tag>
+ <tag-name>dropDownMenu</tag-name>
+ <component>
+ <component-type>org.richfaces.DropDownMenu</component-type>
+ <renderer-type>org.richfaces.DropDownMenuRenderer</renderer-type>
+ </component>
+ <attribute>
+ <description>The value binding expression used to wire up this component to a component property of a JavaBean class</description>
+ <icon/>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <description>Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).</description>
+ <display-name>Direction</display-name>
+ <icon/>
+ <name>dir</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>direction</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>disabled</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>hideDelay</name>
+ <type>int</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value must be unique within the closest parent component that is a naming container.</description>
+ <display-name>Component Identifier</display-name>
+ <icon/>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>jointPoint</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Code describing the language used in the generated markup for this component.</description>
+ <display-name>Language Code</display-name>
+ <icon/>
+ <name>lang</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>mode</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is clicked over this element.</description>
+ <display-name>Button Click Script</display-name>
+ <icon/>
+ <name>onclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is double clicked over this element.</description>
+ <display-name>Double Click Script</display-name>
+ <icon/>
+ <name>ondblclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>ongrouphide</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>ongroupshow</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onhide</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a key is pressed down over this element.</description>
+ <display-name>Key Down Script</display-name>
+ <icon/>
+ <name>onkeydown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a key is pressed and released over this element.</description>
+ <display-name>Key Press Script</display-name>
+ <icon/>
+ <name>onkeypress</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a key is released over this element.</description>
+ <display-name>Key Up Script</display-name>
+ <icon/>
+ <name>onkeyup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is pressed down over this element.</description>
+ <display-name>Mouse Down Script</display-name>
+ <icon/>
+ <name>onmousedown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is moved within this element.</description>
+ <display-name>Mouse Move Script</display-name>
+ <icon/>
+ <name>onmousemove</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is moved away from this element.</description>
+ <display-name>Mouse Out Script</display-name>
+ <icon/>
+ <name>onmouseout</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is moved onto this element.</description>
+ <display-name>Mouse Over Script</display-name>
+ <icon/>
+ <name>onmouseover</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is released over this element.</description>
+ <display-name>Mouse Up Script</display-name>
+ <icon/>
+ <name>onmouseup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onshow</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>popupWith</name>
+ <type>int</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit. The default value for this property is true.</description>
+ <display-name>Rendered Flag</display-name>
+ <icon/>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>showDelay</name>
+ <type>int</type>
+ </attribute>
+ <attribute>
+ <name>showEvent</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>CSS style(s) to be applied when this component is rendered.</description>
+ <display-name>CSS Styles</display-name>
+ <icon/>
+ <name>style</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.</description>
+ <display-name>CSS Style Classes</display-name>
+ <icon/>
+ <name>styleClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Advisory title information about markup elements generated for this component.</description>
+ <display-name>Advisory Title</display-name>
+ <icon/>
+ <name>title</name>
+ <type>java.lang.String</type>
+ </attribute>
+ </tag>
+ <tag>
+ <tag-name>menuSeparator</tag-name>
+ <component>
+ <component-type>org.richfaces.MenuSeparator</component-type>
+ <renderer-type>org.richfaces.MenuSeparatorRenderer</renderer-type>
+ </component>
+ <attribute>
+ <description>The value binding expression used to wire up this component to a component property of a JavaBean class</description>
+ <icon/>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value must be unique within the closest parent component that is a naming container.</description>
+ <display-name>Component Identifier</display-name>
+ <icon/>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit. The default value for this property is true.</description>
+ <display-name>Rendered Flag</display-name>
+ <icon/>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ </tag>
+ <tag>
+ <tag-name>menuGroup</tag-name>
+ <component>
+ <component-type>org.richfaces.MenuGroup</component-type>
+ <renderer-type>org.richfaces.MenuGroupRenderer</renderer-type>
+ </component>
+ <attribute>
+ <description>The value binding expression used to wire up this component to a component property of a JavaBean class</description>
+ <icon/>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <description>Converter instance registered with this component.</description>
+ <display-name>Converter</display-name>
+ <icon/>
+ <name>converter</name>
+ <type>javax.faces.convert.Converter</type>
+ </attribute>
+ <attribute>
+ <description>Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).</description>
+ <display-name>Direction</display-name>
+ <icon/>
+ <name>dir</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>direction</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>disabled</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>horizontalOffset</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>icon</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>iconDisabled</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>iconFolder</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>iconFolderDisabled</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value must be unique within the closest parent component that is a naming container.</description>
+ <display-name>Component Identifier</display-name>
+ <icon/>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Code describing the language used in the generated markup for this component.</description>
+ <display-name>Language Code</display-name>
+ <icon/>
+ <name>lang</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is clicked over this element.</description>
+ <display-name>Button Click Script</display-name>
+ <icon/>
+ <name>onclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is double clicked over this element.</description>
+ <display-name>Double Click Script</display-name>
+ <icon/>
+ <name>ondblclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onhide</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a key is pressed down over this element.</description>
+ <display-name>Key Down Script</display-name>
+ <icon/>
+ <name>onkeydown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a key is pressed and released over this element.</description>
+ <display-name>Key Press Script</display-name>
+ <icon/>
+ <name>onkeypress</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a key is released over this element.</description>
+ <display-name>Key Up Script</display-name>
+ <icon/>
+ <name>onkeyup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is pressed down over this element.</description>
+ <display-name>Mouse Down Script</display-name>
+ <icon/>
+ <name>onmousedown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is moved within this element.</description>
+ <display-name>Mouse Move Script</display-name>
+ <icon/>
+ <name>onmousemove</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is moved away from this element.</description>
+ <display-name>Mouse Out Script</display-name>
+ <icon/>
+ <name>onmouseout</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is moved onto this element.</description>
+ <display-name>Mouse Over Script</display-name>
+ <icon/>
+ <name>onmouseover</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is released over this element.</description>
+ <display-name>Mouse Up Script</display-name>
+ <icon/>
+ <name>onmouseup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onshow</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit. The default value for this property is true.</description>
+ <display-name>Rendered Flag</display-name>
+ <icon/>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description>CSS style(s) to be applied when this component is rendered.</description>
+ <display-name>CSS Styles</display-name>
+ <icon/>
+ <name>style</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.</description>
+ <display-name>CSS Style Classes</display-name>
+ <icon/>
+ <name>styleClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Advisory title information about markup elements generated for this component.</description>
+ <display-name>Advisory Title</display-name>
+ <icon/>
+ <name>title</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>The current value of this component.</description>
+ <display-name>Value</display-name>
+ <icon/>
+ <name>value</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ <attribute>
+ <name>verticalOffset</name>
+ <type>java.lang.String</type>
+ </attribute>
+ </tag>
+ <tag>
+ <tag-name>menuItem</tag-name>
+ <component>
+ <component-type>org.richfaces.MenuItem</component-type>
+ <renderer-type>org.richfaces.MenuItemRenderer</renderer-type>
+ </component>
+ <attribute>
+ <description>MethodExpression representing the application action to invoke when this component is activated by the user. The expression must evaluate to a public method that takes no parameters, and returns an Object (the toString() of which is called to derive the logical outcome) which is passed to the NavigationHandler for this application.</description>
+ <display-name>Application Action</display-name>
+ <icon/>
+ <name>action</name>
+ <type>javax.faces.el.MethodBinding</type>
+ </attribute>
+ <attribute>
+ <description>MethodExpression representing the application action to invoke when this component is activated by the user. The expression must evaluate to a public method that takes no parameters, and returns an Object (the toString() of which is called to derive the logical outcome) which is passed to the NavigationHandler for this application.</description>
+ <display-name>Application Action</display-name>
+ <icon/>
+ <name>actionExpression</name>
+ <type>javax.el.MethodExpression</type>
+ </attribute>
+ <attribute>
+ <description><p> MethodExpression representing an action listener method that will be notified when this component is activated by the user. The expression must evaluate to a public method that takes an ActionEvent parameter, with a return type of void, <span class="changed_added_2_0">or to a public method that takes no arguments with a return type of void. In the latter case, the method has no way of easily knowing where the event came from, but this can be useful in cases where a notification is needed that "some action happened".</span> </p></description>
+ <display-name>Action Listener</display-name>
+ <icon/>
+ <name>actionListener</name>
+ <type>javax.faces.el.MethodBinding</type>
+ </attribute>
+ <attribute>
+ <description>The value binding expression used to wire up this component to a component property of a JavaBean class</description>
+ <icon/>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <description>Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).</description>
+ <display-name>Direction</display-name>
+ <icon/>
+ <name>dir</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>disabled</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>icon</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>iconDisabled</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value must be unique within the closest parent component that is a naming container.</description>
+ <display-name>Component Identifier</display-name>
+ <icon/>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating that, if this component is activated by the user, notifications should be delivered to interested listeners and actions immediately (that is, during Apply Request Values phase) rather than waiting until Invoke Application phase.</description>
+ <display-name>Immediate Action</display-name>
+ <icon/>
+ <name>immediate</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>label</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ <attribute>
+ <description>Code describing the language used in the generated markup for this component.</description>
+ <display-name>Language Code</display-name>
+ <icon/>
+ <name>lang</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>mode</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is clicked over this element.</description>
+ <display-name>Button Click Script</display-name>
+ <icon/>
+ <name>onclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is double clicked over this element.</description>
+ <display-name>Double Click Script</display-name>
+ <icon/>
+ <name>ondblclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a key is pressed down over this element.</description>
+ <display-name>Key Down Script</display-name>
+ <icon/>
+ <name>onkeydown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a key is pressed and released over this element.</description>
+ <display-name>Key Press Script</display-name>
+ <icon/>
+ <name>onkeypress</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a key is released over this element.</description>
+ <display-name>Key Up Script</display-name>
+ <icon/>
+ <name>onkeyup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is pressed down over this element.</description>
+ <display-name>Mouse Down Script</display-name>
+ <icon/>
+ <name>onmousedown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is moved within this element.</description>
+ <display-name>Mouse Move Script</display-name>
+ <icon/>
+ <name>onmousemove</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is moved away from this element.</description>
+ <display-name>Mouse Out Script</display-name>
+ <icon/>
+ <name>onmouseout</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is moved onto this element.</description>
+ <display-name>Mouse Over Script</display-name>
+ <icon/>
+ <name>onmouseover</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Javascript code executed when a pointer button is released over this element.</description>
+ <display-name>Mouse Up Script</display-name>
+ <icon/>
+ <name>onmouseup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit. The default value for this property is true.</description>
+ <display-name>Rendered Flag</display-name>
+ <icon/>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description>CSS style(s) to be applied when this component is rendered.</description>
+ <display-name>CSS Styles</display-name>
+ <icon/>
+ <name>style</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.</description>
+ <display-name>CSS Style Classes</display-name>
+ <icon/>
+ <name>styleClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Advisory title information about markup elements generated for this component.</description>
+ <display-name>Advisory Title</display-name>
+ <icon/>
+ <name>title</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>The current value of this component.</description>
+ <display-name>Value</display-name>
+ <icon/>
+ <name>value</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ </tag>
+ <tag>
<tag-name>toolbar</tag-name>
<component>
<component-type>org.richfaces.Toolbar</component-type>
Added: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss (rev 0)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss 2010-12-03 17:30:21 UTC (rev 20375)
@@ -0,0 +1,121 @@
+.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;
+}
+
+.rf-ddm-itm-ic input[type="checkbox"] {
+ margin:0;
+ width:16px;
+}
+
+.rf-ddm-itm-lbl input[type="text"] {
+ font-family:Arial,Verdana,sans-serif;
+ font-size:11px;
+ background-position:1px 1px;
+ background-repeat:no-repeat;
+ border-style:inset;
+ border-width:1px;
+}
Added: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js (rev 0)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js 2010-12-03 17:30:21 UTC (rev 20375)
@@ -0,0 +1,174 @@
+(function($, rf) {
+ rf.ui = rf.ui || {};
+
+ var defaultOptions = {
+ mode: 'server',
+ attachToBody: false,
+ positionOffset: [0, 0],
+ showDelay: 50,
+ hideDelay: 800,
+ verticalOffset: 0,
+ horisantalOffset: 0,
+ 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) {
+ $super.constructor.call(this, componentId);
+ this.id = componentId;
+ this.groupList = new Array();
+ this.options = {};
+ $.extend(this.options, defaultOptions, options || {});
+ this.attachToDom(componentId);
+
+ this.element = rf.getDomElement(this.id);
+
+ this.selectItemCss = this.options.selectItemCss;
+ this.unselectItemCss = this.options.unselectItemCss;
+
+ this.displayed = false;
+
+ this.options.attachTo = this.id;
+ this.options.positionOffset=[this.options.horisantalOffset, this.options.verticalOffset];
+ 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.___showHandler, this), this);
+ rf.Event.bindById(this.id, "mouseover", $.proxy(this.__overHandler, this), this);
+ rf.Event.bindById(this.id, "mouseleave", $.proxy(this.__leaveHandler, this), this);
+
+ };
+
+ 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 positionOffset = [groupOptions[i].horizontalOffset, groupOptions[i].verticalOffset]
+ var onshow = groupOptions[i].onshow;
+ var onhide = groupOptions[i].onhide;
+
+ var eventType = "mouseover";
+
+ if (null != groupId) {
+ //var popup = new RichFaces.ui.Popup(groupId + '_list', options);
+ var group= new RichFaces.ui.MenuGroup(groupId,{parentMenuId: this.id, onshow: onshow, onhide: onhide});
+ this.groupList[groupId] = group;
+ }
+ }
+ },
+
+ submitForm: function(item) {
+ var form = this.__getParentForm(item);
+ if (this.options.mode == "server") {
+ //rf.submitForm(form, {selectedMenuItem: item.id});
+ }
+ if (this.options.mode == "ajax") {
+ //rf.ajax(item.id);
+ }
+ },
+
+ processItem: function(item) {
+ if (item && item.attr('id') && !this.__isDisabled(item) && this.__isGroup(item)) {
+ this.invokeEvent("itemclick", rf.getDomElement(this.id), null);
+ this.hidePopup();
+ }
+ },
+
+ 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);
+// }
+
+ },
+
+ showPopup: function() {
+ if (!this.__isShown()){
+ this.invokeEvent("show", rf.getDomElement(this.id), null);
+ this.popupList.show();
+ this.displayed=true;
+ }
+ },
+
+ hidePopup: function() {
+ /* for (var i in this.groupList) {
+ this.groupList[i].hide();
+ }*/
+ if (this.__isShown()){
+ this.invokeEvent("hide", rf.getDomElement(this.id), null);
+ this.popupList.hide();
+ this.displayed=false;
+ }
+
+ },
+
+ __isGroup: function(item) {
+ return 'object' == typeof this.groupList[item.attr('id')];
+ },
+
+ __isDisabled: function(item) {
+ return item.hasClass(this.options.disabledItemCss);
+ },
+
+ __isShown: function() {
+ return this.displayed;
+
+ },
+
+ ___showHandler: function() {
+ this.showTimeoutId = window.setTimeout($.proxy(function(){
+ this.showPopup();
+ }, this), this.options.showDelay);
+ },
+
+ __getParentForm: function(item) {
+ return item.parents("form")[0];
+ },
+
+
+
+ __leaveHandler: function(e) {
+ window.clearTimeout(this.showTimeoutId);
+ this.hideTimeoutId = window.setTimeout($.proxy(function(){
+ this.hidePopup();
+ }, this), this.options.hideDelay);
+ },
+
+ __overHandler: function(e) {
+ window.clearTimeout(this.hideTimeoutId);
+ },
+
+ destroy: function() {
+ // clean up code here
+ this.detach(this.id);
+
+ // call parent's destroy method
+ $super.destroy.call(this);
+ }
+ };
+ })());
+})(jQuery, RichFaces)
\ No newline at end of file
Added: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menugroup.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menugroup.js (rev 0)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menugroup.js 2010-12-03 17:30:21 UTC (rev 20375)
@@ -0,0 +1,72 @@
+(function($, rf) {
+ rf.ui = rf.ui || {};
+ var defaultOptions = {
+ showEvent: 'mouseover',
+ attachToBody: false,
+ positionOffset: [0, 0],
+ selectItemCss: "rf-ddm-itm-sel",
+ listCss: "rf-ddm-lst"
+ }
+ //constructor definition
+ rf.ui.MenuGroup = function(componentId, options) {
+ this.id = componentId;
+ $super.constructor.call(this, componentId);
+ this.attachToDom(componentId);
+ this.options = {};
+ $.extend(this.options, defaultOptions, options || {});
+ this.parentMenu = rf.$(this.options.parentMenuId);
+ this.popup = new RichFaces.ui.Popup(this.id + '_list',
+ {attachTo: this.id,
+ positionOffset: this.options.positionOffset,
+ attachToBody: this.options.attachToBody
+ }
+ );
+ rf.Event.bindById(this.id, "mouseenter", $.proxy(this.__enterHandler,this), this);
+ rf.Event.bindById(this.id, "mouseleave",$.proxy(this.__leaveHandler,this), this);
+ this.shown = false;
+ };
+
+ rf.BaseComponent.extend(rf.ui.MenuGroup);
+
+ // define super class link
+ var $super = rf.ui.MenuGroup.$super;
+
+ $.extend(rf.ui.MenuGroup.prototype, (function() {
+ return {
+ name: "MenuGroup",
+ show: function() {
+ var id=this.id;
+ if (this.parentMenu.groupList[id] && !this.shown) {
+ this.parentMenu.invokeEvent("groupshow", rf.getDomElement(this.parentMenu.id), null);
+ this.invokeEvent("show", rf.getDomElement(id), null);
+ this.popup.show();
+ this.shown=true;
+ }
+ },
+ hide: function() {
+ var id=this.id;
+ var menu = this.parentMenu;
+ if (menu.groupList[this.id] && this.shown) {
+ menu.invokeEvent("grouphide", rf.getDomElement(menu.id), null);
+ this.invokeEvent("hide", rf.getDomElement(id), null);
+ this.popup.hide();
+ this.shown = false;
+ }
+ },
+
+ __enterHandler: function(){
+ this.show();
+ },
+ __leaveHandler: function(){
+ this.hide();
+ },
+ destroy: function() {
+ // clean up code here
+ this.detach(this.id);
+ // call parent's destroy method
+ $super.destroy.call(this);
+ }
+ }
+
+ })());
+})(jQuery, RichFaces)
\ No newline at end of file
Added: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js (rev 0)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js 2010-12-03 17:30:21 UTC (rev 20375)
@@ -0,0 +1,219 @@
+(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) {
+ 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
Modified: trunk/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties 2010-12-03 17:22:50 UTC (rev 20374)
+++ trunk/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties 2010-12-03 17:30:21 UTC (rev 20375)
@@ -38,4 +38,9 @@
org.richfaces.images\:TriangleLeft.png=org.richfaces.renderkit.html.iconimages.PanelMenuIconTriangleLeft
-org.richfaces.images\:TriangleUp.png=org.richfaces.renderkit.html.iconimages.PanelMenuIconTriangleUp
\ No newline at end of file
+org.richfaces.images\:TriangleUp.png=org.richfaces.renderkit.html.iconimages.PanelMenuIconTriangleUp
+
+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: trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml (rev 0)
+++ trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml 2010-12-03 17:30:21 UTC (rev 20375)
@@ -0,0 +1,63 @@
+<?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(facesContext, component)}" type="javax.faces.component.UIComponent" />
+ <cdk:object name="isDisabled" type="boolean" value="#{isDisabled(facesContext, 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>
+
+ <c:if test="#{not isDisabled(facesContext, component)}">
+ <div class="rf-ddm-pos">
+ <div id="#{clientId}_list" class="rf-ddm-lst" style="display:none;min-width:#{getMinPopupWidth(facesContext, component)}px;">
+ <div class="rf-ddm-lst-bg">
+ <cdk:call expression="renderChildren(facesContext, component)" />
+ </div>
+ </div>
+ </div>
+ <script type="text/javascript">
+ <cdk:scriptObject name="options">
+ <cdk:scriptOption attributes="hideDelay showDelay popupWith jointPoint direction mode" />
+ <cdk:scriptOption attributes="onshow onhide ongroupshow ongrouphide onitemclick" wrapper="eventHandler"/>
+ </cdk:scriptObject>
+
+ new RichFaces.ui.Menu(#{toScriptArgs(clientId, options)}).initiateGroups(#{toScriptArgs(getMenuGroups(facesContext, component))});
+
+ </script>
+ </c:if>
+ </div>
+ </cc:implementation>
+
+</cdk:root>
Added: trunk/ui/output/ui/src/main/templates/menugroup.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/menugroup.template.xml (rev 0)
+++ trunk/ui/output/ui/src/main/templates/menugroup.template.xml 2010-12-03 17:30:21 UTC (rev 20375)
@@ -0,0 +1,75 @@
+<?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>
+
+ <cdk:resource-dependency name="menugroup.js" library="org.richfaces" />
+ </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(facesContext, component, 'groupClass', 'styleClass')}" />
+ <cdk:object name="selectedClass" type="java.lang.String" value="#{getStyleClass(facesContext, component, 'selectedGroupClass', 'selectedClass')}" />
+ <cdk:object name="disabledClass" type="java.lang.String" value="#{getStyleClass(facesContext, component, 'disabledGroupClass', 'disabledClass')}" />
+
+ <cdk:object name="isDisabled" type="boolean" value="#{isDisabled(facesContext, component)}" />
+ <cdk:object name="iconFacet" value="#{getIconFacet(facesContext, component)}" type="javax.faces.component.UIComponent" />
+ <cdk:object name="iconAttribute" value="#{getIconAttribute(facesContext, 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}" 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="#{RenderKitUtils.getResourceURL(iconAttribute, facesContext)}" 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 id="#{clientId}_list" class="rf-ddm-lst rf-ddm-sublst" style="display:none;min-width:#{getMinPopupWidth(facesContext, component)}px;">
+ <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: trunk/ui/output/ui/src/main/templates/menuitem.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/menuitem.template.xml (rev 0)
+++ trunk/ui/output/ui/src/main/templates/menuitem.template.xml 2010-12-03 17:30:21 UTC (rev 20375)
@@ -0,0 +1,82 @@
+<?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>
+
+ <cdk:resource-dependency name="dropdownmenu.ecss" library="org.richfaces" />
+ <cdk:resource-dependency name="ajax.reslib" library="org.richfaces" />
+ <cdk:resource-dependency name="base-component.reslib" library="org.richfaces" />
+ </cc:interface>
+
+ <cc:implementation>
+ <cdk:object name="style" value="#{component.attributes['style']}" />
+ <cdk:object name="iconClass" type="java.lang.String" value="#{getStyleClass(facesContext, component, '', 'iconClass', 'iconClass')}" />
+ <cdk:object name="labelClass" type="java.lang.String" value="#{getStyleClass(facesContext, component, '', 'labelClass', 'labelClass')}" />
+ <cdk:object name="styleClass" type="java.lang.String" value="#{getStyleClass(facesContext, component, 'itemClass', 'styleClass', 'styleClass')}" />
+ <cdk:object name="selectedClass" type="java.lang.String" value="#{getStyleClass(facesContext, component, 'selectedItemClass', 'selectedClass', 'selectedClass')}" />
+ <cdk:object name="disabledClass" type="java.lang.String" value="#{getStyleClass(facesContext, component, 'disabledItemClass', 'disabledClass', 'disabledClass')}" />
+
+ <cdk:object name="isDisabled" type="boolean" value="#{isDisabled(facesContext, 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(facesContext, component)}" type="javax.faces.component.UIComponent" />
+ <cdk:object name="iconAttribute" value="#{getIconAttribute(facesContext, 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(facesContext, 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="#{RenderKitUtils.getResourceURL(iconAttribute, facesContext)}" 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: trunk/ui/output/ui/src/main/templates/menuseparator.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/menuseparator.template.xml (rev 0)
+++ trunk/ui/output/ui/src/main/templates/menuseparator.template.xml 2010-12-03 17:30:21 UTC (rev 20375)
@@ -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>
14 years, 1 month
JBoss Rich Faces SVN: r20374 - trunk/examples/output-demo/src/main/webapp/examples.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-12-03 12:22:50 -0500 (Fri, 03 Dec 2010)
New Revision: 20374
Modified:
trunk/examples/output-demo/src/main/webapp/examples/toolbar.xhtml
Log:
Modified: trunk/examples/output-demo/src/main/webapp/examples/toolbar.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/toolbar.xhtml 2010-12-03 17:21:42 UTC (rev 20373)
+++ trunk/examples/output-demo/src/main/webapp/examples/toolbar.xhtml 2010-12-03 17:22:50 UTC (rev 20374)
@@ -11,11 +11,11 @@
</style>
</h:head>
<h:body>
- <tb:toolbar height="45" itemSeparator="grid" contentStyle="color:red;">
+ <tb:toolbar height="45" itemSeparator="grid" itemStyle="color:red;" itemClass="custom-item">
<f:facet name="itemSeparator">
||
</f:facet>
- <tb:toolbarGroup itemSeparator="line" onitemclick="22">
+ <tb:toolbarGroup itemStyle="border: 1px solid green" itemClass="custom-item-group" itemSeparator="line" onitemclick="22">
<h:graphicImage value="/images/icons/create_doc.gif"/>
<a href="#">link 1</a> Text
<a href="#">link 2</a>
@@ -41,8 +41,8 @@
</tb:toolbarGroup>
</tb:toolbar>
<br/>
- <tb:toolbar itemSeparator="grid">
- <tb:toolbarGroup itemSeparator="line">
+ <tb:toolbar itemSeparator="grid" itemStyle="border: 1px solid green" itemClass="custom-item">
+ <tb:toolbarGroup itemSeparator="line" itemStyle="border: 1px solid green" itemClass="custom-item-group">
<h:graphicImage value="/images/icons/create_doc.gif"/>
<h:graphicImage value="/images/icons/create_folder.gif"/>
<h:graphicImage value="/images/icons/copy.gif"/>
14 years, 1 month