JBoss Rich Faces SVN: r19696 - in trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo: calendar and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-10-27 11:53:16 -0400 (Wed, 27 Oct 2010)
New Revision: 19696
Added:
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/calendar/
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/calendar/CalendarBean.java
Log:
https://jira.jboss.org/browse/RF-9175
Added: trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/calendar/CalendarBean.java
===================================================================
--- trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/calendar/CalendarBean.java (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/calendar/CalendarBean.java 2010-10-27 15:53:16 UTC (rev 19696)
@@ -0,0 +1,86 @@
+package org.richfaces.demo.calendar;
+
+import java.util.Date;
+import java.util.Locale;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+import javax.faces.event.ValueChangeEvent;
+
+@ManagedBean
+@RequestScoped
+public class CalendarBean {
+
+ private Locale locale;
+ private boolean popup;
+ private String pattern;
+ private Date selectedDate;
+ private boolean showApply = true;
+ private boolean useCustomDayLabels;
+
+ public CalendarBean() {
+
+ locale = Locale.US;
+ popup = true;
+ pattern = "d/M/yy HH:mm";
+ }
+
+ public Locale getLocale() {
+ return locale;
+ }
+
+ public void setLocale(Locale locale) {
+ this.locale = locale;
+ }
+
+ public boolean isPopup() {
+ return popup;
+ }
+
+ public void setPopup(boolean popup) {
+ this.popup = popup;
+ }
+
+ public String getPattern() {
+ return pattern;
+ }
+
+ public void setPattern(String pattern) {
+ this.pattern = pattern;
+ }
+
+ public void selectLocale(ValueChangeEvent event) {
+
+ String tLocale = (String) event.getNewValue();
+ if (tLocale != null) {
+ String lang = tLocale.substring(0, 2);
+ String country = tLocale.substring(3);
+ locale = new Locale(lang, country, "");
+ }
+ }
+
+ public boolean isUseCustomDayLabels() {
+ return useCustomDayLabels;
+ }
+
+ public void setUseCustomDayLabels(boolean useCustomDayLabels) {
+ this.useCustomDayLabels = useCustomDayLabels;
+ }
+
+ public Date getSelectedDate() {
+ return selectedDate;
+ }
+
+ public void setSelectedDate(Date selectedDate) {
+ this.selectedDate = selectedDate;
+ }
+
+ public boolean isShowApply() {
+ return showApply;
+ }
+
+ public void setShowApply(boolean showApply) {
+ this.showApply = showApply;
+ }
+
+}
\ No newline at end of file
15 years, 6 months
JBoss Rich Faces SVN: r19695 - in trunk/examples/richfaces-showcase/src/main/webapp/richfaces: calendar and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-10-27 11:48:22 -0400 (Wed, 27 Oct 2010)
New Revision: 19695
Added:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/calendar.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/samples/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/samples/calendar-sample.xhtml
Log:
https://jira.jboss.org/browse/RF-9175
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/calendar.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/calendar.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/calendar.xhtml 2010-10-27 15:48:22 UTC (rev 19695)
@@ -0,0 +1,19 @@
+<!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">
+
+<ui:composition>
+ <p>DESC</p>
+
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+</ui:composition>
+
+</html>
\ No newline at end of file
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/samples/calendar-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/samples/calendar-sample.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/samples/calendar-sample.xhtml 2010-10-27 15:48:22 UTC (rev 19695)
@@ -0,0 +1,14 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition 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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <rich:panel style="width:220px;">
+ <f:facet name="header">
+ <h:outputText value="Calendar"></h:outputText>
+ </f:facet>
+ <rich:calendar />
+ </rich:panel>
+</ui:composition>
\ No newline at end of file
15 years, 6 months
JBoss Rich Faces SVN: r19694 - in trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo: inplaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-10-27 11:46:45 -0400 (Wed, 27 Oct 2010)
New Revision: 19694
Added:
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/inplaces/
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/inplaces/InplaceSelectBean.java
Log:
https://jira.jboss.org/browse/RF-9208
Added: trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/inplaces/InplaceSelectBean.java
===================================================================
--- trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/inplaces/InplaceSelectBean.java (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/inplaces/InplaceSelectBean.java 2010-10-27 15:46:45 UTC (rev 19694)
@@ -0,0 +1,49 @@
+package org.richfaces.demo.inplaces;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ManagedProperty;
+import javax.faces.bean.RequestScoped;
+import javax.faces.model.SelectItem;
+
+import org.richfaces.demo.tables.model.capitals.Capital;
+
+@ManagedBean
+@RequestScoped
+public class InplaceSelectBean {
+ @ManagedProperty(value = "#{capitalsParser.capitalsList}")
+ private List<Capital> capitals;
+ private List<SelectItem> capitalsOptions = null;
+ private String value;
+
+ @PostConstruct
+ public void init() {
+ capitalsOptions = new ArrayList<SelectItem>();
+ for (Capital capital : capitals) {
+ capitalsOptions.add(new SelectItem(capital.getName(), capital.getState()));
+ }
+ }
+
+ public List<SelectItem> getCapitalsOptions() {
+ return capitalsOptions;
+ }
+
+ public void setCapitalsOptions(List<SelectItem> capitalsOptions) {
+ this.capitalsOptions = capitalsOptions;
+ }
+
+ public void setCapitals(List<Capital> capitals) {
+ this.capitals = capitals;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+}
15 years, 6 months
JBoss Rich Faces SVN: r19693 - in trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput: samples and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-10-27 11:46:07 -0400 (Wed, 27 Oct 2010)
New Revision: 19693
Added:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceSelect.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceSelect-sample.xhtml
Removed:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceInput.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceInput-sample.xhtml
Log:
https://jira.jboss.org/browse/RF-9208
Deleted: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceInput.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceInput.xhtml 2010-10-27 15:42:20 UTC (rev 19692)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceInput.xhtml 2010-10-27 15:46:07 UTC (rev 19693)
@@ -1,20 +0,0 @@
-<!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">
-
-<ui:composition>
- <p>InplaceInput is a simple input component which displays the current value as outputText and switches to inputText based representation after a defined event to allow editing this value.
-You could use simplest examples below. For the first demo, just click on a label to edit the value and click somewhere outside the component to store this value(Or just press ENTER button).</p>
-
- <ui:include src="#{demoNavigator.sampleIncludeURI}" />
- <ui:include src="/templates/includes/source-view.xhtml">
- <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
- <ui:param name="sourceType" value="xhtml" />
- <ui:param name="openLabel" value="View Source" />
- <ui:param name="hideLabel" value="Hide Source" />
- </ui:include>
-</ui:composition>
-
-</html>
\ No newline at end of file
Copied: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceSelect.xhtml (from rev 19681, trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceInput.xhtml)
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceSelect.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceSelect.xhtml 2010-10-27 15:46:07 UTC (rev 19693)
@@ -0,0 +1,21 @@
+<!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">
+
+<ui:composition>
+ <p><b>Inplace</b> Select is a simple input component which displays current
+ value as outputText and switches to Select based representation after a
+ defined event to allow editing this value.</p>
+
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+</ui:composition>
+
+</html>
\ No newline at end of file
Deleted: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceInput-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceInput-sample.xhtml 2010-10-27 15:42:20 UTC (rev 19692)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceInput-sample.xhtml 2010-10-27 15:46:07 UTC (rev 19693)
@@ -1,19 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition 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:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich">
- <rich:panel style="width:220px;">
- <f:facet name="header">
- <h:outputText value="Person Info"></h:outputText>
- </f:facet>
- <h:panelGrid columns="2">
- <h:outputText value="Name: " />
- <rich:inplaceInput value="click to enter your name" />
- <h:outputText value="Email:" />
- <rich:inplaceInput value="click to enter your email" />
- </h:panelGrid>
- </rich:panel>
-</ui:composition>
\ No newline at end of file
Copied: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceSelect-sample.xhtml (from rev 19681, trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceInput-sample.xhtml)
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceSelect-sample.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceSelect-sample.xhtml 2010-10-27 15:46:07 UTC (rev 19693)
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition 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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <h:form>
+ <p>Try the simplest example below. Just click on a label to edit
+ the value and click somewhere outside the component to store this
+ value(Or just press ENTER button).</p>
+ <rich:panel style="width:220px;">
+ <f:facet name="header">
+ <h:outputText value="Simples select"></h:outputText>
+ </f:facet>
+ <rich:inplaceSelect defaultLabel="Click here to edit"
+ openOnEdit="true" saveOnBlur="false">
+ <f:selectItem itemValue="0" itemLabel="Option 1" />
+ <f:selectItem itemValue="1" itemLabel="Option 2" />
+ <f:selectItem itemValue="2" itemLabel="Option 3" />
+ <f:selectItem itemValue="3" itemLabel="Option 4" />
+ <f:selectItem itemValue="4" itemLabel="Option 5" />
+ </rich:inplaceSelect>
+ </rich:panel>
+ <p>In that sample component customized in next way:
+ </p>
+ <ul>
+ <li><b>f:selectItems</b> tag is used to define a list of items to use.</li>
+ <li>Controls "save" and "cancel" are turned on with <b>showControls</b> attribute</li>
+ <li><b>editEvent</b> set to dblclick and used to switch to edit state.</li>
+ </ul>
+ <rich:panel style="width:220px;">
+ <f:facet name="header">
+ <h:outputText value="Select customization"></h:outputText>
+ </f:facet>
+ <rich:inplaceSelect editEvent="dblclick" id="inplaceSelect"
+ showControls="true" saveOnBlur="true"
+ value="#{inplaceSelectBean.value}" defaultLabel="Double click to edit value"
+ openOnEdit="true">
+ <f:selectItems value="#{inplaceSelectBean.capitalsOptions}" />
+ </rich:inplaceSelect>
+ </rich:panel>
+ </h:form>
+</ui:composition>
\ No newline at end of file
15 years, 6 months
JBoss Rich Faces SVN: r19692 - trunk/examples/richfaces-showcase/src/main/webapp/richfaces/poll/samples.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-10-27 11:42:20 -0400 (Wed, 27 Oct 2010)
New Revision: 19692
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/poll/samples/poll-sample.xhtml
Log:
https://jira.jboss.org/browse/RF-9543
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/poll/samples/poll-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/poll/samples/poll-sample.xhtml 2010-10-27 15:23:56 UTC (rev 19691)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/poll/samples/poll-sample.xhtml 2010-10-27 15:42:20 UTC (rev 19692)
@@ -6,7 +6,7 @@
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<h:form>
- <a4j:poll id="poll" interval="1500" enabled="#{pollBean.pollEnabled}"
+ <a4j:poll id="poll" interval="2000" enabled="#{pollBean.pollEnabled}"
render="poll,grid" />
</h:form>
15 years, 6 months
JBoss Rich Faces SVN: r19691 - in branches/RF-7817/ui/input: api and 10 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-10-27 11:23:56 -0400 (Wed, 27 Oct 2010)
New Revision: 19691
Added:
branches/RF-7817/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/ClientSelectItem.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/PopupConstants.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectHelper.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/ArrowBase.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBase.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBottom.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowTop.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowBottom.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowTop.java
branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js
branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.ecss
branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js
branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.ecss
branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.js
branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js
branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss
branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/selectList.js
branches/RF-7817/ui/input/ui/src/main/templates/inplaceSelect.template.xml
branches/RF-7817/ui/input/ui/src/main/templates/inputnumberspinner.template.xml
branches/RF-7817/ui/input/ui/src/main/templates/select.template.xml
Removed:
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
Modified:
branches/RF-7817/ui/input/
branches/RF-7817/ui/input/api/pom.xml
branches/RF-7817/ui/input/api/src/main/java/org/richfaces/component/InplaceState.java
branches/RF-7817/ui/input/ui/pom.xml
branches/RF-7817/ui/input/ui/src/main/config/faces-config.xml
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutocomplete.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteDivLayoutStrategy.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteEncodeStrategy.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteListLayoutStrategy.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteRendererBase.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteTableLayoutStrategy.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/InputRendererBase.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowBase.java
branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/view/facelets/AutocompleteHandler.java
branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.ecss
branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js
branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutocompleteBase.js
branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss
branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.ecss
branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js
branches/RF-7817/ui/input/ui/src/main/templates/autocomplete.template.xml
branches/RF-7817/ui/input/ui/src/main/templates/inplaceInput.template.xml
branches/RF-7817/ui/input/ui/src/main/templates/input.template.inc
branches/RF-7817/ui/input/ui/src/main/templates/inputnumberslider.template.xml
branches/RF-7817/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java
Log:
Merged revisions 19156-19157,19159-19160,19176,19186-19187,19190,19194,19196,19199,19203-19204,19231-19234,19248-19249,19255-19256,19258-19262,19276,19279-19281,19283,19285,19291-19299,19307,19312,19315,19318-19319,19325,19341-19342,19345-19351,19353-19355,19358-19359,19364,19367-19369,19371,19374-19377,19379-19385,19387,19393-19394,19400,19402-19404,19418-19422,19426,19430-19431,19434-19441,19443-19444,19446,19468,19470,19477,19491,19498-19499,19501,19504,19506-19507,19517-19519,19525,19542-19543,19548,19550,19555,19557,19560-19561,19565-19566,19571-19573,19582-19585,19592-19593,19599,19601-19602,19613,19646,19657-19659,19665,19671-19674 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
Property changes on: branches/RF-7817/ui/input
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.project
.classpath
.clover
.externalToolBuilders
Modified: branches/RF-7817/ui/input/api/pom.xml
===================================================================
--- branches/RF-7817/ui/input/api/pom.xml 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/api/pom.xml 2010-10-27 15:23:56 UTC (rev 19691)
@@ -34,6 +34,14 @@
<name>Richfaces UI Components: Input API</name>
<packaging>jar</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
<dependencies>
<!-- runtime -->
<dependency>
Copied: branches/RF-7817/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java (from rev 19674, trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java)
===================================================================
--- branches/RF-7817/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java (rev 0)
+++ branches/RF-7817/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.component;
+
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public interface InplaceComponent {
+
+ public String getDefaultLabel();
+
+ public String getEditEvent();
+
+ public boolean isShowControls();
+
+ public boolean isSaveOnBlur();
+
+ public InplaceState getState();
+
+ public String getReadyStateCss();
+
+ public String getEditStateCss();
+
+ public String getChangedStateCss();
+
+ public String getDisableStateCss();
+
+ public String getEditCss();
+
+ public String getNoneCss();
+
+}
Modified: branches/RF-7817/ui/input/api/src/main/java/org/richfaces/component/InplaceState.java
===================================================================
--- branches/RF-7817/ui/input/api/src/main/java/org/richfaces/component/InplaceState.java 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/api/src/main/java/org/richfaces/component/InplaceState.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -19,10 +19,18 @@
* 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;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+
public enum InplaceState {
ready,
edit,
- changed
+ changed,
+ disable
}
Modified: branches/RF-7817/ui/input/ui/pom.xml
===================================================================
--- branches/RF-7817/ui/input/ui/pom.xml 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/pom.xml 2010-10-27 15:23:56 UTC (rev 19691)
@@ -40,6 +40,9 @@
<groupId>org.richfaces.cdk</groupId>
<artifactId>maven-cdk-plugin</artifactId>
</plugin>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
</plugins>
</build>
Modified: branches/RF-7817/ui/input/ui/src/main/config/faces-config.xml
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/config/faces-config.xml 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/config/faces-config.xml 2010-10-27 15:23:56 UTC (rev 19691)
@@ -151,6 +151,14 @@
</property-extension>
</property>
<property>
+ <property-name>onchange</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name default="true">change</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
<property-name>showArrows</property-name>
<property-class>boolean</property-class>
<default-value>false</default-value>
@@ -237,6 +245,304 @@
</cdk:tag>
</component-extension>
</component>
+ <component>
+ <component-type>org.richfaces.InputNumberSpinner</component-type>
+ <component-class>org.richfaces.component.html.HtmlInputNumberSpinner</component-class>
+ <property>
+ <property-name>accesskey</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>disabled</property-name>
+ <property-class>boolean</property-class>
+ <default-value>false</default-value>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>cycled</property-name>
+ <property-class>boolean</property-class>
+ <default-value>true</default-value>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>enableManualInput</property-name>
+ <property-class>boolean</property-class>
+ <default-value>true</default-value>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>inputClass</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>inputSize</property-name>
+ <property-class>int</property-class>
+ <default-value>10</default-value>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>maxValue</property-name>
+ <property-class>java.lang.String</property-class>
+ <default-value>"100"</default-value>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>minValue</property-name>
+ <property-class>java.lang.String</property-class>
+ <default-value>"0"</default-value>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>minValue</property-name>
+ <property-class>java.lang.String</property-class>
+ <default-value>"0"</default-value>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onblur</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>blur</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onchange</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name default="true">change</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onclick</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>click</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>ondblclick</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>dblclick</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>ondownclick</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>downclick</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onfocus</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>focus</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>oninputclick</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>inputclick</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>oninputdblclick</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>inputdblclick</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>oninputkeydown</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>inputkeydown</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>oninputkeypress</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>inputkeypress</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>oninputkeyup</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>inputkeyup</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>oninputmousedown</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>inputmousedown</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>oninputmousemove</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>inputmousemove</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>oninputmouseout</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>inputmouseout</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>oninputmouseover</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>inputmouseover</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>oninputmouseup</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>inputmouseup</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onmousedown</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>mousedown</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onmousemove</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>mousemove</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onmouseout</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>mouseout</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onmouseover</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>mouseover</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onmouseup</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>mouseup</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onselect</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>select</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onupclick</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name>upclick</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>step</property-name>
+ <property-class>java.lang.String</property-class>
+ <default-value>"1"</default-value>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>style</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>styleClass</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>tabindex</property-name>
+ <property-class>int</property-class>
+ <default-value>Integer.MIN_VALUE</default-value>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <component-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:base-class>javax.faces.component.UIInput</cdk:base-class>
+ <cdk:component-family>javax.faces.Input</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.InputNumberSpinnerRenderer</cdk:renderer-type>
+ <cdk:tag>
+ <cdk:tag-name>inputNumberSpinner</cdk:tag-name>
+ <cdk:tag-type>Facelets</cdk:tag-type>
+ </cdk:tag>
+ </component-extension>
+ </component>
<faces-config-extension>
<cdk:taglib>
<cdk:shortName>input</cdk:shortName>
Modified: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutocomplete.java
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutocomplete.java 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutocomplete.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -82,7 +82,7 @@
@Attribute
public abstract String getFilterFunction();
- @Attribute(defaultValue = "rf-au-select")
+ @Attribute(defaultValue = "rf-au-sel")
public abstract String getSelectedItemClass();
@Attribute
@@ -177,13 +177,10 @@
@Attribute(events = @EventName("focus"))
public abstract String getOnfocus();
+
+ @Attribute(events = @EventName("selectitem"))
+ public abstract String getOnselectitem();
- @Attribute(events = @EventName("listblur"))
- public abstract String getOnlistblur();
-
- @Attribute(events = @EventName("listfocus"))
- public abstract String getOnlistfocus();
-
@Attribute(events = @EventName("begin"))
public abstract String getOnbegin();
Modified: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -40,7 +40,7 @@
renderer = @JsfRenderer(type = "org.richfaces.InplaceInputRenderer"),
tag = @Tag(name="inplaceInput")
)
-public abstract class AbstractInplaceInput extends UIInput {
+public abstract class AbstractInplaceInput extends UIInput implements InplaceComponent {
public static final String COMPONENT_TYPE = "org.richfaces.InplaceInput";
@@ -49,6 +49,9 @@
@Attribute
public abstract String getDefaultLabel();
+ @Attribute(defaultValue="true")
+ public abstract boolean isSaveOnBlur();
+
@Attribute(defaultValue="InplaceState.ready")
public abstract InplaceState getState();
@@ -64,6 +67,24 @@
@Attribute
public abstract String getTabIndex();
+ @Attribute
+ public abstract String getReadyStateCss();
+
+ @Attribute
+ public abstract String getEditStateCss();
+
+ @Attribute
+ public abstract String getChangedStateCss();
+
+ @Attribute
+ public abstract String getDisableStateCss();
+
+ @Attribute
+ public abstract String getEditCss();
+
+ @Attribute
+ public abstract String getNoneCss();
+
@Attribute(events=@EventName("blur"))
public abstract String getOnblur();
@@ -100,47 +121,47 @@
@Attribute(events=@EventName("mouseup"))
public abstract String getOnmouseup();
- @Attribute(events=@EventName("inputClick"))
- public abstract String getOnInputClick();
+ @Attribute(events=@EventName("inputclick"))
+ public abstract String getOninputclick();
- @Attribute(events=@EventName("inputDblclick"))
- public abstract String getOnInputDblclick();
+ @Attribute(events=@EventName("inputdblclick"))
+ public abstract String getOninputdblclick();
- @Attribute(events=@EventName("inputMousedown"))
- public abstract String getOnInputMousedown();
+ @Attribute(events=@EventName("inputmousedown"))
+ public abstract String getOninputmousedown();
- @Attribute(events=@EventName("inputMousemove"))
- public abstract String getOnInputMousemove();
+ @Attribute(events=@EventName("inputmousemove"))
+ public abstract String getOninputmousemove();
- @Attribute(events=@EventName("inputMouseout"))
- public abstract String getOnInputMouseout();
+ @Attribute(events=@EventName("inputmouseout"))
+ public abstract String getOninputmouseout();
- @Attribute(events=@EventName("inputMouseover"))
- public abstract String getOnInputMouseover();
+ @Attribute(events=@EventName("inputmouseover"))
+ public abstract String getOninputmouseover();
- @Attribute(events=@EventName("inputMouseup"))
- public abstract String getOnInputMouseup();
+ @Attribute(events=@EventName("inputmouseup"))
+ public abstract String getOninputmouseup();
- @Attribute(events=@EventName("inputKeydown"))
- public abstract String getOnInputKeydown();
+ @Attribute(events=@EventName("inputkeydown"))
+ public abstract String getOninputkeydown();
- @Attribute(events=@EventName("inputKeypress"))
- public abstract String getOnInputKeypress();
+ @Attribute(events=@EventName("inputkeypress"))
+ public abstract String getOninputkeypress();
- @Attribute(events=@EventName("oninputKeyup"))
- public abstract String getOnInputKeypup();
+ @Attribute(events=@EventName("inputkeyup"))
+ public abstract String getOninputkeypup();
- @Attribute(events=@EventName("inputFocus"))
- public abstract String getOnInputFocus();
+ @Attribute(events=@EventName("inputfocus"))
+ public abstract String getOninputfocus();
- @Attribute(events=@EventName("inputBlur"))
- public abstract String getOnInputBlur();
+ @Attribute(events=@EventName("inputblur"))
+ public abstract String getOninputblur();
- @Attribute(events=@EventName("select"))
- public abstract String getOnselect();
+ @Attribute(events=@EventName("inputselect"))
+ public abstract String getOninputselect();
- @Attribute(events=@EventName("change"))
- public abstract String getOnchange();
+ @Attribute(events=@EventName("inputchange"))
+ public abstract String getOninputchange();
//TODO: what is default event?, add onViewActivated, onEditActivated events support
}
Copied: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java (from rev 19674, trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.component;
+
+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;
+
+
+/**
+ * @author Anton Belevich
+ *
+ */
+
+@JsfComponent(
+ type = AbstractInplaceSelect.COMPONENT_TYPE,
+ family = AbstractInplaceSelect.COMPONENT_FAMILY,
+ generate = "org.richfaces.component.UIInplaceSelect",
+ renderer = @JsfRenderer(type = "org.richfaces.InplaceSelectRenderer"),
+ tag = @Tag(name="inplaceSelect")
+)
+public abstract class AbstractInplaceSelect extends AbstractSelect implements InplaceComponent {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.InplaceSelect";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.Select";
+
+ @Attribute(defaultValue="InplaceState.ready")
+ public abstract InplaceState getState();
+
+ @Attribute(defaultValue="false")
+ public abstract boolean isOpenOnEdit();
+
+ @Attribute(defaultValue="true")
+ public abstract boolean isSaveOnBlur();
+
+ @Attribute(defaultValue="false")
+ public abstract boolean isShowControls();
+
+ @Override
+ @Attribute
+ public abstract String getItemCss();
+
+ @Override
+ @Attribute
+ public abstract String getSelectItemCss();
+
+ @Override
+ @Attribute
+ public abstract String getListCss();
+
+
+ @Attribute(defaultValue="click")
+ public abstract String getEditEvent();
+
+ @Attribute(events=@EventName("inputclick"))
+ public abstract String getOninputclick();
+
+ @Attribute(events=@EventName("inputdblclick"))
+ public abstract String getOninputdblclick();
+
+ @Attribute(events=@EventName("inputmousedown"))
+ public abstract String getOninputmousedown();
+
+ @Attribute(events=@EventName("inputmousemove"))
+ public abstract String getOninputmousemove();
+
+ @Attribute(events=@EventName("inputmouseout"))
+ public abstract String getOninputmouseout();
+
+ @Attribute(events=@EventName("inputmouseover"))
+ public abstract String getOninputmouseover();
+
+ @Attribute(events=@EventName("inputmouseup"))
+ public abstract String getOninputmouseup();
+
+ @Attribute(events=@EventName("inputkeydown"))
+ public abstract String getOninputkeydown();
+
+ @Attribute(events=@EventName("inputkeypress"))
+ public abstract String getOninputkeypress();
+
+ @Attribute(events=@EventName("inputkeyup"))
+ public abstract String getOninputkeypup();
+
+ @Attribute(events=@EventName("inputfocus"))
+ public abstract String getOninputfocus();
+
+ @Attribute(events=@EventName("inputblur"))
+ public abstract String getOninputblur();
+
+ @Attribute(events=@EventName("inputselect"))
+ public abstract String getOninputselect();
+
+ @Attribute(events=@EventName("inputchange"))
+ public abstract String getOnchange();
+
+}
Copied: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java (from rev 19674, trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,149 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.component;
+
+import javax.faces.component.UISelectOne;
+
+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;
+
+/**
+ * @author abelevich
+ *
+ */
+@JsfComponent(
+ type = AbstractSelect.COMPONENT_TYPE,
+ family = AbstractSelect.COMPONENT_FAMILY,
+ generate = "org.richfaces.component.UISelect",
+ renderer = @JsfRenderer(type = "org.richfaces.SelectRenderer"),
+ tag = @Tag(name="select")
+)
+public abstract class AbstractSelect extends UISelectOne {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.Select";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.Select";
+
+ @Attribute(defaultValue="250px")
+ public abstract String getListWidth();
+
+ @Attribute(defaultValue="100px")
+ public abstract String getListHeight();
+
+ @Attribute(defaultValue="true")
+ public abstract boolean isShowButton();
+
+ @Attribute(defaultValue="false")
+ public abstract boolean isEnableManualInput();
+
+ @Attribute(defaultValue="true")
+ public abstract boolean isSelectFirst();
+
+ @Attribute
+ public abstract String getDefaultLabel();
+
+ @Attribute
+ public abstract String getItemCss();
+
+ @Attribute
+ public abstract String getSelectItemCss();
+
+ @Attribute
+ public abstract String getListCss();
+
+ @Attribute(events=@EventName("blur"))
+ public abstract String getOnblur();
+
+ @Attribute(events=@EventName("click"))
+ public abstract String getOnclick();
+
+ @Attribute(events=@EventName("dblclick"))
+ public abstract String getOndblclick();
+
+ @Attribute(events=@EventName("focus"))
+ public abstract String getOnfocus();
+
+ @Attribute(events=@EventName("keydown"))
+ public abstract String getOnkeydown();
+
+ @Attribute(events=@EventName("keypress"))
+ public abstract String getOnkeypress();
+
+ @Attribute(events=@EventName("keyup"))
+ public abstract String getOnkeypup();
+
+ @Attribute(events=@EventName("mousedown"))
+ public abstract String getOnmousedown();
+
+ @Attribute(events=@EventName("mousemove"))
+ public abstract String getOnmousemove();
+
+ @Attribute(events=@EventName("mouseout"))
+ public abstract String getOnmouseout();
+
+ @Attribute(events=@EventName("mouseover"))
+ public abstract String getOnmouseover();
+
+ @Attribute(events=@EventName("mouseup"))
+ public abstract String getOnmouseup();
+
+ @Attribute(events=@EventName("listclick"))
+ public abstract String getOnlistclick();
+
+ @Attribute(events=@EventName("listdblclick"))
+ public abstract String getOnlistdblclick();
+
+ @Attribute(events=@EventName("listmousedown"))
+ public abstract String getOnlistmousedown();
+
+ @Attribute(events=@EventName("listmouseup"))
+ public abstract String getOnlistmouseup();
+
+ @Attribute(events=@EventName("listmouseover"))
+ public abstract String getOnlistmouseover();
+
+ @Attribute(events=@EventName("listmousemove"))
+ public abstract String getOnlistmousemove();
+
+ @Attribute(events=@EventName("listmouseout"))
+ public abstract String getOnlistmouseout();
+
+ @Attribute(events=@EventName("listkeypress"))
+ public abstract String getOnlistkeypress();
+
+ @Attribute(events=@EventName("listkeydown"))
+ public abstract String getOnlistkeydown();
+
+ @Attribute(events=@EventName("listkeyup"))
+ public abstract String getOnlistkeyup();
+
+ @Attribute(events=@EventName("select"))
+ public abstract String getOnselect();
+
+ @Attribute(events=@EventName("change"))
+ public abstract String getOnchange();
+
+}
Modified: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteDivLayoutStrategy.java
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteDivLayoutStrategy.java 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteDivLayoutStrategy.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -52,7 +52,7 @@
}
public void encodeItemBegin(FacesContext facesContext, UIComponent component) throws IOException {
- ResponseWriter writer = facesContext.getResponseWriter();
+ ResponseWriter writer = facesContext.getResponseWriter();
writer.startElement(HtmlConstants.DIV_ELEM, component);
}
@@ -61,4 +61,15 @@
writer.endElement(HtmlConstants.DIV_ELEM);
}
+ public void encodeItem(FacesContext facesContext, UIComponent component) throws IOException {
+ ResponseWriter writer = facesContext.getResponseWriter();
+ encodeItemBegin(facesContext, component);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-au-opt rf-au-fnt rf-au-inp", null);
+ for (UIComponent child : component.getChildren()) {
+ child.encodeAll(facesContext);
+ }
+ encodeItemEnd(facesContext, component);
+
+ }
+
}
Modified: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteEncodeStrategy.java
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteEncodeStrategy.java 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteEncodeStrategy.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -15,6 +15,8 @@
void encodeItemBegin(FacesContext facesContext, UIComponent component) throws IOException ;
void encodeItemEnd(FacesContext facesContext, UIComponent component) throws IOException ;
+
+ void encodeItem(FacesContext facesContext, UIComponent component) throws IOException ;
void encodeFakeItem(FacesContext facesContext, UIComponent component) throws IOException ;
Modified: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteListLayoutStrategy.java
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteListLayoutStrategy.java 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteListLayoutStrategy.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -31,7 +31,7 @@
}
public void encodeItemBegin(FacesContext facesContext, UIComponent component) throws IOException {
- ResponseWriter writer = facesContext.getResponseWriter();
+ ResponseWriter writer = facesContext.getResponseWriter();
writer.startElement(HtmlConstants.LI_ELEMENT, component);
}
@@ -39,5 +39,16 @@
ResponseWriter writer = facesContext.getResponseWriter();
writer.endElement(HtmlConstants.LI_ELEMENT);
}
+
+ public void encodeItem(FacesContext facesContext, UIComponent component) throws IOException {
+ ResponseWriter writer = facesContext.getResponseWriter();
+ encodeItemBegin(facesContext, component);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-au-opt rf-au-fnt rf-au-inp", null);
+ for (UIComponent child : component.getChildren()) {
+ child.encodeAll(facesContext);
+ }
+ encodeItemEnd(facesContext, component);
+
+ }
}
Modified: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteRendererBase.java
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteRendererBase.java 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteRendererBase.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -24,7 +24,6 @@
import java.io.IOException;
import java.sql.ResultSet;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -47,23 +46,20 @@
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.javascript.JSFunctionDefinition;
-import org.ajax4jsf.javascript.ScriptUtils;
import org.richfaces.component.AbstractAutocomplete;
import org.richfaces.component.AutocompleteLayout;
import org.richfaces.component.MetaComponentResolver;
import org.richfaces.component.util.InputUtils;
-import org.richfaces.renderkit.util.RendererUtils;
import com.google.common.base.Predicates;
import com.google.common.collect.Iterators;
/**
* @author Nick Belaevski
- *
*/
-@ResourceDependencies({
+@ResourceDependencies({
@ResourceDependency(library = "org.richfaces", name = "ajax.reslib"),
- @ResourceDependency(library = "org.richfaces", name = "base-component.reslib"),
+ @ResourceDependency(library = "org.richfaces", name = "base-component.reslib"),
@ResourceDependency(name = "jquery.position.js"), @ResourceDependency(name = "richfaces-event.js"),
@ResourceDependency(name = "richfaces-selection.js"),
@ResourceDependency(library = "org.richfaces", name = "AutocompleteBase.js"),
@@ -75,52 +71,19 @@
public JSFunctionDefinition getClientFilterFunction(UIComponent component) {
AbstractAutocomplete autocomplete = (AbstractAutocomplete) component;
- String clientFilter = (String)autocomplete.getAttributes().get("clientFilter");
+ String clientFilter = (String) autocomplete.getAttributes().get("clientFilter");
if (clientFilter != null && clientFilter.length() != 0) {
JSFunctionDefinition clientFilterFunction = new JSFunctionDefinition("subString");
clientFilterFunction.addParameter("value");
clientFilterFunction.addToBody(clientFilter);
return clientFilterFunction;
}
-
+
return null;
}
- public String getScriptOptions(UIComponent component) {
- Map<String, Object> attributes = component.getAttributes();
- Map<String, Object> options = new HashMap<String, Object>();
- RendererUtils utils = getUtils();
- utils.addToScriptHash(options, "buttonId", component.getClientId() + "Button");
- utils.addToScriptHash(options, "selectedItemClass", attributes.get("selectedItemClass"));
- utils.addToScriptHash(options, "minChars", attributes.get("minChars"), "1");
- utils.addToScriptHash(options, "filterFunction", attributes.get("filterFunction"));
- utils.addToScriptHash(options, "autofill", attributes.get("autofill"), "true");
- utils.addToScriptHash(options, "disabled", attributes.get("disabled"), "false");
- utils.addToScriptHash(options, "selectFirst", attributes.get("selectFirst"), "true");
- utils.addToScriptHash(options, "tokens", attributes.get("tokens"));
- utils.addToScriptHash(options, "onbegin", attributes.get("onbegin"));
- utils.addToScriptHash(options, "oncomplete", attributes.get("oncomplete"));
- utils.addToScriptHash(options, "onerror", attributes.get("onerror"));
- utils.addToScriptHash(options, "onbeforedomupdate", attributes.get("onbeforedomupdate"));
- utils.addToScriptHash(options, "onchange", attributes.get("onchange"));
- utils.addToScriptHash(options, "filterFunction", getClientFilterFunction(component));
- String mode = (String)attributes.get("mode");
- if (mode != null) {
- if (mode.equals("ajax")){
- utils.addToScriptHash(options, "isCachedAjax", false, "true");
- } else if (mode.equals("client") || mode.equals("lazyClient")) {
- utils.addToScriptHash(options, "ajaxMode", false, "true");
- if (mode.equals("lazyClient")) {
- utils.addToScriptHash(options, "lazyClientMode", true, "false");
- }
- }
- }
- StringBuilder builder = new StringBuilder();
- builder.append(ScriptUtils.toScript(options));
- return builder.toString();
- }
-
// TODO nick - handle parameter
+
@SuppressWarnings("unchecked")
private DataModel<Object> getItems(FacesContext facesContext, AbstractAutocomplete component) {
Object itemsObject = null;
@@ -132,16 +95,16 @@
try {
// String value = getInputValue(facesContext, component);
- itemsObject = autocompleteMethod.invoke(facesContext.getELContext(), new Object[] { facesContext,
- component, value });
+ itemsObject = autocompleteMethod.invoke(facesContext.getELContext(), new Object[]{facesContext,
+ component, value});
} catch (ELException e) {
try {
autocompleteMethod = facesContext
.getApplication()
.getExpressionFactory()
.createMethodExpression(facesContext.getELContext(), autocompleteMethod.getExpressionString(),
- Void.class, new Class[] { String.class });
- itemsObject = autocompleteMethod.invoke(facesContext.getELContext(), new Object[] { value });
+ Void.class, new Class[]{String.class});
+ itemsObject = autocompleteMethod.invoke(facesContext.getELContext(), new Object[]{value});
} catch (ELException ee) {
ee.printStackTrace();
}
@@ -214,10 +177,10 @@
// TODO use converter
if (comboBox.getItemConverter() != null) {
fetchValues.add(comboBox.getItemConverter().getAsString(facesContext, component, nextItem));
- } else{
+ } else {
fetchValues.add(nextItem);
- }
-
+ }
+
}
}
@@ -233,7 +196,7 @@
protected void encodeItemsContainer(FacesContext facesContext, UIComponent component) throws IOException {
AutocompleteEncodeStrategy strategy = getStrategy(component);
Object mode = component.getAttributes().get("mode");
- if (mode!= null && mode.equals("client")) {
+ if (mode != null && mode.equals("client")) {
List<Object> fetchValues = new ArrayList<Object>();
this.encodeItems(facesContext, component, fetchValues);
} else {
@@ -244,18 +207,15 @@
}
}
- public void encodeItem(FacesContext facesContext, AbstractAutocomplete comboBox, Object item, AutocompleteEncodeStrategy strategy) throws IOException {
- strategy.encodeItemBegin(facesContext, comboBox);
- ResponseWriter writer = facesContext.getResponseWriter();
-
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-au-option rf-au-font rf-au-input", null);
-
+ public void encodeItem(FacesContext facesContext, AbstractAutocomplete comboBox, Object item,
+ AutocompleteEncodeStrategy strategy) throws IOException {
+ ResponseWriter writer = facesContext.getResponseWriter();
if (comboBox.getChildCount() > 0) {
- for (UIComponent child : comboBox.getChildren()) {
- child.encodeAll(facesContext);
- }
+ strategy.encodeItem(facesContext, comboBox);
} else {
if (item != null) {
+ strategy.encodeItemBegin(facesContext, comboBox);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-au-opt rf-au-fnt rf-au-inp", null);
// TODO nick - use converter
String value = null;
if (comboBox.getItemConverter() != null) {
@@ -265,11 +225,12 @@
writer.writeText(value, null);
}
writer.writeText(item, null);
+ strategy.encodeItemEnd(facesContext, comboBox);
}
}
- strategy.encodeItemEnd(facesContext, comboBox);
+
}
-
+
private AutocompleteEncodeStrategy getStrategy(UIComponent component) {
AbstractAutocomplete comboBox = (AbstractAutocomplete) component;
if (comboBox.getLayout() != null) {
@@ -288,21 +249,21 @@
@Override
protected void doDecode(FacesContext context, UIComponent component) {
- AbstractAutocomplete autocomplete = (AbstractAutocomplete)component;
- if (InputUtils.isDisabled(autocomplete)) {
+ AbstractAutocomplete autocomplete = (AbstractAutocomplete) component;
+ if (InputUtils.isDisabled(autocomplete)) {
return;
}
Map<String, String> requestParameters = context.getExternalContext().getRequestParameterMap();
Object value = requestParameters.get(component.getClientId(context) + "Value");
if (value != null) {
- if(autocomplete.getConverter() != null){
+ if (autocomplete.getConverter() != null) {
value = autocomplete.getConverter().getAsObject(context, component, value.toString());
}
autocomplete.setSubmittedValue(value);
}
super.doDecode(context, component);
-
+
if (requestParameters.get(component.getClientId(context) + ".ajax") != null) {
PartialViewContext pvc = context.getPartialViewContext();
pvc.getRenderIds().add(
Modified: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteTableLayoutStrategy.java
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteTableLayoutStrategy.java 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteTableLayoutStrategy.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -2,6 +2,7 @@
import java.io.IOException;
+import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
@@ -34,15 +35,38 @@
}
public void encodeItemBegin(FacesContext facesContext, UIComponent component) throws IOException {
- ResponseWriter writer = facesContext.getResponseWriter();
+ ResponseWriter writer = facesContext.getResponseWriter();
writer.startElement(HtmlConstants.TR_ELEMENT, component);
writer.startElement(HtmlConstants.TD_ELEM, component);
}
+ private void encodeItemChildBegin(FacesContext facesContext, UIComponent component) throws IOException {
+ ResponseWriter writer = facesContext.getResponseWriter();
+ writer.startElement(HtmlConstants.TD_ELEM, component);
+ }
+
+ private void encodeItemChildEnd(FacesContext facesContext, UIComponent component) throws IOException {
+ ResponseWriter writer = facesContext.getResponseWriter();
+ writer.endElement(HtmlConstants.TD_ELEM);
+ }
+
public void encodeItemEnd(FacesContext facesContext, UIComponent component) throws IOException {
ResponseWriter writer = facesContext.getResponseWriter();
writer.endElement(HtmlConstants.TD_ELEM);
writer.endElement(HtmlConstants.TR_ELEMENT);
}
+ public void encodeItem(FacesContext facesContext, UIComponent component) throws IOException {
+ ResponseWriter writer = facesContext.getResponseWriter();
+ writer.startElement(HtmlConstants.TR_ELEMENT, component);
+ for (UIComponent child : component.getChildren()) {
+ if (child instanceof UIColumn) {
+ encodeItemChildBegin(facesContext, component);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-au-opt rf-au-fnt rf-au-inp", null);
+ child.encodeAll(facesContext);
+ encodeItemChildEnd(facesContext, component);
+ }
+ }
+ writer.endElement(HtmlConstants.TR_ELEMENT);
+ }
}
Copied: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/ClientSelectItem.java (from rev 19674, trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/ClientSelectItem.java)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/ClientSelectItem.java (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/ClientSelectItem.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.renderkit;
+
+import org.ajax4jsf.javascript.ScriptString;
+import org.ajax4jsf.javascript.ScriptUtils;
+
+public final class ClientSelectItem implements ScriptString {
+
+ private String clientId;
+ private String label;
+ private String convertedValue;
+
+ public ClientSelectItem(String convertedValue, String label) {
+ this(convertedValue, label, null);
+ }
+
+ public ClientSelectItem(String convertedValue, String label,
+ String clientId) {
+ super();
+ this.convertedValue = convertedValue;
+ this.label = label;
+ this.clientId = clientId;
+ }
+
+ public String getClientId() {
+ return clientId;
+ }
+
+ public void setClientId(String clientId) {
+ this.clientId = clientId;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public String getConvertedValue() {
+ return convertedValue;
+ }
+
+ public void appendScript(StringBuffer functionString) {
+ functionString.append(this.toScript());
+ }
+
+ public String toScript() {
+ return "{ 'id' : " + ScriptUtils.toScript(clientId)
+ + " , 'label' : " + ScriptUtils.toScript(label)
+ + ", 'value' : " + ScriptUtils.toScript(convertedValue)
+ + "}";
+ }
+}
Deleted: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -1,195 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.renderkit;
-
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.faces.application.Resource;
-import javax.faces.application.ResourceDependencies;
-import javax.faces.application.ResourceDependency;
-import javax.faces.application.ResourceHandler;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-
-import org.ajax4jsf.javascript.JSFunction;
-import org.richfaces.component.AbstractInplaceInput;
-import org.richfaces.component.InplaceState;
-import org.richfaces.component.util.HtmlUtil;
-
-/**
- * @author Anton Belevich
- *
- */
-@ResourceDependencies({
- @ResourceDependency(library = "javax.faces", name = "jsf.js"),
- @ResourceDependency(library = "org.richfaces", name = "base-component.reslib"),
- @ResourceDependency(name = "richfaces-event.js"),
- @ResourceDependency(library="org.richfaces", name = "inplaceInput.js"),
- @ResourceDependency(library="org.richfaces", name = "inplaceInput.ecss") })
-public class InplaceInputBaseRenderer extends InputRendererBase {
-
- public static final String OPTIONS_EDIT_EVENT = "editEvent";
-
- public static final String OPTIONS_EDIT_CONTAINER = "editContainer";
-
- public static final String OPTIONS_INPUT = "input";
-
- public static final String OPTIONS_FOCUS = "focusElement";
-
- public static final String OPTIONS_BUTTON_OK = "okbtn";
-
- public static final String OPTIONS_LABEL = "label";
-
- public static final String OPTIONS_DEFAULT_LABEL = "defaultLabel";
-
- public static final String OPTIONS_BUTTON_CANCEL = "cancelbtn";
-
- public static final String OPTIONS_SHOWCONTROLS = "showControls";
-
- public static final String OPTIONS_NONE_CSS = "noneCss";
-
- public static final String OPTIONS_CHANGED_CSS = "changedCss";
-
- public static final String OPTIONS_INITIAL_VALUE = "initialValue";
-
- private static final String READY_STATE_CSS = "rf-ii-d-s";
-
- private static final String EDIT_STATE_CSS = "rf-ii-e-s";
-
- private static final String CHANGED_STATE_CSS = "rf-ii-c-s";
-
- private static final String NONE_CSS = "rf-ii-none";
-
- private static final Map<String, ComponentAttribute> INPLACEINPUT_HANDLER_ATTRIBUTES = Collections
- .unmodifiableMap(ComponentAttribute.createMap(
- new ComponentAttribute(HtmlConstants.ONCLICK_ATTRIBUTE).setEventNames("inputClick").
- setComponentAttributeName("onInputClick"),
- new ComponentAttribute(HtmlConstants.ONDBLCLICK_ATTRIBUTE).setEventNames("inputDblclick").
- setComponentAttributeName("onInputDblclick"),
- new ComponentAttribute(HtmlConstants.ONMOUSEDOWN_ATTRIBUTE).setEventNames("inputMousedown").
- setComponentAttributeName("onInputMousedown"),
- new ComponentAttribute(HtmlConstants.ONMOUSEUP_ATTRIBUTE).setEventNames("inputMouseup").
- setComponentAttributeName("onInputMouseup"),
- new ComponentAttribute(HtmlConstants.ONMOUSEOVER_ATTRIBUTE).setEventNames("inputMouseover").
- setComponentAttributeName("onInputMouseover"),
- new ComponentAttribute(HtmlConstants.ONMOUSEMOVE_ATTRIBUTE).setEventNames("inputMousemove").
- setComponentAttributeName("onInputMousemove"),
- new ComponentAttribute(HtmlConstants.ONMOUSEOUT_ATTRIBUTE).setEventNames("inputMouseout").
- setComponentAttributeName("onInputMouseout"),
- new ComponentAttribute(HtmlConstants.ONKEYPRESS_ATTRIBUTE).setEventNames("inputKeypress").
- setComponentAttributeName("onInputKeypress"),
- new ComponentAttribute(HtmlConstants.ONKEYDOWN_ATTRIBUTE).setEventNames("inputKeydown").
- setComponentAttributeName("onInputKeydown"),
- new ComponentAttribute(HtmlConstants.ONKEYUP_ATTRIBUTE).setEventNames("inputKeyup").
- setComponentAttributeName("onInputKeyup"),
- new ComponentAttribute(HtmlConstants.ONBLUR_ATTRIBUTE).setEventNames("inputBlur").
- setComponentAttributeName("onInputBlur"),
- new ComponentAttribute(HtmlConstants.ONFOCUS_ATTRIBUTE).setEventNames("inputFocus").
- setComponentAttributeName("onInputFocus"),
- new ComponentAttribute(HtmlConstants.ONCHANGE_ATTRIBUTE).setEventNames("change").
- setComponentAttributeName("onchange"),
- new ComponentAttribute(HtmlConstants.ONSELECT_ATTRIBUTE).setEventNames("select").
- setComponentAttributeName("onselect")
- ));
-
- protected void renderInputHandlers(FacesContext facesContext, UIComponent component) throws IOException {
- RenderKitUtils.renderPassThroughAttributesOptimized(facesContext, component, INPLACEINPUT_HANDLER_ATTRIBUTES);
- }
-
- public InplaceState getInplaceState(UIComponent component) {
- return ((AbstractInplaceInput) component).getState();
- }
-
- public String getValue(FacesContext facesContext, UIComponent component) throws IOException {
- AbstractInplaceInput inplaceInput = (AbstractInplaceInput)component;
- String value = getInputValue(facesContext, inplaceInput);
- if(value == null || "".equals(value)) {
- value = inplaceInput.getDefaultLabel();
- }
- return value;
- }
-
- public String getResourcePath(FacesContext context, String resourceName) {
- if (resourceName != null) {
- ResourceHandler resourceHandler = context.getApplication().getResourceHandler();
- Resource resource = resourceHandler.createResource(resourceName);
- return resource.getRequestPath();
- }
- return null;
- }
-
- public String getReadyStyleClass(UIComponent component, InplaceState inplaceState) {
- return (InplaceState.changed != inplaceState) ? READY_STATE_CSS : HtmlUtil.concatClasses(READY_STATE_CSS, CHANGED_STATE_CSS);
- }
-
- public String getEditStyleClass(UIComponent component, InplaceState inplaceState) {
- return (InplaceState.edit != inplaceState)? HtmlUtil.concatClasses(EDIT_STATE_CSS, NONE_CSS) : EDIT_STATE_CSS;
- }
- public String getReadyClientId(FacesContext facesContext, UIComponent component, InplaceState inplaceState) {
- String clientId = component.getClientId(facesContext);
- return getId(clientId, InplaceState.ready, inplaceState);
- }
-
- public String getChangedClientId(FacesContext facesContext, UIComponent component, InplaceState inplaceState) {
- String clientId = component.getClientId(facesContext);
- return getId(clientId, InplaceState.changed, inplaceState);
- }
-
- private String getId(String clientId, InplaceState expect, InplaceState current) {
- String result = clientId;
- if (expect != current) {
- result = clientId + ":" + expect;
- }
- return result;
- }
-
- public void buildScript(ResponseWriter writer, FacesContext facesContext, UIComponent component) throws IOException {
- AbstractInplaceInput inplaceInput = (AbstractInplaceInput)component;
- JSFunction function = new JSFunction("new RichFaces.ui.InplaceInput");
- function.addParameter(inplaceInput.getClientId(facesContext));
-
- String clientId = inplaceInput.getClientId(facesContext);
- Map<String, Object> options = new HashMap<String, Object>();
- options.put(OPTIONS_EDIT_EVENT, inplaceInput.getEditEvent());
- options.put(OPTIONS_NONE_CSS, NONE_CSS);
- options.put(OPTIONS_CHANGED_CSS, CHANGED_STATE_CSS);
- options.put(OPTIONS_EDIT_CONTAINER, clientId + ":edit");
- options.put(OPTIONS_INPUT, clientId + ":input");
- options.put(OPTIONS_LABEL, clientId + ":label");
- options.put(OPTIONS_FOCUS, clientId + ":focus");
- options.put(OPTIONS_DEFAULT_LABEL, inplaceInput.getDefaultLabel());
-
- boolean showControls = inplaceInput.isShowControls();
- options.put(OPTIONS_SHOWCONTROLS, showControls);
- if(showControls) {
- options.put(OPTIONS_BUTTON_OK, clientId + ":okbtn");
- options.put(OPTIONS_BUTTON_CANCEL, clientId + ":cancelbtn");
- }
- function.addParameter(options);
-
- writer.write(function.toString());
- }
-}
Copied: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java (from rev 19674, trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,295 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.renderkit;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.application.Resource;
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.application.ResourceHandler;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.javascript.JSFunction;
+import org.richfaces.component.InplaceComponent;
+import org.richfaces.component.InplaceState;
+import org.richfaces.component.util.HtmlUtil;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+@ResourceDependencies({
+ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(name = "richfaces-event.js"),
+ @ResourceDependency(name = "richfaces-base-component.js"),
+ @ResourceDependency(library = "org.richfaces", name = "inputBase.js"),
+ @ResourceDependency(library = "org.richfaces", name = "inplaceBase.js"),
+ @ResourceDependency(library = "org.richfaces", name = "inplaceInput.js"),
+ @ResourceDependency(library = "org.richfaces", name = "inplaceInput.ecss") })
+public class InplaceInputRendererBase extends InputRendererBase {
+
+ public static final String OPTIONS_EDIT_EVENT = "editEvent";
+
+ public static final String OPTIONS_STATE = "state";
+
+ public static final String OPTIONS_EDIT_CONTAINER = "editContainer";
+
+ public static final String OPTIONS_INPUT = "input";
+
+ public static final String OPTIONS_FOCUS = "focusElement";
+
+ public static final String OPTIONS_BUTTON_OK = "okbtn";
+
+ public static final String OPTIONS_LABEL = "label";
+
+ public static final String OPTIONS_DEFAULT_LABEL = "defaultLabel";
+
+ public static final String OPTIONS_BUTTON_CANCEL = "cancelbtn";
+
+ public static final String OPTIONS_SHOWCONTROLS = "showControls";
+
+ public static final String OPTIONS_NONE_CSS = "noneCss";
+
+ public static final String OPTIONS_CHANGED_CSS = "changedCss";
+
+ public static final String OPTIONS_EDIT_CSS = "editCss";
+
+ public static final String OPTIONS_INITIAL_VALUE = "initialValue";
+
+ public static final String OPTIONS_SAVE_ON_BLUR = "saveOnBlur";
+
+
+
+
+ //TODO: anton - move to RenderUtils (we use the same in the calendar base renderer) ?
+ protected static final Map<String, ComponentAttribute> INPLACE_INPUT_HANDLER_ATTRIBUTES = Collections
+ .unmodifiableMap(ComponentAttribute.createMap(
+ new ComponentAttribute(HtmlConstants.ONCLICK_ATTRIBUTE)
+ .setEventNames("inputclick")
+ .setComponentAttributeName("oninputclick"),
+ new ComponentAttribute(HtmlConstants.ONDBLCLICK_ATTRIBUTE)
+ .setEventNames("inputdblclick")
+ .setComponentAttributeName("oninputdblclick"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEDOWN_ATTRIBUTE)
+ .setEventNames("inputmousedown")
+ .setComponentAttributeName("oninputmousedown"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEUP_ATTRIBUTE)
+ .setEventNames("inputmouseup")
+ .setComponentAttributeName("oninputmouseup"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEOVER_ATTRIBUTE)
+ .setEventNames("inputmouseover")
+ .setComponentAttributeName("oninputmouseover"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEMOVE_ATTRIBUTE)
+ .setEventNames("inputmousemove")
+ .setComponentAttributeName("oninputmousemove"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEOUT_ATTRIBUTE)
+ .setEventNames("inputmouseout")
+ .setComponentAttributeName("oninputmouseout"),
+ new ComponentAttribute(HtmlConstants.ONKEYPRESS_ATTRIBUTE)
+ .setEventNames("inputkeypress")
+ .setComponentAttributeName("oninputkeypress"),
+ new ComponentAttribute(HtmlConstants.ONKEYDOWN_ATTRIBUTE)
+ .setEventNames("inputkeydown")
+ .setComponentAttributeName("oninputkeydown"),
+ new ComponentAttribute(HtmlConstants.ONKEYUP_ATTRIBUTE)
+ .setEventNames("inputkeyup")
+ .setComponentAttributeName("oninputkeyup"),
+ new ComponentAttribute(HtmlConstants.ONBLUR_ATTRIBUTE)
+ .setEventNames("inputblur")
+ .setComponentAttributeName("oninputblur"),
+ new ComponentAttribute(HtmlConstants.ONFOCUS_ATTRIBUTE)
+ .setEventNames("inputfocus")
+ .setComponentAttributeName("oninputfocus"),
+ new ComponentAttribute(HtmlConstants.ONCHANGE_ATTRIBUTE)
+ .setEventNames("inputchange").setComponentAttributeName(
+ "oninputchange"),
+ new ComponentAttribute(HtmlConstants.ONSELECT_ATTRIBUTE)
+ .setEventNames("inputselect").setComponentAttributeName(
+ "oninputselect")));
+
+ public void renderInputHandlers(FacesContext facesContext,
+ UIComponent component) throws IOException {
+ RenderKitUtils.renderPassThroughAttributesOptimized(facesContext,
+ component, INPLACE_INPUT_HANDLER_ATTRIBUTES);
+ }
+
+ public InplaceState getInplaceState(UIComponent component) {
+ return ((InplaceComponent) component).getState();
+ }
+
+ public String getValue(FacesContext facesContext, UIComponent component) throws IOException {
+ String value = getInputValue(facesContext, component);
+ if (!isDisable(getInplaceState(component)) && (value == null || "".equals(value)) ) {
+ value = ((InplaceComponent) component).getDefaultLabel();
+ }
+ return value;
+ }
+
+ public String getResourcePath(FacesContext context, String resourceName) {
+ if (resourceName != null) {
+ ResourceHandler resourceHandler = context.getApplication()
+ .getResourceHandler();
+ Resource resource = resourceHandler.createResource(resourceName);
+ return resource.getRequestPath();
+ }
+ return null;
+ }
+
+ public String getStateStyleClass(UIComponent component, InplaceState inplaceState) {
+ InplaceComponent inplaceComponent = (InplaceComponent)component;
+ String style = getReadyStateCss(inplaceComponent);
+ switch (inplaceState) {
+ case edit:
+ style = HtmlUtil.concatClasses(style, getEditStateCss(inplaceComponent));
+ break;
+
+ case changed:
+ style = HtmlUtil.concatClasses(style, getChangedStateCss(inplaceComponent));
+ break;
+
+ case disable:
+ style = getDisableStateCss(inplaceComponent);
+ break;
+
+ default:
+ break;
+ }
+
+ return style;
+ }
+
+ public boolean isDisable(InplaceState currentState) {
+ return (InplaceState.disable == currentState);
+ }
+
+ public String getEditStyleClass(UIComponent component, InplaceState inplaceState) {
+ InplaceComponent inplaceComponent = (InplaceComponent)component;
+ return (InplaceState.edit != inplaceState) ? HtmlUtil.concatClasses(getEditCss(inplaceComponent), getNoneCss(inplaceComponent)) : getEditCss(inplaceComponent);
+ }
+
+ public void buildScript(ResponseWriter writer, FacesContext facesContext,
+ UIComponent component, Object additional) throws IOException {
+ if (!(component instanceof InplaceComponent)) {
+ return;
+ }
+
+ String scriptName = getScriptName();
+ JSFunction function = new JSFunction(scriptName);
+ String clientId = component.getClientId(facesContext);
+ Map<String, Object> options = createInplaceComponentOptions(clientId,
+ (InplaceComponent) component);
+ addToOptions(facesContext, component, options, additional);
+ function.addParameter(clientId);
+ function.addParameter(options);
+ writer.write(function.toString());
+ }
+
+ protected String getScriptName() {
+ return "new RichFaces.ui.InplaceInput";
+ }
+
+ private Map<String, Object> createInplaceComponentOptions(String clientId,
+ InplaceComponent inplaceComponent) {
+ Map<String, Object> options = new HashMap<String, Object>();
+
+ if(!"click".equals(inplaceComponent.getEditEvent())){
+ options.put(OPTIONS_EDIT_EVENT, inplaceComponent.getEditEvent());
+ }
+
+ if(!(InplaceState.ready == inplaceComponent.getState())) {
+ options.put(OPTIONS_STATE, inplaceComponent.getState());
+ }
+
+ String css = inplaceComponent.getNoneCss();
+ if(css != null && css.trim().length() > 0) {
+ options.put(OPTIONS_NONE_CSS, getNoneCss(inplaceComponent));
+ }
+
+ css = inplaceComponent.getChangedStateCss();
+ if(css != null && css.trim().length() > 0) {
+ options.put(OPTIONS_CHANGED_CSS, getChangedStateCss(inplaceComponent));
+ }
+
+ css = inplaceComponent.getEditStateCss();
+ if(css != null && css.trim().length() > 0) {
+ options.put(OPTIONS_EDIT_CSS, getEditStateCss(inplaceComponent));
+ }
+
+ String label = inplaceComponent.getDefaultLabel();
+ if(label != null && label.trim().length() > 0) {
+ options.put(OPTIONS_DEFAULT_LABEL, inplaceComponent.getDefaultLabel());
+ }
+
+ if(!inplaceComponent.isSaveOnBlur()) {
+ options.put(OPTIONS_SAVE_ON_BLUR, inplaceComponent.isSaveOnBlur());
+ }
+
+ if(inplaceComponent.isShowControls()) {
+ options.put(OPTIONS_SHOWCONTROLS, inplaceComponent.isShowControls());
+ }
+
+ return options;
+ }
+
+ public void addToOptions(FacesContext facesContext, UIComponent component,
+ Map<String, Object> options, Object additional) {
+ // override this method if you need additional options
+ }
+
+ public String getReadyStateCss(InplaceComponent component) {
+ String css = component.getReadyStateCss();
+ return HtmlUtil.concatClasses("rf-ii-d-s", css);
+ }
+
+ public String getEditStateCss(InplaceComponent component) {
+ String css = component.getEditStateCss();
+ return HtmlUtil.concatClasses("rf-ii-e-s", css);
+ }
+
+ public String getChangedStateCss(InplaceComponent component) {
+ String css = component.getChangedStateCss();
+ return HtmlUtil.concatClasses("rf-ii-c-s", css);
+ }
+
+ public String getDisableStateCss(InplaceComponent component) {
+ String css = component.getDisableStateCss();
+ return HtmlUtil.concatClasses("rf-ii-dis-s", css);
+ }
+
+ public String getEditCss(InplaceComponent component) {
+ String css = component.getEditCss();
+ return HtmlUtil.concatClasses("rf-ii-edit", css);
+ }
+
+ public String getNoneCss(InplaceComponent component) {
+ String css = component.getNoneCss();
+ return HtmlUtil.concatClasses("rf-ii-none", css);
+ }
+}
Copied: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java (from rev 19674, trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,145 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.renderkit;
+
+import java.io.IOException;
+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.AbstractInplaceSelect;
+import org.richfaces.component.AbstractSelect;
+import org.richfaces.component.InplaceComponent;
+import org.richfaces.component.util.HtmlUtil;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+
+@ResourceDependencies({
+ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(name = "jquery.position.js"),
+ @ResourceDependency(name = "richfaces-event.js"),
+ @ResourceDependency(name = "richfaces-base-component.js"),
+ @ResourceDependency(name = "richfaces-selection.js"),
+ @ResourceDependency(library = "org.richfaces", name = "inputBase.js"),
+ @ResourceDependency(library = "org.richfaces", name = "inplaceBase.js"),
+ @ResourceDependency(library = "org.richfaces", name = "popup.js"),
+ @ResourceDependency(library = "org.richfaces", name = "popupList.js"),
+ @ResourceDependency(library = "org.richfaces", name = "inplaceInput.js"),
+ @ResourceDependency(library = "org.richfaces", name = "inplaceSelect.js"),
+ @ResourceDependency(library = "org.richfaces", name = "inplaceSelect.ecss") })
+public class InplaceSelectRendererBase extends InplaceInputRendererBase {
+
+ public static final String OPTIONS_VISIBLE = "visible";
+
+ public static final String ITEM_CSS = "rf-is-opt";
+
+ public static final String SELECT_ITEM_CSS = "rf-is-sel";
+
+ public static final String LIST_CSS = "rf-is-lst-cord";
+
+
+ @Override
+ protected String getScriptName() {
+ return "new RichFaces.ui.InplaceSelect";
+ }
+
+ public List<ClientSelectItem> getConvertedSelectItems(FacesContext facesContext, UIComponent component) {
+ return SelectHelper.getConvertedSelectItems(facesContext, component);
+ }
+
+ public void encodeItems(FacesContext facesContext, UIComponent component, List<ClientSelectItem> clientSelectItems) throws IOException {
+ SelectHelper.encodeItems(facesContext, component, clientSelectItems, HtmlConstants.SPAN_ELEM, ITEM_CSS);
+ }
+
+ public void renderListHandlers(FacesContext facesContext, UIComponent component) throws IOException {
+ RenderKitUtils.renderPassThroughAttributesOptimized(facesContext, component, SelectHelper.SELECT_LIST_HANDLER_ATTRIBUTES);
+ }
+
+ @Override
+ public void renderInputHandlers(FacesContext facesContext, UIComponent component) throws IOException {
+ RenderKitUtils.renderPassThroughAttributesOptimized(facesContext, component, INPLACE_INPUT_HANDLER_ATTRIBUTES);
+ }
+
+ public String getSelectInputLabel(FacesContext facesContext, UIComponent component) {
+ return SelectHelper.getSelectInputLabel(facesContext, component);
+ }
+
+ @Override
+ public void addToOptions(FacesContext facesContext, UIComponent component, Map<String, Object> options, Object additional) {
+ AbstractSelect abstractSelect = (AbstractSelect)component;
+ SelectHelper.addSelectCssToOptions(abstractSelect, options, new String[] {ITEM_CSS, SELECT_ITEM_CSS, LIST_CSS});
+ boolean openOnEdit = (Boolean)component.getAttributes().get("openOnEdit");
+ if(openOnEdit) {
+ options.put(OPTIONS_VISIBLE, openOnEdit);
+ }
+ options.put(SelectHelper.OPTIONS_LIST_ITEMS, additional);
+ }
+
+ public String getSelectLabel(FacesContext facesContext, UIComponent component) {
+ AbstractInplaceSelect select = (AbstractInplaceSelect) component;
+ String label = getSelectInputLabel(facesContext, select);
+ if (!isDisable(getInplaceState(component)) && (label == null)) {
+ label = select.getDefaultLabel();
+ }
+ return label;
+ }
+
+ public String getReadyStateCss(InplaceComponent component) {
+ String css = component.getReadyStateCss();
+ return HtmlUtil.concatClasses("rf-is-d-s", css);
+ }
+
+ public String getEditStateCss(InplaceComponent component) {
+ String css = component.getEditStateCss();
+ return HtmlUtil.concatClasses("rf-is-e-s", css);
+ }
+
+ public String getChangedStateCss(InplaceComponent component) {
+ String css = component.getChangedStateCss();
+ return HtmlUtil.concatClasses("rf-is-c-s", css);
+ }
+
+ public String getDisableStateCss(InplaceComponent component) {
+ String css = component.getDisableStateCss();
+ return HtmlUtil.concatClasses("rf-is-dis-s", css);
+ }
+
+ public String getEditCss(InplaceComponent component) {
+ String css = component.getEditCss();
+ return HtmlUtil.concatClasses("rf-is-edit", css);
+ }
+
+ public String getNoneCss(InplaceComponent component) {
+ String css = component.getNoneCss();
+ return HtmlUtil.concatClasses("rf-is-none", css);
+ }
+}
Modified: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/InputRendererBase.java
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/InputRendererBase.java 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/InputRendererBase.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -1,22 +1,23 @@
-/**
- * License Agreement.
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
*
- * JBoss RichFaces - Ajax4jsf Component Library
+ * 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.
*
- * 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,
+ * 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
+ * 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
+ * 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;
@@ -35,13 +36,10 @@
* created 23.01.2007
*/
public class InputRendererBase extends AjaxComponentRendererBase {
- protected Class getComponentClass() {
- return UIInput.class;
- }
protected void doDecode(FacesContext context, UIComponent component) {
String clientId = component.getClientId(context);
- Map requestParameterMap = context.getExternalContext().getRequestParameterMap();
+ Map<String, String> requestParameterMap = context.getExternalContext().getRequestParameterMap();
String newValue = (String) requestParameterMap.get(clientId);
if (null != newValue) {
Copied: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/PopupConstants.java (from rev 19674, trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/PopupConstants.java)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/PopupConstants.java (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/PopupConstants.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.renderkit;
+
+/**
+ * @author abelevich
+ *
+ */
+public interface PopupConstants {
+
+ public static final String OPTIONS_ITEM_CLASS = "itemCss";
+
+ public static final String OPTIONS_SELECT_ITEM_CLASS = "selectItemCss";
+
+ public static final String OPTIONS_LIST_CLASS = "listCss";
+
+ public static final String OPTIONS_LIST_CORD = "list";
+}
Copied: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectHelper.java (from rev 19674, trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectHelper.java)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectHelper.java (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectHelper.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,171 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.renderkit;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.model.SelectItem;
+
+import org.richfaces.component.AbstractSelect;
+import org.richfaces.component.util.HtmlUtil;
+import org.richfaces.component.util.InputUtils;
+import org.richfaces.component.util.SelectUtils;
+
+/**
+ * @author abelevich
+ *
+ */
+public final class SelectHelper {
+
+ public static final String OPTIONS_SHOWCONTROL = "showControl";
+
+ public static final String OPTIONS_LIST_ITEMS = "items";
+
+ public static final String OPTIONS_ENABLE_MANUAL_INPUT = "enableManualInput";
+
+ public static final String OPTIONS_LIST_SELECT_FIRST = "selectFirst";
+
+ public static final String OPTIONS_INPUT_DEFAULT_LABEL = "defaultLabel";
+
+ public static final Map<String, ComponentAttribute> SELECT_LIST_HANDLER_ATTRIBUTES = Collections
+ .unmodifiableMap(ComponentAttribute.createMap(
+ new ComponentAttribute(HtmlConstants.ONCLICK_ATTRIBUTE)
+ .setEventNames("listclick")
+ .setComponentAttributeName("onlistclick"),
+ new ComponentAttribute(HtmlConstants.ONDBLCLICK_ATTRIBUTE)
+ .setEventNames("listdblclick")
+ .setComponentAttributeName("onlistdblclick"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEDOWN_ATTRIBUTE)
+ .setEventNames("listmousedown")
+ .setComponentAttributeName("onlistmousedown"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEUP_ATTRIBUTE)
+ .setEventNames("listmouseup")
+ .setComponentAttributeName("onlistmouseup"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEOVER_ATTRIBUTE)
+ .setEventNames("listmouseover")
+ .setComponentAttributeName("onlistmouseover"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEMOVE_ATTRIBUTE)
+ .setEventNames("listmousemove")
+ .setComponentAttributeName("onlistmousemove"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEOUT_ATTRIBUTE)
+ .setEventNames("listmouseout")
+ .setComponentAttributeName("onlistmouseout"),
+ new ComponentAttribute(HtmlConstants.ONKEYPRESS_ATTRIBUTE)
+ .setEventNames("listkeypress")
+ .setComponentAttributeName("onlistkeypress"),
+ new ComponentAttribute(HtmlConstants.ONKEYDOWN_ATTRIBUTE)
+ .setEventNames("listkeydown")
+ .setComponentAttributeName("onlistkeydown"),
+ new ComponentAttribute(HtmlConstants.ONKEYUP_ATTRIBUTE)
+ .setEventNames("listkeyup")
+ .setComponentAttributeName("onlistkeyup")
+ ));
+
+ private SelectHelper() {
+ }
+
+ public static List<ClientSelectItem> getConvertedSelectItems(FacesContext facesContext, UIComponent component) {
+ AbstractSelect select = (AbstractSelect) component;
+ List<SelectItem> selectItems = SelectUtils.getSelectItems(facesContext, select);
+ List<ClientSelectItem> clientSelectItems = new ArrayList<ClientSelectItem>();
+
+ for (SelectItem selectItem : selectItems) {
+ String convertedStringValue = InputUtils.getConvertedStringValue(facesContext, select, selectItem.getValue());
+ String label = selectItem.getLabel();
+ clientSelectItems.add(new ClientSelectItem(convertedStringValue,label));
+ }
+ return clientSelectItems;
+ }
+
+ public static void encodeItems(FacesContext facesContext, UIComponent component,
+ List<ClientSelectItem> clientSelectItems, String itemHtmlElement, String defaultItemCss) throws IOException {
+ AbstractSelect select = (AbstractSelect) component;
+ if (clientSelectItems != null && !clientSelectItems.isEmpty()) {
+ ResponseWriter writer = facesContext.getResponseWriter();
+ String clientId = component.getClientId(facesContext);
+ int i = 0;
+ for (ClientSelectItem clientSelectItem : clientSelectItems) {
+ String itemClientId = clientId + "Item" + (i++);
+ clientSelectItem.setClientId(itemClientId);
+
+ writer.startElement(itemHtmlElement, select);
+ writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, itemClientId,
+ null);
+
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, HtmlUtil.concatClasses(defaultItemCss, select.getItemCss()), null);
+
+ String label = clientSelectItem.getLabel();
+ if (label != null && label.trim().length() > 0) {
+ writer.writeText(label, null);
+ } else {
+ writer.write("\u00a0");
+ }
+ writer.endElement(itemHtmlElement);
+ }
+ }
+ }
+
+ public static String getSelectInputLabel(FacesContext facesContext, UIComponent component) {
+ AbstractSelect select = (AbstractSelect) component;
+ Object value = select.getSubmittedValue();
+ String label = null;
+ if (value == null) {
+ value = select.getValue();
+ if (value != null) {
+ List<SelectItem> items = SelectUtils.getSelectItems(
+ facesContext, component);
+ for (SelectItem item : items) {
+ if (value.equals(item.getValue())) {
+ label = item.getLabel();
+ }
+ }
+ }
+ }
+
+ return label;
+ }
+
+ public static void addSelectCssToOptions(AbstractSelect abstractSelect, Map<String, Object> options, String [] defaultCss) {
+ String itemCss = abstractSelect.getItemCss();
+ if(itemCss != null && itemCss.trim().length() > 0) {
+ options.put(PopupConstants.OPTIONS_ITEM_CLASS, HtmlUtil.concatClasses(defaultCss[0], itemCss));
+ }
+
+ String selectItemCss = abstractSelect.getSelectItemCss();
+ if(selectItemCss != null && selectItemCss.trim().length() > 0) {
+ options.put(PopupConstants.OPTIONS_SELECT_ITEM_CLASS, HtmlUtil.concatClasses(defaultCss[1], selectItemCss));
+ }
+
+ String listCss = abstractSelect.getListCss();
+ if(listCss != null && listCss.trim().length() > 0) {
+ options.put(PopupConstants.OPTIONS_LIST_CLASS, HtmlUtil.concatClasses(defaultCss[2], listCss));
+ }
+ }
+}
Copied: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java (from rev 19674, trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,130 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.renderkit;
+
+import java.io.IOException;
+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 javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.javascript.JSFunction;
+import org.richfaces.component.AbstractSelect;
+
+/**
+ * @author abelevich
+ *
+ */
+@ResourceDependencies({ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
+ @ResourceDependency(name = "jquery.js"), @ResourceDependency(name = "jquery.position.js"),
+ @ResourceDependency(name = "richfaces.js"), @ResourceDependency(name = "jquery.position.js"),
+ @ResourceDependency(name = "richfaces-event.js"), @ResourceDependency(name = "richfaces-base-component.js"),
+ @ResourceDependency(name = "richfaces-selection.js"),
+ @ResourceDependency(library = "org.richfaces", name = "inputBase.js"),
+ @ResourceDependency(library = "org.richfaces", name = "popup.js"),
+ @ResourceDependency(library = "org.richfaces", name = "popupList.js"),
+ @ResourceDependency(library = "org.richfaces", name = "selectList.js"),
+ @ResourceDependency(library = "org.richfaces", name = "select.js"),
+ @ResourceDependency(library = "org.richfaces", name = "select.ecss") })
+public class SelectRendererBase extends InputRendererBase {
+
+ public static final String ITEM_CSS = "rf-sel-opt";
+
+ public static final String SELECT_ITEM_CSS = "rf-sel-sel";
+
+ public static final String LIST_CSS = "rf-sel-lst-cord";
+
+
+ public void renderListHandlers(FacesContext facesContext, UIComponent component) throws IOException {
+ RenderKitUtils.renderPassThroughAttributesOptimized(facesContext, component, SelectHelper.SELECT_LIST_HANDLER_ATTRIBUTES);
+ }
+
+ public List<ClientSelectItem> getConvertedSelectItems(FacesContext facesContext, UIComponent component) {
+ return SelectHelper.getConvertedSelectItems(facesContext, component);
+ }
+
+ public String getSelectInputLabel(FacesContext facesContext, UIComponent component) {
+ return SelectHelper.getSelectInputLabel(facesContext, component);
+ }
+
+ public String getSelectLabel(FacesContext facesContext, UIComponent component) {
+ AbstractSelect select = (AbstractSelect) component;
+ String label = getSelectInputLabel(facesContext, select);
+ if (label == null || "".equals(label.trim())) {
+ label = select.getDefaultLabel();
+ }
+ return label;
+ }
+
+ public void encodeItems(FacesContext facesContext, UIComponent component, List<ClientSelectItem> clientSelectItems)
+ throws IOException {
+ SelectHelper.encodeItems(facesContext, component, clientSelectItems, HtmlConstants.DIV_ELEM, ITEM_CSS);
+ }
+
+ public void buildScript(ResponseWriter writer, FacesContext facesContext, UIComponent component, List<ClientSelectItem> selectItems) throws IOException {
+ if (!(component instanceof AbstractSelect)) {
+ return;
+ }
+
+ AbstractSelect abstractSelect = (AbstractSelect)component;
+ String scriptName = getScriptName();
+ JSFunction function = new JSFunction(scriptName);
+
+ String clientId = abstractSelect.getClientId(facesContext);
+ Map<String, Object> options = new HashMap<String, Object>();
+ options.put(SelectHelper.OPTIONS_LIST_ITEMS, selectItems);
+
+ if(!abstractSelect.isShowButton()) {
+ options.put(SelectHelper.OPTIONS_SHOWCONTROL, abstractSelect.isShowButton());
+ }
+
+ String defaultLabel = abstractSelect.getDefaultLabel();
+ if( defaultLabel != null && defaultLabel.trim().length() > 0) {
+ options.put(SelectHelper.OPTIONS_INPUT_DEFAULT_LABEL, defaultLabel);
+ }
+
+ if(abstractSelect.isEnableManualInput()) {
+ options.put(SelectHelper.OPTIONS_ENABLE_MANUAL_INPUT, abstractSelect.isEnableManualInput());
+ }
+
+ if(!abstractSelect.isSelectFirst()) {
+ options.put(SelectHelper.OPTIONS_LIST_SELECT_FIRST, abstractSelect.isSelectFirst());
+ }
+
+ SelectHelper.addSelectCssToOptions(abstractSelect, options, new String[] {ITEM_CSS, SELECT_ITEM_CSS, LIST_CSS});
+
+ function.addParameter(clientId);
+ function.addParameter(options);
+
+ writer.write(function.toString());
+ }
+
+ protected String getScriptName() {
+ return "new RichFaces.ui.Select";
+ }
+}
Copied: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/ArrowBase.java (from rev 19674, trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/ArrowBase.java)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/ArrowBase.java (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/ArrowBase.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,96 @@
+/*
+ * 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.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.DynamicResource;
+import org.richfaces.resource.ImageType;
+import org.richfaces.resource.Java2DUserResource;
+import org.richfaces.resource.StateHolderResource;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+@DynamicResource
+public abstract class ArrowBase implements Java2DUserResource, StateHolderResource {
+
+ private int color;
+ private String colorName = Skin.GENERAL_TEXT_COLOR;
+
+ private void initialize() {
+ FacesContext context = FacesContext.getCurrentInstance();
+ Skin skin = SkinFactory.getInstance(context).getSkin(context);
+ this.color = skin.getColorParameter(context, colorName);
+ }
+
+ protected final void setColorName(String colorName) {
+ this.colorName = colorName;
+ }
+
+ public abstract Dimension getDimension();
+
+ public void paint(Graphics2D graphics2d, Dimension dimension) {
+ graphics2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+ graphics2d.setColor(new Color(color));
+ }
+
+ public void writeState(FacesContext context, DataOutput dataOutput) throws IOException {
+ initialize();
+ dataOutput.writeInt(this.color);
+ }
+
+ public void readState(FacesContext context, DataInput dataInput) throws IOException {
+ this.color = dataInput.readInt();
+ }
+
+ public Map<String, String> getResponseHeaders() {
+ return null;
+ }
+
+ public Date getLastModified() {
+ return null;
+ }
+
+ public ImageType getImageType() {
+ return ImageType.PNG;
+ }
+
+ public boolean isTransient() {
+ return false;
+ }
+
+}
Modified: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowBase.java
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowBase.java 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowBase.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -22,77 +22,18 @@
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.DynamicResource;
-import org.richfaces.resource.ImageType;
-import org.richfaces.resource.Java2DUserResource;
-import org.richfaces.resource.StateHolderResource;
-import org.richfaces.skin.Skin;
-import org.richfaces.skin.SkinFactory;
-
/**
* @author Konstantin Mishin
*
*/
-@DynamicResource
-public abstract class SliderArrowBase implements Java2DUserResource, StateHolderResource {
+public abstract class SliderArrowBase extends ArrowBase {
private Dimension dimension = new Dimension(7, 7);
- private int color;
- private String colorName = Skin.GENERAL_TEXT_COLOR;
- private void initialize() {
- FacesContext context = FacesContext.getCurrentInstance();
- Skin skin = SkinFactory.getInstance(context).getSkin(context);
- this.color = skin.getColorParameter(context, colorName);
- }
-
- protected final void setColorName(String colorName) {
- this.colorName = colorName;
- }
-
+ @Override
public Dimension getDimension() {
return dimension;
}
- public void paint(Graphics2D graphics2d, Dimension dimension) {
- graphics2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
- graphics2d.setColor(new Color(color));
- }
-
- public void writeState(FacesContext context, DataOutput dataOutput) throws IOException {
- initialize();
- dataOutput.writeInt(this.color);
- }
-
- public void readState(FacesContext context, DataInput dataInput) throws IOException {
- this.color = dataInput.readInt();
- }
-
- public Map<String, String> getResponseHeaders() {
- return null;
- }
-
- public Date getLastModified() {
- return null;
- }
-
- public ImageType getImageType() {
- return ImageType.PNG;
- }
-
- public boolean isTransient() {
- return false;
- }
-
}
Copied: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBase.java (from rev 19674, trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBase.java)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBase.java (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBase.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,39 @@
+/*
+ * 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.html.images;
+
+import java.awt.Dimension;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public abstract class SpinnerArrowBase extends ArrowBase {
+
+ private Dimension dimension = new Dimension(5, 3);
+
+ @Override
+ public Dimension getDimension() {
+ return dimension;
+ }
+}
Copied: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBottom.java (from rev 19674, trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBottom.java)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBottom.java (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBottom.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,41 @@
+/*
+ * 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.html.images;
+
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public class SpinnerArrowBottom extends SpinnerArrowBase {
+
+ @Override
+ public void paint(Graphics2D graphics2d, Dimension dimension) {
+ super.paint(graphics2d, dimension);
+ graphics2d.drawLine(0, 0, 4, 0);
+ graphics2d.drawLine(1, 1, 3, 1);
+ graphics2d.drawLine(2, 2, 2, 2);
+ }
+}
Copied: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowTop.java (from rev 19674, trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowTop.java)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowTop.java (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowTop.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,41 @@
+/*
+ * 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.html.images;
+
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public class SpinnerArrowTop extends SpinnerArrowBase {
+
+ @Override
+ public void paint(Graphics2D graphics2d, Dimension dimension) {
+ super.paint(graphics2d, dimension);
+ graphics2d.drawLine(2, 0, 2, 0);
+ graphics2d.drawLine(1, 1, 3, 1);
+ graphics2d.drawLine(0, 2, 4, 2);
+ }
+}
Copied: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowBottom.java (from rev 19674, trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowBottom.java)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowBottom.java (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowBottom.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,35 @@
+/*
+ * 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.html.images;
+
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public class SpinnerDisabledArrowBottom extends SpinnerArrowBottom {
+
+ public SpinnerDisabledArrowBottom() {
+ setColorName("tabDisabledTextColor");
+ }
+}
Copied: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowTop.java (from rev 19674, trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowTop.java)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowTop.java (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowTop.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,35 @@
+/*
+ * 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.html.images;
+
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public class SpinnerDisabledArrowTop extends SpinnerArrowTop {
+
+ public SpinnerDisabledArrowTop() {
+ setColorName("tabDisabledTextColor");
+ }
+}
Modified: branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/view/facelets/AutocompleteHandler.java
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/view/facelets/AutocompleteHandler.java 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/java/org/richfaces/view/facelets/AutocompleteHandler.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -38,7 +38,6 @@
/**
* @author Nick Belaevski
- *
*/
//TODO nick - this should be generated by CDK
public class AutocompleteHandler extends ComponentHandler {
@@ -47,11 +46,11 @@
@Override
public Metadata applyRule(String name, TagAttribute attribute,
- MetadataTarget meta) {
+ MetadataTarget meta) {
if (meta.isTargetInstanceOf(AbstractAutocomplete.class)) {
if ("autocompleteMethod".equals(name)) {
return new MethodMetadata(attribute, FacesContext.class,
- UIComponent.class, String.class) {
+ UIComponent.class, String.class) {
public void applyMetadata(FaceletContext ctx, Object instance) {
((AbstractAutocomplete) instance).setAutocompleteMethod(getMethodExpression(ctx));
}
@@ -62,8 +61,8 @@
return new ConverterMetadata(attribute) {
public void applyMetadata(FaceletContext ctx, Object instance) {
((AbstractAutocomplete) instance).setConverter(this.getConverter(ctx,
- (AbstractAutocomplete) instance,
- this.getAttr().getValueExpression(ctx, Converter.class)));
+ (AbstractAutocomplete) instance,
+ this.getAttr().getValueExpression(ctx, Converter.class)));
}
};
}
@@ -72,8 +71,8 @@
return new ConverterMetadata(attribute) {
public void applyMetadata(FaceletContext ctx, Object instance) {
((AbstractAutocomplete) instance).setItemConverter(this.getConverter(ctx,
- (AbstractAutocomplete) instance,
- this.getAttr().getValueExpression(ctx, Converter.class)));
+ (AbstractAutocomplete) instance,
+ this.getAttr().getValueExpression(ctx, Converter.class)));
}
};
}
@@ -85,7 +84,7 @@
};
public AutocompleteHandler(ComponentConfig config) {
- super(config);
+ super(config);
}
@Override
@@ -108,7 +107,7 @@
}
public Converter getConverter(FaceletContext ctx,
- AbstractAutocomplete component, ValueExpression converter) {
+ AbstractAutocomplete component, ValueExpression converter) {
ValueExpression ve = null;
Converter c = null;
if (converter != null) {
@@ -116,7 +115,7 @@
try {
c = (Converter) ve.getValue(ctx);
} catch (Exception e) {
- // ok
+ // ok
}
}
@@ -124,8 +123,8 @@
c = this.createConverter(ctx, component);
}
if (c == null) {
- // throw new TagException(this.getTag(), "No Converter was
- // created");
+ // throw new TagException(this.getTag(), "No Converter was
+ // created");
}
return c;
}
@@ -135,9 +134,9 @@
}
private Converter createConverter(FaceletContext ctx,
- AbstractAutocomplete component) {
+ AbstractAutocomplete component) {
return ctx.getFacesContext().getApplication().createConverter(
- getConverterId(ctx));
+ getConverterId(ctx));
}
}
Modified: branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.ecss
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.ecss 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.ecss 2010-10-27 15:23:56 UTC (rev 19691)
@@ -1,29 +1,18 @@
-.rf-au-field-width{
- width: 200px;
-}
-.rf-au-list-width{
- width: 200px;
-}
-
-.rf-au-list-height{
- max-height: 100px;
- min-height: 20px;
-}
-
-.rf-au-input.rf-au-font, .rf-au-option.rf-au-font{
+.rf-au-inp.rf-au-fnt, .rf-au-opt.rf-au-fnt{
color: '#{richSkin.generalTextColor}';
font-size: '#{richSkin.generalSizeFont}';
font-family: '#{richSkin.generalFamilyFont}';
}
-input.rf-au-input {
+input.rf-au-inp {
border-width: 0px;
background: none;
width: 100%;
}
-.rf-au-field{
+.rf-au-fld{
+ width: 200px;
position: inline-block;
border-width: 1px;
border-style: solid;
@@ -35,7 +24,7 @@
background-color: '#{richSkin.controlBackgroundColor}';
}
-.rf-au-button{
+.rf-au-btn{
background-image: "url(#{resource['org.richfaces.renderkit.html.images.AutocompleteButtonGradient']})";
background-repeat: repeat-x;
background-position: top left;
@@ -52,7 +41,7 @@
padding-top: 1px
}
-.rf-au-button-arrow{
+.rf-au-btn-arrow{
background-position: center;
background-repeat: no-repeat;
background-image: "url(#{resource['org.richfaces:combo_down_button.gif']})";
@@ -61,13 +50,13 @@
height: 15px;
}
-.rf-au-list-cord{
+.rf-au-lst-cord{
position: absolute;
/* TODO nick - review: font-size: 0px; */
display: none;
}
-.rf-au-list-decoration{
+.rf-au-lst-dcrtn{
border-width: 1px;
border-style: solid;
border-color: '#{richSkin.panelBorderColor}';
@@ -75,19 +64,22 @@
background-color: '#{richSkin.tableBackgroundColor}';
}
-.rf-au-list-scroll{
+.rf-au-lst-scrl{
overflow: auto;
overflow-x: hidden;
+ width: 200px;
+ max-height: 100px;
+ min-height: 20px;
}
-.rf-au-option{
+.rf-au-opt{
padding: 2px;
white-space: nowrap;
cursor: default;
list-style-type: none;
}
-.rf-au-select{
+.rf-au-sel{
padding: 1px;
width: 100%;
background-color: '#{richSkin.headerBackgroundColor}';
@@ -96,7 +88,7 @@
border-color: '#{richSkin.generalTextColor}';
}
-.rf-au-shadow{
+.rf-au-shdw{
border: 0px solid red;
display: inline-block;
position: absolute;
@@ -106,7 +98,7 @@
left: -7px;
}
-.rf-au-shadow-t{
+.rf-au-shdw-t{
background-image: "url(#{resource['org.richfaces:combo_list_shadow.png']})";
background-position: top left;
position: absolute;
@@ -116,7 +108,7 @@
left: 0px
}
-.rf-au-shadow-l{
+.rf-au-shdw-l{
background-image: "url(#{resource['org.richfaces:combo_list_shadow.png']})";
background-position: bottom left;
position: absolute;
@@ -126,7 +118,7 @@
right: 6px;
}
-.rf-au-shadow-r{
+.rf-au-shdw-r{
background-image: "url(#{resource['org.richfaces:combo_list_shadow.png']})";
background-position: bottom right;
position: absolute;
@@ -136,7 +128,7 @@
right: 0px;
}
-.rf-au-shadow-b{
+.rf-au-shdw-b{
background-image: "url(#{resource['org.richfaces:combo_list_shadow.png']})";
background-position: right top;
position: absolute;
@@ -146,7 +138,7 @@
right: 0px;
}
-.rf-au-list-ul{
+.rf-au-lst-ul{
margin: 0px;
padding: 0px;
}
\ No newline at end of file
Modified: branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js 2010-10-27 15:23:56 UTC (rev 19691)
@@ -94,7 +94,7 @@
rf.ui = rf.ui || {};
// Constructor definition
rf.ui.Autocomplete = function(componentId, fieldId, options) {
- this.namespace = "."+rf.Event.createNamespace(this.name, this.id);
+ this.namespace = "."+rf.Event.createNamespace(this.name, componentId);
this.options = {};
// call constructor of parent class
$super.constructor.call(this, componentId, componentId+ID.SELECT, fieldId, options);
@@ -115,8 +115,8 @@
var $super = rf.ui.Autocomplete.$super;
var defaultOptions = {
- selectedItemClass:'rf-au-select',
- itemClass:'rf-au-option',
+ selectedItemClass:'rf-au-sel',
+ itemClass:'rf-au-opt',
autofill:true,
minChars:1,
selectFirst:true,
@@ -168,7 +168,7 @@
var index = this.items.index(element);
selectItem.call(this, event, index);
} else {
- this.__onChangeValue(event, getSelectedItemValue.call(this));
+ this.__onEnter(event);
rf.Selection.setCaretTo(rf.getDomElement(this.fieldId));
this.hide(event);
}
@@ -431,10 +431,9 @@
__onBeforeShow: function (event) {
},
__onEnter: function (event) {
- this.__onChangeValue(event, getSelectedItemValue.call(this));
- //rf.getDomElement(this.fieldId).blur();
- //rf.Selection.setCaretTo(rf.getDomElement(this.fieldId));
- //rf.getDomElement(this.fieldId).focus();
+ var value = getSelectedItemValue.call(this);
+ this.__onChangeValue(event, value);
+ this.invokeEvent("selectitem", rf.getDomElement(this.fieldId), event, value);
},
__onShow: function (event) {
if (this.options.selectFirst) {
Modified: branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutocompleteBase.js
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutocompleteBase.js 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutocompleteBase.js 2010-10-27 15:23:56 UTC (rev 19691)
@@ -1,24 +1,3 @@
-// TODO: move this extend to RichFaces.Event for exapmle
-$.extend(RichFaces.Event, {
- bindScrollEventHandlers: function(element, handler, component) {
- var elements = [];
- element = RichFaces.getDomElement(element).parentNode;
- while (element && element!=window.document.body)
- {
- if (element.offsetWidth!=element.scrollWidth || element.offsetHeight!=element.scrollHeight)
- {
- elements.push(element);
- RichFaces.Event.bind(element, "scroll"+component.getNamespace(), handler, component);
- }
- element = element.parentNode;
- }
- return elements;
- },
- unbindScrollEventHandlers: function(elements, component) {
- RichFaces.Event.unbind(elements, "scroll"+component.getNamespace());
- }
-});
-
(function (rf) {
rf.KEYS = {
BACKSPACE: 8,
@@ -31,8 +10,8 @@
UP: 38,
RIGHT: 39,
DOWN: 40,
- DEL: 46,
- }
+ DEL: 46
+ };
})(RichFaces);
(function ($, rf) {
@@ -76,6 +55,7 @@
inputEventHandlers["blur"+this.namespace] = onBlur;
inputEventHandlers["click"+this.namespace] = onClick;
inputEventHandlers[($.browser.opera ? "keypress" : "keydown")+this.namespace] = onKeyDown;
+ inputEventHandlers["change"+this.namespace] = function (event) {if (this.focused) {event.stopPropagation()}};
rf.Event.bindById(this.fieldId, inputEventHandlers, this);
inputEventHandlers = {};
@@ -107,17 +87,29 @@
};
var onFocus = function (event) {
- this.focused = true;
+ if (!this.focused) {
+ this.__focusValue = this.getInputValue();
+ this.focused = true;
+ this.invokeEvent("focus", rf.getDomElement(this.fieldId), event);
+ }
};
var onBlur = function (event) {
if (this.isMouseDown) {
rf.getDomElement(this.fieldId).focus();
this.isMouseDown = false;
- } else if (this.isVisible && !this.isMouseDown) {
- var _this = this;
- this.timeoutId = window.setTimeout(function(){_this.hide();}, 200);
- this.focused=false;
+ } else if (!this.isMouseDown) {
+ if (this.isVisible) {
+ var _this = this;
+ this.timeoutId = window.setTimeout(function(){_this.hide();}, 200);
+ }
+ if (this.focused) {
+ this.focused=false;
+ this.invokeEvent("blur", rf.getDomElement(this.fieldId), event);
+ if (this.__focusValue != this.getInputValue()) {
+ this.invokeEvent("change", rf.getDomElement(this.fieldId), event);
+ }
+ }
}
};
@@ -192,7 +184,7 @@
}
break;
}
- }
+ };
/*
* public API functions definition
Copied: branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js (from rev 19674, trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,158 @@
+// TODO: remove when these functions will be moved to the RichFaces.Event <!--
+
+(function (rf) {
+ rf.KEYS = {
+ BACKSPACE: 8,
+ TAB: 9,
+ RETURN: 13,
+ ESC: 27,
+ PAGEUP: 33,
+ PAGEDOWN: 34,
+ LEFT: 37,
+ UP: 38,
+ RIGHT: 39,
+ DOWN: 40,
+ DEL: 46
+ };
+})(RichFaces);
+
+
+$.extend(RichFaces.Event, {
+ bindScrollEventHandlers: function(element, handler, component) {
+ var elements = [];
+ element = RichFaces.getDomElement(element).parentNode;
+ while (element && element!=window.document.body)
+ {
+ if (element.offsetWidth!=element.scrollWidth || element.offsetHeight!=element.scrollHeight)
+ {
+ elements.push(element);
+ RichFaces.Event.bind(element, "scroll"+component.getNamespace(), handler, component);
+ }
+ element = element.parentNode;
+ }
+ return elements;
+ },
+ unbindScrollEventHandlers: function(elements, component) {
+ RichFaces.Event.unbind(elements, "scroll"+component.getNamespace());
+ }
+});
+// -->
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.InplaceBase = function(id, options) {
+ $super.constructor.call(this, id);
+ var mergedOptions = $.extend({}, defaultOptions, options);
+ this.editEvent = mergedOptions.editEvent;
+ this.noneCss = mergedOptions.noneCss;
+ this.changedCss = mergedOptions.changedCss;
+ this.defaultLabel = mergedOptions.defaultLabel;
+ this.state = mergedOptions.state;
+ this.element = $(document.getElementById(id));
+ this.editContainer = $(document.getElementById(id+"Edit"));
+ this.element.bind(this.editEvent, $.proxy(this.__editHandler, this));
+ this.isSaved = false;
+ this.useDefaultLabel = false;
+ };
+
+ rf.ui.InputBase.extend(rf.ui.InplaceBase);
+ var $super = rf.ui.InplaceBase.$super;
+
+ var defaultOptions = {
+ editEvent: "click",
+ state: "ready"
+ };
+
+ $.extend(rf.ui.InplaceBase.prototype, ( function () {
+
+ var STATE = {
+ READY : 'ready',
+ CHANGED: 'changed',
+ DISABLE: 'disable',
+ EDIT: 'edit'
+ };
+
+ return {
+
+ getLabel: function() {
+ },
+
+ setLabel: function(value) {
+ },
+
+ onshow: function(){
+ },
+
+ onhide: function() {
+ },
+
+ isValueSaved: function() {
+ return this.isSaved;
+ },
+
+ save: function() {
+ var value = this.getValue()
+ if(value.length > 0) {
+ this.setLabel(value);
+ } else {
+ this.setLabel(this.defaultLabel);
+ this.useDefaultLabel = true;
+ }
+
+ this.isSaved = true;
+
+ this.__applyChangedStyles();
+ this.__hide();
+ },
+
+ cancel: function(){
+ var text = "";
+ if(!this.useDefaultLabel) {
+ text = this.getLabel()
+ }
+ this.setValue(text);
+ this.isSaved = true;
+ this.__hide();
+ },
+
+ __applyChangedStyles: function() {
+ if(this.isValueChanged()) {
+ this.element.addClass(this.changedCss);
+ } else {
+ this.element.removeClass(this.changedCss);
+ }
+ },
+
+ __show: function() {
+ this.scrollElements = rf.Event.bindScrollEventHandlers(this.id, this.__scrollHandler, this);
+ this.onshow();
+ },
+
+ __hide: function() {
+ if(this.scrollElements) {
+ rf.Event.unbindScrollEventHandlers(this.scrollElements, this);
+ this.scrollElements = null;
+ }
+ this.onhide();
+ this.editContainer.addClass(this.noneCss);
+ },
+
+ __editHandler: function(e) {
+ this.isSaved = false;
+ this.editContainer.removeClass(this.noneCss);
+ this.__show();
+ },
+ __scrollHandler: function(e) {
+ this.cancel();
+ },
+
+ destroy: function () {
+ $super.destroy.call(this);
+ }
+ }
+
+ })());
+
+})(jQuery, window.RichFaces);
Modified: branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss 2010-10-27 15:23:56 UTC (rev 19691)
@@ -1,6 +1,7 @@
-input.rf-ii-f {
+input.rf-ii-fld {
background-image: none;
background-color : '#{richSkin.editBackgroundColor}';
+ /*TODO: seems these styles are incorrect*/
border-bottom-width : 10px;
border-bottom-style: solid;
border-bottom-color: '#{richSkin.editBackgroundColor}';
@@ -13,6 +14,17 @@
font-size : inherit;
}
+.rf-ii-edit {
+ position : absolute;
+ top : 0px;
+ left : 0px;
+ display : inline-block;
+ width: 100%;
+}
+
+.rf-ii-dis-s {
+}
+
.rf-ii-lbl {
white-space : nowrap;
}
@@ -38,14 +50,9 @@
}
.rf-ii-e-s {
- position : absolute;
- top : 0px;
- left : 0px;
- display : inline-block;
- width: 100%;
}
-.rf-ii-f {
+.rf-ii-fld {
background-color : '#{richSkin.editBackgroundColor}';
border-bottom-width : 10px;
border-bottom-style: solid;
@@ -63,7 +70,7 @@
}
.rf-ii-btn {
- background-image : "url(#{resource['org.richfaces.images:inplaceBtnGrad.png']})";
+ background-image : url("#{resource['org.richfaces.images:inplaceBtnGrad.png']}");
background-attachment: scroll;
background-position: center top;
background-repeat: repeat-x;
@@ -76,7 +83,7 @@
}
.rf-ii-btn-p {
- background-image : "url(#{resource['org.richfaces.images:inplaceBtnPressGrad.png']})";
+ background-image : url("#{resource['org.richfaces.images:inplaceBtnPressGrad.png']}");
background-position: top;
background-repeat: repeat-x;
background-color: '#{richSkin.tabBackgroundColor}';
@@ -109,7 +116,7 @@
white-space : nowrap;
}
-.rf-ii-btn-shadow {
+.rf-ii-btn-shdw {
display: inline-block;
position: relative;
padding : 6px 6px 6px 6px;
@@ -117,7 +124,7 @@
right : -6px;
}
-.rf-ii-btn-shadow-t {
+.rf-ii-btn-shdw-t {
background-position : left top;
background-image : url("#{resource['org.richfaces:bg_shadow.png']}");
background-attachment: scroll;
@@ -130,7 +137,7 @@
left : 0px
}
-.rf-ii-btn-shadow-l {
+.rf-ii-btn-shdw-l {
background-position : left bottom;
background-image : url("#{resource['org.richfaces:bg_shadow.png']}");
background-attachment: scroll;
@@ -143,7 +150,7 @@
right : 6px;
}
-.rf-ii-btn-shadow-r {
+.rf-ii-btn-shdw-r {
background-position : right bottom;
background-image : url("#{resource['org.richfaces:bg_shadow.png']}");
background-attachment: scroll;
@@ -156,7 +163,7 @@
right: 0px;
}
-.rf-ii-btn-shadow-b {
+.rf-ii-btn-shdw-b {
background-position : right top;
background-image : url("#{resource['org.richfaces:bg_shadow.png']}");
background-attachment: scroll;
Modified: branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-10-27 15:23:56 UTC (rev 19691)
@@ -1,134 +1,96 @@
-// TODO: remove when these functions will be moved to the RichFaces.Event
-$.extend(RichFaces.Event, {
- bindScrollEventHandlers: function(element, handler, component) {
- var elements = [];
- element = RichFaces.getDomElement(element).parentNode;
- while (element && element!=window.document.body)
- {
- if (element.offsetWidth!=element.scrollWidth || element.offsetHeight!=element.scrollHeight)
- {
- elements.push(element);
- RichFaces.Event.bind(element, "scroll"+component.getNamespace(), handler, component);
- }
- element = element.parentNode;
- }
- return elements;
- },
- unbindScrollEventHandlers: function(elements, component) {
- RichFaces.Event.unbind(elements, "scroll"+component.getNamespace());
- }
-});
-
(function ($, rf) {
rf.ui = rf.ui || {};
rf.ui.InplaceInput = function(id, options) {
- /*TODO: use defaultOptions*/
- $super.constructor.call(this, id);
- this.attachToDom(id);
+ var mergedOptions = $.extend({}, defaultOptions, options);
+ $super.constructor.call(this, id, mergedOptions);
+ this.label = $(document.getElementById(id+"Label"));
+ var labelText = this.label.text();
+ var inputLabel = this.getValue();
+ this.initialValue = (labelText == inputLabel) ? labelText : "";
+ this.saveOnBlur = mergedOptions.saveOnBlur;
+ this.showControls = mergedOptions.showControls;
+ this.getInput().bind("focus", $.proxy(this.__editHandler, this));
- this.namespace = this.namespace || "." + rf.Event.createNamespace(this.name, this.id);
-
- this.currentState = options.state;
- this.editEvent = options.editEvent;
- this.noneCss = options.noneCss;
- this.changedCss = options.changedCss;
- this.showControls = options.showControls;
- this.defaultLabel = options.defaultLabel;
-
- this.element = $(document.getElementById(id));
- this.editContainer = $(document.getElementById(options.editContainer));
- this.input = $(document.getElementById(options.input));
- this.label = $(document.getElementById(options.label));
- this.focusElement = $(document.getElementById(options.focusElement));
-
- var label = this.label.text();
- var inputLabel = this.input.val();
-
- this.initialValue = (label == inputLabel) ? label : "";
-
- this.element.bind(this.editEvent, $.proxy(this.__editHandler, this));
- this.input.bind("focus", $.proxy(this.__editHandler, this));
- this.input.bind("change", $.proxy(this.__changeHandler, this));
- this.input.bind("blur", $.proxy(this.__blurHandler, this));
- this.input.bind("keydown", $.proxy(this.__keydownHandler, this));
-
- if(this.showControls) {
- this.okbtn = $(document.getElementById(options.okbtn));
- this.cancelbtn = $(document.getElementById(options.cancelbtn));
+ if(this.showControls) {
+ this.okbtn = $(document.getElementById(id+"Okbtn"));
+ this.cancelbtn = $(document.getElementById(id+"Cancelbtn"));
this.okbtn.bind("mousedown", $.proxy(this.__saveBtnHandler, this));
this.cancelbtn.bind("mousedown", $.proxy(this.__cancelBtnHandler, this));
}
+ this.focusElement = $(document.getElementById(id+"Focus"));
};
-
- // Extend component class and add protected methods from parent class to our container
- rf.BaseComponent.extend( rf.ui.InplaceInput);
-
- // define super class link
+
+ rf.ui.InplaceBase.extend(rf.ui.InplaceInput);
var $super = rf.ui.InplaceInput.$super;
+ var defaultOptions = {
+ defaultLabel: "",
+ saveOnBlur: true,
+ showControl: true,
+ itemCss: "rf-ii-opt",
+ selectItemCss: "rf-ii-sel",
+ listCss: "rf-ii-lst-cord",
+ noneCss: "rf-ii-none",
+ //not used in inputBase?
+ editCss: "rf-ii-edit",
+ changedCss: "rf-ii-c-s"
+ };
+
$.extend(rf.ui.InplaceInput.prototype, ( function () {
-
- var isSaved = false;
- var isValueChanged = false;
-
+
return {
- name : "inplaceInput",
-/****************** public methods *****************************************/
+ name : "inplaceInput",
+
+ geName: function() {
+ return this.name;
+ },
+
+ geNamespace: function() {
+ return this.namespace;
+ },
- getNamespace: function () {
- return this.namespace;
- },
-
- edit: function() {
- isSaved = false;
- this.__show();
- this.input.focus();
- },
-
- save: function() {
- var inputValue = this.input.val();
- if(inputValue.length > 0) {
- this.label.text(inputValue);
- isValueChanged = true;
- } else {
- this.label.text(this.defaultLabel);
- isValueChanged = false;
+ __keydownHandler: function(e) {
+ switch(e.keyCode || e.which) {
+ case 27:
+ e.preventDefault();
+ this.cancel();
+ break;
+ case 13:
+ e.preventDefault();
+ this.save();
+ return false;
+ break;
}
-
- if(inputValue != this.initialValue) {
- this.element.addClass(this.changedCss);
+ },
+
+ __blurHandler: function(e) {
+ if(!this.isValueSaved() && this.__isSaveOnBlur()) {
+ this.save();
} else {
- this.element.removeClass(this.changedCss);
+ this.__hide();
}
- isSaved = true;
- this.__hide();
- },
+ return false;
+ },
+
+ __changeHandler: function(e) {
+ if(!this.isValueSaved()) {
+ this.save();
+ }
+ },
- cancel: function() {
- var text = "";
- if(isValueChanged) {
- text = this.label.text();
- }
- this.input.val(text);
- isSaved = true;
- this.__hide();
- this.element.focus();
+ __isSaveOnBlur: function() {
+ return this.saveOnBlur;
},
- setValue: function (value) {
- this.input.val(value);
- this.save();
+ __setInputFocus: function() {
+ this.getInput().unbind("focus", this.__editHandler);
+ this.getInput().focus();
+ this.getInput().bind("focus", $.proxy(this.__editHandler, this));
},
- getValue: function() {
- return this.input.val();
- },
-
-/****************** private methods *****************************************/
-
__saveBtnHandler: function(e) {
this.save();
return false;
@@ -137,63 +99,29 @@
__cancelBtnHandler: function(e) {
this.cancel();
return false;
+ },
+
+ getLabel: function() {
+ return this.label.text();
},
-
- __editHandler: function(e) {
- this.input.unbind("focus", this.__editHandler);
- this.edit();
- this.input.bind("focus", $.proxy(this.__editHandler, this));
+
+ setLabel: function(value) {
+ this.label.text(value);
},
- __changeHandler: function(e) {
- if(!isSaved) {
- this.save();
- }
- },
-
- __blurHandler: function(e) {
- if(!isSaved) {
- this.save();
- }
- return false;
+ isValueChanged: function () {
+ return (this.getValue() != this.initialValue);
},
-
- __scrollHandler: function(e) {
- this.cancel();
- },
-
- __keydownHandler: function(e) {
- switch(e.keyCode) {
- /*Esc*/
- case 27:
- this.cancel();
- break;
- /*Enter*/
- case 13:
- this.save();
- return false;
- }
-
- },
-
- __show: function() {
- this.scrollElements = rf.Event.bindScrollEventHandlers(this.id, this.__scrollHandler, this);
- this.editContainer.removeClass(this.noneCss);
- },
-
- __hide: function() {
- rf.Event.unbindScrollEventHandlers(this.scrollElements, this);
- this.scrollElements = null;
- this.editContainer.addClass(this.noneCss);
- this.focusElement.focus();
- },
+
+ onshow: function(){
+ this.__setInputFocus();
+ },
+
+ onhide: function() {
+ this.focusElement.focus();
+ }
- destroy: function () {
- //TODO: unbind handlers
- $super.destroy.call(this);
- }
- }
- })());
+ }
+ })());
-})(jQuery, window.RichFaces);
-
+})(jQuery, window.RichFaces);
\ No newline at end of file
Copied: branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.ecss (from rev 19674, trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.ecss)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.ecss (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.ecss 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,224 @@
+input.rf-is-fld {
+ background : '#{richSkin.editBackgroundColor}';
+ padding : 0px 0px 0px 0px;
+ border : 0px;
+ margin : 0px;
+ width : 112px;
+ background-image:"url(#{resource['org.richfaces:mark_list.gif']})";
+ background-position : center right;
+ background-repeat : no-repeat;
+ font-family:inherit;
+ font-size : inherit;
+}
+
+.rf-is-none {
+ clip: "rect(0px 0px 1px 1px)";
+}
+
+.rf-is-none {
+ clip: rect(0px, 0px, 1px, 1px);
+}
+
+.rf-is-dis-s {
+}
+
+.rf-is-edit {
+ position : absolute;
+ top : 0px;
+ left : 0px;
+ width : 100px;
+ background-color : '#{richSkin.editBackgroundColor}';
+}
+
+.rf-is-fnt {
+}
+
+.rf-is-d-s {
+ display : inline-block;
+ position : relative;
+ white-space : nowrap;
+ background-color : '#{richSkin.editorBackgroundColor}';
+ border-bottom-width : 1px;
+ border-bottom-style : dashed;
+ border-bottom-color : '#{richSkin.generalTextColor}';
+ padding-left : 3px;
+ padding-right : 3px;
+}
+
+.rf-is-c-s {
+ display : inline-block;
+ background-image : "url(#{resource['org.richfaces:mark_changed.gif']})";
+ background-position : top left;
+ background-repeat : no-repeat;
+}
+
+.rf-is-e-s {
+}
+
+.rf-is-fld {
+ background-color : '#{richSkin.editBackgroundColor}';
+ padding : 0px 0px 0px 0px;
+ border : 0px;
+ margin : 0px;
+ width : 112px;
+ background-image: "url(#{resource['org.richfaces:mark_list.gif']})";
+ background-position : center right;
+ background-repeat : no-repeat;
+}
+
+.rf-is-btn {
+ background-image : url("#{resource['org.richfaces.images:inplaceBtnGrad.png']}");
+ background-position : top;
+ background-repeat: repeat-x;
+ background-color: '#{richSkin.tabBackgroundColor}';
+ border-width : 1px;
+ border-style : outset;
+ border-color : '#{richSkin.panelBorderColor}';
+ padding : 3px;
+ margin : 0px;
+}
+
+.rf-is-btn-p {
+ background-image : url("#{resource['org.richfaces.images:inplaceBtnPressGrad.png']}");
+ background-position : top;
+ background-repeat : repeat-x;
+ background-color : '#{richSkin.tabBackgroundColor}';
+ border-width : 1px;
+ border-style : inset;
+ border-color : '#{richSkin.panelBorderColor}';
+ padding : 3px;
+ margin : 0px;
+}
+
+.rf-is-btn-set {
+ position : absolute;
+ top : 0px;
+ left : 112px;
+ white-space : nowrap;
+}
+
+.rf-is-lst-cord {
+ display : block;
+ /*font-size : 0px;*/
+ position : relative;
+ font-family:inherit;
+ font-size : inherit;
+}
+
+.rf-is-lst-pos {
+ display : block;
+ position : absolute;
+ top: 0px;
+ left: -1px;
+}
+
+.rf-is-lst-dec {
+ display : block;
+ border-width : 1px;
+ border-style : solid;
+ border-color : '#{richSkin.panelBorderColor}';
+ padding : 0px;
+ /*width: 100%;*/
+ background-color : '#{richSkin.editBackgroundColor}';
+}
+
+.rf-is-lst-scrl {
+ display : block;
+ overflow : auto;
+ overflow-x : hidden;
+ /*height : 100px;*/
+}
+
+.rf-is-opt {
+ display : block;
+ padding : 2px;
+ white-space : nowrap;
+ background-color : '#{richSkin.editBackgroundColor}';
+ cursor : default;
+}
+
+.rf-is-sel {
+ display : block;
+ padding : 1px;
+ background-color: #DFE8F6; /*get from skin???*/
+ border-width : 1px;
+ border-style : dotted;
+ border-color : '#{richSkin.generalTextColor}';
+}
+
+.rf-is-btn-prepos {
+ display : block;
+ position : absolute;
+ top : -4px;
+ right : 0px;
+ wigth : 1px;
+ height : 1px;
+}
+
+.rf-is-btn-pos {
+ display : block;
+ position : absolute;
+ top : 0px;
+ left : 0px;
+ white-space : nowrap;
+}
+
+.rf-is-btn-shdw {
+ display : block;
+ position: relative;
+ padding : 6px 6px 6px 6px;
+ top : -6px;
+ right : -6px;
+}
+
+.rf-is-shdw {
+ display : block;
+ position: relative;
+ padding : 6px 6px 6px 6px;
+ top : -6px;
+ left : -6px;
+}
+
+.rf-is-shdw-t {
+ display : block;
+ background-image : "url(#{resource['org.richfaces:bg_shadow.png']})";
+ background-position : top left;
+ position: absolute;
+ width: 6px;
+ top: 0px;
+ bottom: 6px;
+ left : 0px
+}
+
+.rf-is-shdw-l {
+ display : block;
+ background-image : "url(#{resource['org.richfaces:bg_shadow.png']})";
+ background-position : bottom left;
+ position : absolute;
+ height : 6px;
+ bottom : 0px;
+ left : 0px;
+ right : 6px;
+}
+
+.rf-is-shdw-r {
+ display : block;
+ background : "url(#{resource['org.richfaces:bg_shadow.png']})";
+ background-position : bottom right;
+ position : absolute;
+ width : 6px;
+ top : 6px;
+ bottom : 0px;
+ right : 0px;
+}
+
+.rf-is-shdw-b {
+ display : block;
+ background : "url(#{resource['org.richfaces:bg_shadow.png']})";
+ background-position : right top;
+ position: absolute;
+ height : 6px;
+ top: 0px;
+ left : 6px;
+ right : 0px;
+}
Copied: branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js (from rev 19674, trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,142 @@
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.InplaceSelect = function(id, options) {
+ var mergedOptions = $.extend({}, defaultOptions, options);
+ $super.constructor.call(this, id, mergedOptions)
+ mergedOptions['attachTo'] = id;
+ this.popupList = new rf.ui.PopupList(id+"List", this, mergedOptions);
+ this.items = mergedOptions.items;
+ this.selValueInput = $(document.getElementById(id+"selValue"));
+ this.openPopup = false;
+ }
+
+ rf.ui.InplaceInput.extend(rf.ui.InplaceSelect);
+ var $super = rf.ui.InplaceSelect.$super;
+
+ var defaultOptions = {
+ defaultLabel: "",
+ showControl: false,
+ itemCss: "rf-is-opt",
+ selectItemCss: "rf-is-sel",
+ listCss: "rf-is-lst-cord",
+ noneCss: "rf-is-none",
+ editCss: "rf-is-edit",
+ changedCss: "rf-is-c-s"
+ };
+
+
+ $.extend(rf.ui.InplaceSelect.prototype, ( function () {
+
+ return{
+ name : "inplaceSelect",
+
+ getName: function() {
+ return this.name;
+ },
+
+ geNamespace: function() {
+ return this.namespace;
+ },
+
+ onshow: function() {
+ if(this.openPopup) {
+ this.popupList.show();
+ }
+
+ if(!this.openPopup) {
+ this.openPopup = true;
+ }
+
+ $super.onshow.call(this);
+ },
+
+ onhide: function() {
+ this.popupList.hide();
+ this.openPopup = false;
+ },
+
+ processItem: function(item) {
+ var key = $(item).attr("id");
+ var value = this.getItemValue(key);
+ this.saveItemValue(value);
+ var label = this.getItemLabel(key);
+ this.setValue(label);
+
+ this.popupList.hide();
+ this.openPopup = false;
+ this.__setInputFocus();
+ },
+
+ getItemValue: function(key) {
+ for(var i in this.items) {
+ var item = this.items[i];
+ if(item && item.id == key) {
+ return item.value;
+ }
+ }
+ },
+
+ saveItemValue: function(value) {
+ this.selValueInput.val(value);
+ },
+
+ getItemLabel: function(key) {
+ for(var i in this.items) {
+ var item = this.items[i];
+ if(item && item.id == key) {
+ return item.label;
+ }
+ }
+ },
+
+ __keydownHandler: function(e) {
+
+ var code;
+
+ if(e.keyCode) {
+ code = e.keyCode;
+ } else if(e.which) {
+ code = e.which;
+ }
+
+ if(this.popupList.isVisible()) {
+ switch(code) {
+ case rf.KEYS.DOWN:
+ e.preventDefault();
+ this.popupList.__selectNext();
+ this.__setInputFocus();
+ break;
+
+ case rf.KEYS.UP:
+ e.preventDefault();
+ this.popupList.__selectPrev();
+ this.__setInputFocus();
+ break;
+
+ case rf.KEYS.RETURN:
+ e.preventDefault();
+ this.popupList.__selectCurrent();
+ this.__setInputFocus();
+ return false;
+ break;
+ }
+ }
+
+ $super.__keydownHandler.call(this,e);
+
+ },
+
+ __blurHandler: function(e) {
+ var target = $(e.originalEvent.explicitOriginalTarget);
+ if(!this.popupList.isPopupList(target)) {
+ $super.__blurHandler.call(this,e);
+ }
+ return false;
+ }
+ }
+
+ })());
+
+})(jQuery, window.RichFaces);
Copied: branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js (from rev 19674, trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,91 @@
+(function (rf) {
+ rf.KEYS = {
+ BACKSPACE: 8,
+ TAB: 9,
+ RETURN: 13,
+ ESC: 27,
+ PAGEUP: 33,
+ PAGEDOWN: 34,
+ LEFT: 37,
+ UP: 38,
+ RIGHT: 39,
+ DOWN: 40,
+ DEL: 46
+ };
+})(RichFaces);
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.InputBase = function(id, options) {
+ $super.constructor.call(this, id);
+ this.namespace = this.getNamespace() || "." + rf.Event.createNamespace(this.getName(), this.getId());
+
+ this.id = id;
+ this.input = $(document.getElementById(id + "Input"));
+ this.attachToDom(id);
+
+ this.input.bind("keydown", $.proxy(this.__keydownHandler, this));
+ this.input.bind("blur", $.proxy(this.__blurHandler, this));
+ this.input.bind("change", $.proxy(this.__changeHandler, this));
+ this.input.bind("click", $.proxy(this.__clickHandler, this));
+ this.input.bind("focus", $.proxy(this.__focusHandler, this));
+ };
+
+ rf.BaseComponent.extend(rf.ui.InputBase);
+ var $super = rf.ui.InputBase.$super;
+
+ $.extend(rf.ui.InputBase.prototype, ( function () {
+
+ return {
+
+ name : "inputBase",
+
+ getName: function() {
+ return this.name;
+ },
+
+ getNamespace: function() {
+ return this.namespace;
+ },
+
+ __focusHandler: function(e) {
+
+ },
+
+ __clickHandler: function(e) {
+ },
+
+ __keydownHandler: function(e) {
+ },
+
+ __blurHandler: function(e) {
+ },
+
+ __changeHandler: function(e) {
+ },
+
+ __setInputFocus: function() {
+ this.input.focus();
+ },
+
+ getValue: function() {
+ return this.input.val();
+ },
+
+ setValue: function(value){
+ this.input.val(value);
+ },
+
+ getInput: function() {
+ return this.input;
+ },
+
+ getId: function() {
+ return this.id;
+ }
+ }
+ })());
+
+})(jQuery, window.RichFaces);
\ No newline at end of file
Modified: branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.ecss
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.ecss 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.ecss 2010-10-27 15:23:56 UTC (rev 19691)
@@ -19,31 +19,31 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-.rf-ins, .rf-ins-ta {
+.rf-insl, .rf-insl-trc-cntr {
display: inline-block;
}
-.rf-ins {
+.rf-insl {
white-space: nowrap;
}
-.rf-ins-ta {
+.rf-insl-trc-cntr {
width: 200px; /*TODO remove it*/
vertical-align: top;
}
-.rf-ins-mn, .rf-ins-mx, input.rf-ins-i, .rf-ins-tt {
+.rf-insl-mn, .rf-insl-mx, input.rf-insl-inp, .rf-insl-tt {
font-size: '#{richSkin.generalSizeFont}';
font-family: '#{richSkin.generalFamilyFont}';
color: '#{richSkin.generalTextColor}';
}
-.rf-ins-mn, .rf-ins-mx {
+.rf-insl-mn, .rf-insl-mx {
display: block;
margin-bottom: 3px;
}
-.rf-ins-mn {
+.rf-insl-mn {
border-left-width: 1px;
border-left-style: solid;
border-left-color: '#{richSkin.panelBorderColor}';
@@ -51,7 +51,7 @@
float: left;
}
-.rf-ins-mx {
+.rf-insl-mx {
border-right-width: 1px;
border-right-style: solid;
border-right-color: '#{richSkin.panelBorderColor}';
@@ -60,12 +60,12 @@
text-align: right;
}
-.rf-ins-ci {
+.rf-insl-inp-cntr {
margin: 0px;
vertical-align: bottom;
}
-input.rf-ins-i {
+input.rf-insl-inp {
background: url("#{resource['org.richfaces.renderkit.html.images.InputBackgroundImage']}") top repeat-x;
background-color: '#{richSkin.controlBackgroundColor}';
border-width: 1px;
@@ -75,7 +75,7 @@
vertical-align: bottom;
}
-.rf-ins-tt {
+.rf-insl-tt {
position: absolute;
display: none;
/* TODO padding: 2px;
@@ -83,7 +83,7 @@
background-color: '#{richSkin.tipBackgroundColor}';*/
}
-.rf-ins-t {
+.rf-insl-trc {
background: url("#{resource['org.richfaces.images:insldrTrackGrad.png']}") 1px 1px repeat-x;
background-color: '#{richSkin.controlBackgroundColor}';
border-width: 1px;
@@ -97,53 +97,53 @@
font-size: 0px;
}
-.rf-ins-h, .rf-ins-h-d, .rf-ins-db, .rf-ins-ib, .rf-ins-db-d, .rf-ins-ib-d {
+.rf-insl-hnd, .rf-insl-hnd-dis, .rf-insl-dec, .rf-insl-inc, .rf-insl-dec-dis, .rf-insl-inc-dis {
display: inline-block;
width: 7px;
height: 7px;
}
-.rf-ins-h, .rf-ins-h-d {
+.rf-insl-hnd, .rf-insl-hnd-dis {
vertical-align: top;
}
-.rf-ins-db, .rf-ins-ib, .rf-ins-db-d, .rf-ins-ib-d {
+.rf-insl-dec, .rf-insl-inc, .rf-insl-dec-dis, .rf-insl-inc-dis {
vertical-align: bottom;
}
-.rf-ins-h {
+.rf-insl-hnd {
background-image: url("#{resource['org.richfaces.renderkit.html.images.SliderArrowBottom']}");
}
-.rf-ins-h-s {
+.rf-insl-hnd-sel {
background-image: url("#{resource['org.richfaces.renderkit.html.images.SliderSelectedArrowBottom']}");
}
-.rf-ins-h-d {
+.rf-insl-hnd-dis {
background-image: url("#{resource['org.richfaces.renderkit.html.images.SliderDisabledArrowBottom']}");
}
-.rf-ins-db {
+.rf-insl-dec {
background-image: url("#{resource['org.richfaces.renderkit.html.images.SliderArrowLeft']}");
}
-.rf-ins-db-s {
+.rf-insl-dec-sel {
background-image: url("#{resource['org.richfaces.renderkit.html.images.SliderSelectedArrowLeft']}");
}
-.rf-ins-db-d {
+.rf-insl-dec-dis {
background-image: url("#{resource['org.richfaces.renderkit.html.images.SliderDisabledArrowLeft']}");
}
-.rf-ins-ib {
+.rf-insl-inc {
background-image: url("#{resource['org.richfaces.renderkit.html.images.SliderArrowRight']}");
}
-.rf-ins-ib-s {
+.rf-insl-inc-sel {
background-image: url("#{resource['org.richfaces.renderkit.html.images.SliderSelectedArrowRight']}");
}
-.rf-ins-ib-d {
+.rf-insl-inc-dis {
background-image: url("#{resource['org.richfaces.renderkit.html.images.SliderDisabledArrowRight']}");
}
\ No newline at end of file
Modified: branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js 2010-10-27 15:23:56 UTC (rev 19691)
@@ -32,32 +32,32 @@
step: 1,
tabIndex: 0,
- decreaseSelectedClass: "rf-ins-db-s",
- handleSelectedClass: "rf-ins-h-s",
- increaseSelectedClass: "rf-ins-ib-s",
+ decreaseSelectedClass: "rf-insl-dec-sel",
+ handleSelectedClass: "rf-insl-hnd-sel",
+ increaseSelectedClass: "rf-insl-inc-sel",
init: function (id, options, selectedClasses) {
jQuery.extend(this, options);
this.range = this.maxValue - this.minValue;
this.id = id;
this.element = jQuery(this.attachToDom());
- this.input = this.element.children(".rf-ins-ci").children(".rf-ins-i");
- this.track = this.element.children(".rf-ins-ta").children(".rf-ins-t");
- this.handle = this.track.children(".rf-ins-h, .rf-ins-h-d");
- this.tooltip = this.element.children(".rf-ins-tt");
+ this.input = this.element.children(".rf-insl-inp-cntr").children(".rf-insl-inp");
+ this.track = this.element.children(".rf-insl-trc-cntr").children(".rf-insl-trc");
+ this.handle = this.track.children(".rf-insl-hnd, .rf-insl-hnd-dis");
+ this.tooltip = this.element.children(".rf-insl-tt");
- this.__inputHandler();
+ var proxy = jQuery.proxy(this.__inputHandler, this);
+ jQuery(document).ready(proxy);
if (!this.disabled) {
- this.decreaseButton = this.element.children(".rf-ins-db");
- this.increaseButton = this.element.children(".rf-ins-ib");
+ this.decreaseButton = this.element.children(".rf-insl-dec");
+ this.increaseButton = this.element.children(".rf-insl-inc");
this.track[0].tabIndex = this.tabIndex;
for (var i in selectedClasses) {
this[i] += " " + selectedClasses[i];
}
- var proxy = jQuery.proxy(this.__inputHandler, this)
this.input.change(proxy);
this.input.submit(proxy);
this.track.keydown(jQuery.proxy(this.__keydownHandler, this));
@@ -68,20 +68,20 @@
},
decrease: function (event) {
- this.setValue(this.value - this.step);
+ this.setValue(this.value - this.step, event);
},
increase: function (event) {
- this.setValue(this.value + this.step);
+ this.setValue(this.value + this.step, event);
},
- setValue: function (value) {
+ setValue: function (value, event) {
if (!this.disabled) {
- this.__setValue(value);
+ this.__setValue(value, event);
}
},
- __setValue: function (value) {
+ __setValue: function (value, event) {
if (!isNaN(value)) {
value = Math.round(value / this.step) * this.step; //TODO Add normal support of float values. E.g. '0.3' should be instead of '0.30000000000000004'.
if (value > this.maxValue) {
@@ -96,34 +96,37 @@
this.tooltip.text(value);
this.tooltip.setPosition(this.handle,{from: 'LT', offset: [0, -3]}); //TODO Seems offset doesn't work now.
this.value = value;
+ if (this.onchange && (!event || event.type)) {
+ this.onchange.call(this.element[0], event);
+ }
}
}
},
- __inputHandler: function () {
+ __inputHandler: function (event) {
var value = Number(this.input.val());
if (isNaN(value)) {
this.input.val(this.value);
} else {
- this.__setValue(value);
+ this.__setValue(value, event);
}
},
__keydownHandler: function (event) {
if (event.keyCode == 37) { //LEFT
- this.__setValue(Number(this.input.val()) - this.step);
+ this.__setValue(Number(this.input.val()) - this.step, event);
event.preventDefault();
} else if (event.keyCode == 39) { //RIGHT
- this.__setValue(Number(this.input.val()) + this.step);
+ this.__setValue(Number(this.input.val()) + this.step, event);
event.preventDefault();
}
},
__decreaseHandler: function (event) {
var component = this;
- component.decrease();
+ component.decrease(event);
this.intervalId = window.setInterval(function() {
- component.decrease();
+ component.decrease(event);
}, this.delay);
jQuery(document).one("mouseup", true, jQuery.proxy(this.__clearInterval, this));
this.decreaseButton.addClass(this.decreaseSelectedClass);
@@ -132,9 +135,9 @@
__increaseHandler: function (event) {
var component = this;
- component.increase();
+ component.increase(event);
this.intervalId = window.setInterval(function() {
- component.increase();
+ component.increase(event);
}, this.delay);
jQuery(document).one("mouseup",jQuery.proxy(this.__clearInterval, this));
this.increaseButton.addClass(this.increaseSelectedClass);
@@ -163,7 +166,7 @@
__mousemoveHandler: function (event) {
var value = this.range * (event.pageX - this.track.position().left) / (this.track.width()
- this.handle.width()) + this.minValue;
- this.__setValue(value);
+ this.__setValue(value, event);
event.preventDefault();
},
Copied: branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.ecss (from rev 19674, trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.ecss)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.ecss (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.ecss 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,80 @@
+/*
+ * 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.
+ */
+.rf-insp {
+ border-width: 1px;
+ border-style: solid;
+ border-color: '#{richSkin.panelBorderColor}';
+ display: inline-block;
+ font-size: 1px;
+ white-space: nowrap;
+}
+
+input.rf-insp-inp[type="text"] {
+ background-color: '#{richSkin.controlBackgroundColor}';
+ background-imaage: url("#{resource['org.richfaces.renderkit.html.images.InputBackgroundImage']}");
+ background-position:1px 1px;
+ background-repeat:no-repeat;
+ border: 0px;
+ color: '#{richSkin.generalTextColor}';
+ font-family : '#{richSkin.generalFamilyFont}';
+ font-size : '#{richSkin.generalSizeFont}';
+ margin: 0px;
+ padding: 0px;
+ vertical-align: top;
+}
+
+.rf-insp-btns {
+ background-color: '#{richSkin.headerBackgroundColor}';
+ background-image: "url(#{resource['org.richfaces.renderkit.html.images.ButtonBackgroundImage']})";
+ background-position: top left;
+ background-repeat: repeat-x;
+ border-left-width: 1px;
+ border-left-style: solid;
+ border-left-color: '#{richSkin.panelBorderColor}';
+ display: inline-block;
+ vertical-align: top;
+}
+
+
+.rf-insp-dec, .rf-insp-inc, .rf-insp-dec-dis, .rf-insp-inc-dis {
+ background-position: 50% 40%;
+ background-repeat: no-repeat;
+ display: block;
+ height: 8px;
+ width: 15px;
+}
+
+.rf-insp-dec {
+ background-image: url("#{resource['org.richfaces.renderkit.html.images.SpinnerArrowBottom']}");
+}
+
+.rf-insp-inc {
+ background-image: url("#{resource['org.richfaces.renderkit.html.images.SpinnerArrowTop']}");
+}
+
+.rf-insp-dec-dis {
+ background-image: url("#{resource['org.richfaces.renderkit.html.images.SpinnerDisabledArrowBottom']}");
+}
+
+.rf-insp-inc-dis {
+ background-image: url("#{resource['org.richfaces.renderkit.html.images.SpinnerDisabledArrowTop']}");
+}
\ No newline at end of file
Copied: branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.js (from rev 19674, trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.js)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.js (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.js 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,159 @@
+/*
+ * 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.
+ */
+(function(richfaces, jQuery) {
+ richfaces.ui = richfaces.ui || {};
+
+ richfaces.ui.InputNumberSpinner = richfaces.BaseComponent.extendClass({
+
+ name: "InputNumberSpinner",
+
+ cycled: true,
+ delay: 200,
+ maxValue: 100,
+ minValue: 0,
+ step: 1,
+
+ init: function (id, options) {
+ jQuery.extend(this, options);
+ this.id = id;
+ this.element = jQuery(this.attachToDom());
+ this.input = this.element.children(".rf-insp-inp");
+
+ var value = Number(this.input.val());
+ if (isNaN(value)) {
+ value = this.minValue;
+ }
+ this.__setValue(value, null, true);
+
+ if (!this.input.attr("disabled")) {
+ var buttonsArea = this.element.children(".rf-insp-btns");
+ this.decreaseButton = buttonsArea.children(".rf-insp-dec");
+ this.increaseButton = buttonsArea.children(".rf-insp-inc");
+
+ var proxy = jQuery.proxy(this.__inputHandler, this)
+ this.input.change(proxy);
+ this.input.submit(proxy);
+ this.input.submit(proxy);
+ this.input.keydown(jQuery.proxy(this.__keydownHandler, this));
+ this.decreaseButton.mousedown(jQuery.proxy(this.__decreaseHandler, this));
+ this.increaseButton.mousedown(jQuery.proxy(this.__increaseHandler, this));
+ }
+ },
+
+ decrease: function (event) {
+ var value = this.value - this.step;
+ if (value < this.minValue && this.cycled) {
+ value = this.maxValue;
+ }
+ this.__setValue(value, event);
+ },
+
+ increase: function (event) {
+ var value = this.value + this.step;
+ if (value > this.maxValue && this.cycled) {
+ value = this.minValue;
+ }
+ this.__setValue(value, event);
+ },
+
+ getValue: function () {
+ return this.value;
+ },
+
+ setValue: function (value, event) {
+ if (!this.input.attr("disabled")) {
+ this.__setValue(value);
+ }
+ },
+
+ __setValue: function (value, event, skipOnchange) {
+ if (!isNaN(value)) {
+ value = Math.round(value / this.step) * this.step; //TODO Add normal support of float values. E.g. '0.3' should be instead of '0.30000000000000004'.
+ if (value > this.maxValue) {
+ value = this.maxValue;
+ } else if (value < this.minValue) {
+ value = this.minValue;
+ }
+ if (value != this.value) {
+ this.input.val(value);
+ this.value = value;
+ if (this.onchange && !skipOnchange) {
+ this.onchange.call(this.element[0], event);
+ }
+ }
+ }
+ },
+
+ __inputHandler: function (event) {
+ var value = Number(this.input.val());
+ if (isNaN(value)) {
+ this.input.val(this.value);
+ } else {
+ this.__setValue(value, event);
+ }
+ },
+
+ __keydownHandler: function (event) {
+ if (event.keyCode == 40) { //DOWN
+ this.decrease(event);
+ event.preventDefault();
+ } else if (event.keyCode == 38) { //UP
+ this.increase(event);
+ event.preventDefault();
+ }
+ },
+
+ __decreaseHandler: function (event) {
+ var component = this;
+ component.decrease(event);
+ this.intervalId = window.setInterval(function() {
+ component.decrease(event);
+ }, this.delay);
+ var proxy = jQuery.proxy(this.__clearInterval, this);
+ this.decreaseButton.bind("mouseup", true, proxy).bind("mouseout", true, proxy)
+ .css("backgroundPosition", "60% 60%");
+ event.preventDefault();
+ },
+
+ __increaseHandler: function (event) {
+ var component = this;
+ component.increase(event);
+ this.intervalId = window.setInterval(function() {
+ component.increase(event);
+ }, this.delay);
+ var proxy = jQuery.proxy(this.__clearInterval, this);
+ this.increaseButton.bind("mouseup", proxy).bind("mouseout", proxy)
+ .css("backgroundPosition", "60% 60%");
+ event.preventDefault();
+ },
+
+ __clearInterval: function (event) {
+ window.clearInterval(this.intervalId);
+ var button = this.increaseButton;
+ if (event.data) { // decreaseButton
+ button = this.decreaseButton;
+ }
+ button.css("backgroundPosition", " 50% 40%").unbind("mouseout", this.__clearInterval)
+ .unbind("mouseup", this.__clearInterval);
+ }
+ });
+}(window.RichFaces, jQuery));
\ No newline at end of file
Copied: branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js (from rev 19674, trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,74 @@
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.Popup = function(id, options) {
+ this.id = id;
+ this.attachToDom(id);
+ this.popup = $(document.getElementById(id));
+
+ var mergedOptions = $.extend({}, defaultOptions, options);
+ this.visible = mergedOptions.visible;
+ this.attachTo = mergedOptions.attachTo;
+ this.attachToBody = mergedOptions.attachToBody;
+ this.positionType = mergedOptions.positionType;
+ this.positionOffset = mergedOptions.positionOffset;
+
+ this.popup.bind("mouseover", $.proxy(this.__onMouseOver, this));
+ this.popup.bind("click", $.proxy(this.__onClick, this));
+ };
+
+ rf.BaseComponent.extend(rf.ui.Popup);
+ var $super = rf.ui.Popup.$super;
+
+
+ var defaultOptions = {
+ visible: false
+ };
+
+ $.extend(rf.ui.Popup.prototype, (function () {
+
+ return{
+
+ name : "popup",
+
+ show: function() {
+ if(!this.visible) {
+ if(this.attachToBody) {
+ this.parentElement = this.popup.parent();
+ this.popup.detach().appendTo("body");
+ }
+ this.popup.setPosition({id: this.attachTo}, {type: this.positionType , offset: this.positionOffset}).show();
+ this.visible = true;
+ }
+ },
+
+ hide: function() {
+ if(this.visible) {
+ this.popup.hide();
+ this.visible = false;
+ if (this.attachToBody && this.parentElement) {
+ this.popup.detach().appendTo(this.parentElement);
+ this.parentElement = null;
+ }
+ }
+ },
+
+ isVisible: function() {
+ return this.visible;
+ },
+
+ getId: function() {
+ return this.id;
+ },
+
+ __onMouseOver: function(e) {
+ },
+
+ __onClick: function(e) {
+ }
+ }
+
+ })());
+
+})(jQuery, window.RichFaces);
\ No newline at end of file
Copied: branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js (from rev 19674, trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,156 @@
+(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.itemCss = mergedOptions.itemCss;
+ this.listCss = mergedOptions.listCss;
+ this.index = -1;
+ this.__updateItemsList();
+ };
+
+ rf.ui.Popup.extend(rf.ui.PopupList);
+ var $super = rf.ui.PopupList.$super;
+
+ var defaultOptions = {
+ attachToBody: true,
+ positionType: "DROPDOWN",
+ positionOffset: [0,20]
+ };
+
+
+ $.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);
+ }
+ },
+
+ unselectItem: function(item) {
+ if(this.selectListener.unselectItem && typeof this.selectListener.unselectItem == 'function') {
+ this.selectListener.unselectItem(item);
+ } else {
+ item.removeClass(this.selectItemCss);
+ }
+ },
+
+ 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.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;
+ }
+
+ }
+ })());
+
+})(jQuery, window.RichFaces);
\ No newline at end of file
Copied: branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss (from rev 19674, trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,144 @@
+
+.rf-sel-inp.rf-s-fnt, .rf-sel-opt.rf-sel-fnt{
+ color: '#{richSkin.generalTextColor}';
+ font-size: '#{richSkin.generalSizeFont}';
+ font-family: '#{richSkin.generalFamilyFont}';
+}
+
+input.rf-sel-inp {
+ border-width: 0px;
+ background: none;
+ width: 100%;
+}
+
+.rf-sel-fld{
+ width: 200px;
+ position: inline-block;
+ border-width: 1px;
+ border-style: solid;
+ border-color: '#{richSkin.panelBorderColor}';
+ display: inline-block;
+ background-image: "url(#{resource['org.richfaces.renderkit.html.images.AutocompleteFieldGradient']})";
+ background-repeat: repeat-x;
+ background-position: top left;
+ background-color: '#{richSkin.controlBackgroundColor}';
+}
+
+.rf-sel-btn{
+ background-image: "url(#{resource['org.richfaces.renderkit.html.images.AutocompleteButtonGradient']})";
+ background-repeat: repeat-x;
+ background-position: top left;
+ background-color: '#{richSkin.headerBackgroundColor}';
+ text-align: center;
+ border-left-style: solid;
+ border-left-width: 1px;
+ border-left-color: '#{richSkin.panelBorderColor}';
+ width: 15px;
+ position: absolute;
+ top: 0px;
+ right: 0px;
+ height: 200px;
+ padding-top: 1px
+}
+
+.rf-sel-btn-arrow{
+ background-position: center;
+ background-repeat: no-repeat;
+ background-image: "url(#{resource['org.richfaces:combo_down_button.gif']})";
+ cursor: pointer;
+ width: 15px;
+ height: 15px;
+}
+
+.rf-sel-lst-cord{
+ position: absolute;
+ /* TODO nick - review: font-size: 0px; */
+ display: none;
+}
+
+.rf-sel-lst-dcrtn{
+ border-width: 1px;
+ border-style: solid;
+ border-color: '#{richSkin.panelBorderColor}';
+ padding: 0px;
+ background-color: '#{richSkin.tableBackgroundColor}';
+}
+
+.rf-sel-lst-scrl{
+ overflow: auto;
+ overflow-x: hidden;
+ width: 200px;
+ max-height: 100px;
+ min-height: 20px;
+}
+
+.rf-sel-opt{
+ padding: 2px;
+ white-space: nowrap;
+ cursor: default;
+ list-style-type: none;
+}
+
+.rf-sel-sel{
+ padding: 1px;
+ width: 100%;
+ background-color: '#{richSkin.headerBackgroundColor}';
+ border-width: 1px;
+ border-style: dotted;
+ border-color: '#{richSkin.generalTextColor}';
+}
+
+.rf-sel-shdw{
+ border: 0px solid red;
+ display: inline-block;
+ position: absolute;
+ float: left;
+ padding: 6px 6px 6px 6px;
+ top: -6px;
+ left: -7px;
+}
+
+.rf-sel-shdw-t{
+ background-image: "url(#{resource['org.richfaces:combo_list_shadow.png']})";
+ background-position: top left;
+ position: absolute;
+ width: 6px;
+ top: 0px;
+ bottom: 6px;
+ left: 0px
+}
+
+.rf-sel-shdw-l{
+ background-image: "url(#{resource['org.richfaces:combo_list_shadow.png']})";
+ background-position: bottom left;
+ position: absolute;
+ height: 6px;
+ bottom: 0px;
+ left: 0px;
+ right: 6px;
+}
+
+.rf-sel-u-shdw-r{
+ background-image: "url(#{resource['org.richfaces:combo_list_shadow.png']})";
+ background-position: bottom right;
+ position: absolute;
+ width: 6px;
+ top: 6px;
+ bottom: 0px;
+ right: 0px;
+}
+
+.rf-sel-shdw-b{
+ background-image: "url(#{resource['org.richfaces:combo_list_shadow.png']})";
+ background-position: right top;
+ position: absolute;
+ height: 6px;
+ top: 0px;
+ left: 6px;
+ right: 0px;
+}
+
+.rf-sel-lst-ul{
+ margin: 0px;
+ padding: 0px;
+}
\ No newline at end of file
Copied: branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js (from rev 19674, trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,301 @@
+//TODO: to the utils? <--
+(function (rf) {
+ rf.KEYS = {
+ BACKSPACE: 8,
+ TAB: 9,
+ RETURN: 13,
+ ESC: 27,
+ PAGEUP: 33,
+ PAGEDOWN: 34,
+ LEFT: 37,
+ UP: 38,
+ RIGHT: 39,
+ DOWN: 40,
+ DEL: 46
+ };
+})(RichFaces);
+
+
+//TODO: remove when cache will be moved to utils <--
+(function ($, rf) {
+ rf.utils = rf.utils || {};
+
+ rf.utils.Cache = function (key, items, values, useCache) {
+ this.key = key.toLowerCase();
+ this.cache = {}
+ this.cache[this.key] = items || [];
+ this.originalValues = typeof values == "function" ? values(items) : values || this.cache[this.key];
+ this.values = processValues(this.originalValues);
+ this.useCache = useCache || checkValuesPrefix.call(this);
+ };
+
+ var processValues = function (values) {
+ var processedValues = [];
+ for (var i = 0; i<values.length; i++) {
+ processedValues.push(values[i].toLowerCase());
+ }
+ return processedValues;
+ }
+
+ var checkValuesPrefix = function () {
+ var result = true;
+ for (var i = 0; i<this.values.length; i++) {
+ if (this.values[i].indexOf(this.key)!=0) {
+ result = false;
+ break;
+ }
+ }
+ return result;
+ }
+
+ var getItems = function (key, filterFunction) {
+ key = key.toLowerCase();
+ var newCache = [];
+
+ if (key.length < this.key.length) {
+ return newCache;
+ }
+
+ if (this.cache[key]) {
+ newCache = this.cache[key];
+ } else {
+ var useCustomFilterFunction = typeof filterFunction == "function";
+ var itemsCache = this.cache[this.key];
+ for (var i = 0; i<this.values.length; i++) {
+ var value = this.values[i];
+ if (useCustomFilterFunction && filterFunction(key, value)) {
+ newCache.push(itemsCache[i]);
+ } else {
+ var p = value.indexOf(key);
+ if (p == 0) {
+ newCache.push(itemsCache[i]);
+ }
+ }
+ }
+
+ if ((!this.lastKey || key.indexOf(this.lastKey)!=0) && newCache.length > 0) {
+ this.cache[key] = newCache;
+ if (newCache.length==1) {
+ this.lastKey = key;
+ }
+ }
+ }
+
+ return newCache;
+ };
+
+ var getItemValue = function (item) {
+ return this.originalValues[this.cache[this.key].index(item)];
+ };
+
+ var isCached = function (key) {
+ key = key.toLowerCase();
+ return this.cache[key] || this.useCache && key.indexOf(this.key)==0;
+ };
+
+ $.extend(rf.utils.Cache.prototype, (function () {
+ return {
+ getItems: getItems,
+ getItemValue: getItemValue,
+ isCached: isCached
+ };
+ })());
+
+
+})(jQuery, RichFaces);
+
+//-->
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.Select = function(id, options) {
+ $super.constructor.call(this, id);
+ this.id = id;
+ var mergedOptions = $.extend({}, defaultOptions, options);
+ mergedOptions['attachTo'] = id;
+
+ this.defaultLabel = mergedOptions.defaultLabel;
+ var inputLabel = this.getValue() ;
+ this.initialValue = (inputLabel != this.defaultLabel) ? inputLabel : "";
+
+ this.selValueInput = $(document.getElementById(id+"selValue"));
+ this.clientItems = mergedOptions.items;
+
+ if(mergedOptions.showControl) {
+ this.btn = $(document.getElementById(id+"Button"));
+ this.btn.bind("click", $.proxy(this.__clickHandler, this));
+ }
+ this.selectFirst = mergedOptions.selectFirst;
+ this.popupList = new rf.ui.SelectList((id+"List"), this, mergedOptions);
+
+ var items = this.popupList.__getItems();
+ var enableManualInput = mergedOptions.enableManualInput;
+ if (items.length>0 && enableManualInput) {
+ this.cache = new rf.utils.Cache("", items, getData, true);
+ }
+
+ this.changeDelay = mergedOptions.changeDelay;
+ };
+
+ rf.ui.InputBase.extend(rf.ui.Select);
+ var $super = rf.ui.Select.$super;
+
+ var defaultOptions = {
+ defaultLabel: "",
+ selectFirst: true,
+ showControl: true,
+ enableManualInput: false,
+ itemCss: "rf-sel-opt",
+ selectItemCss: "rf-sel-sel",
+ listCss: "rf-sel-lst-cord",
+ changeDelay: 8
+ };
+
+ var REGEXP_TRIM = /^[\n\s]*(.*)[\n\s]*$/;
+
+ var getData = function (nodeList) {
+ var data = [];
+ nodeList.each(function () {;
+ data.push($(this).text().replace(REGEXP_TRIM, "$1"));
+ });
+ return data;
+ }
+
+ $.extend(rf.ui.Select.prototype, ( function () {
+
+ return{
+ name : "select",
+
+ __clickHandler: function(e) {
+ e.preventDefault();
+ if(!this.popupList.isVisible()) {
+ this.popupList.show();
+ this.__setInputFocus();
+ } else {
+ this.popupList.hide();
+ }
+ },
+
+ __focusHandler: function(e) {
+ if(this.getValue() == this.defaultLabel) {
+ this.setValue("");
+ }
+ },
+
+ __keydownHandler: function(e) {
+ var code;
+
+ if(e.keyCode) {
+ code = e.keyCode;
+ } else if(e.which) {
+ code = e.which;
+ }
+
+ var visible = this.popupList.isVisible();
+ switch(code) {
+ case rf.KEYS.DOWN:
+ e.preventDefault();
+ if(!visible) {
+ this.popupList.show();
+ } else {
+ this.popupList.__selectNext() ;
+ }
+ break;
+
+ case rf.KEYS.UP:
+ e.preventDefault();
+ if(visible) {
+ this.popupList.__selectPrev();
+ }
+ break;
+
+ case rf.KEYS.RETURN:
+ e.preventDefault();
+ if(visible) {
+ this.popupList.__selectCurrent();
+ }
+ return false;
+ break;
+
+ default:
+ var _this = this;
+ window.clearTimeout(this.changeTimerId);
+ this.changeTimerId = window.setTimeout(function(){_this.__onChangeValue(e);}, this.changeDelay);
+ break;
+ }
+ },
+
+ __onChangeValue: function(e) {
+ this.popupList.__selectByIndex();
+ var newValue = this.getValue();
+
+ if(this.cache && this.cache.isCached(newValue)) {
+
+ if(this.initialValue !=newValue) {
+ var newItems = this.cache.getItems(newValue);
+ var items = $(newItems);
+ this.popupList.__setItems(items);
+ $(document.getElementById(this.id+"Items")).empty().append(items);
+ }
+
+ if(!this.popupList.isVisible()) {
+ this.popupList.show();
+ }
+
+ if(this.selectFirst) {
+ this.popupList.__selectByIndex(0);
+ }
+ }
+ },
+
+ __blurHandler: function(e) {
+ var target = $(e.originalEvent.explicitOriginalTarget);
+ if(!this.popupList.isPopupList(target)) {
+ var inputLabel = this.getValue();
+ if(!inputLabel || inputLabel == "") {
+ this.setValue(this.defaultLabel);
+ }
+ this.popupList.hide();
+ return true;
+ }
+ return false;
+ },
+
+ processItem: function(item) {
+ var key = $(item).attr("id");
+ var value = this.getItemValue(key);
+ this.saveItemValue(value);
+ var label = this.getItemLabel(key);
+ this.setValue(label);
+ this.popupList.hide();
+ this.__setInputFocus();
+ },
+
+ getItemValue: function(key) {
+ for(var i in this.clientItems) {
+ var item = this.clientItems[i];
+ if(item && item.id == key) {
+ return item.value;
+ }
+ }
+ },
+
+ getItemLabel: function(key) {
+ for(var i in this.clientItems) {
+ var item = this.clientItems[i];
+ if(item && item.id == key) {
+ return item.label;
+ }
+ }
+ },
+
+ saveItemValue: function(value) {
+ this.selValueInput.val(value);
+ }
+ }
+
+ })());
+
+})(jQuery, window.RichFaces);
Copied: branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/selectList.js (from rev 19674, trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/selectList.js)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/selectList.js (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/selectList.js 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,37 @@
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.SelectList = function(id, listener, options) {
+ $super.constructor.call(this, id, listener, options);
+ this.selectFirst = options.selectFirst;
+ };
+
+ rf.ui.PopupList.extend(rf.ui.SelectList);
+ var $super = rf.ui.SelectList.$super;
+
+ $.extend(rf.ui.SelectList.prototype,(function () {
+
+ return{
+ name : "selectList",
+
+ show: function() {
+ if(!this.isVisible()) {
+ $super.show.call(this);
+ if(this.selectFirst) {
+ this.__selectByIndex(0);
+ }
+ }
+ },
+
+ hide: function() {
+ if(this.isVisible()) {
+ $super.hide.call(this);
+ this.__selectByIndex(-1);
+ }
+ }
+ }
+
+ })());
+
+})(jQuery, window.RichFaces);
\ No newline at end of file
Modified: branches/RF-7817/ui/input/ui/src/main/templates/autocomplete.template.xml
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/templates/autocomplete.template.xml 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/templates/autocomplete.template.xml 2010-10-27 15:23:56 UTC (rev 19691)
@@ -15,30 +15,28 @@
<cc:implementation>
<cdk:object type="java.lang.Object" name="disabled" value="#{component.attributes['disabled']}" />
- <div id="#{clientId}" class="rf-au-field-width rf-au-field">
- <input id="#{clientId}Value" name="#{clientId}Value" type="hidden" class="rf-au-font rf-au-input" />
+ <div id="#{clientId}" class="rf-au-fld">
+ <input id="#{clientId}Value" name="#{clientId}Value" type="hidden" class="rf-au-fnt rf-au-inp" />
<div style="position : relative; overflow : hidden; text-align : left; padding-right : 21px;">
<input onclick="#{component.attributes['onclick']}"
ondblclick="#{component.attributes['ondblclick']}"
onmouseup="#{component.attributes['onmouseup']}"
onmousedown="#{component.attributes['onmousedown']}"
onmousemove="#{component.attributes['onmousemove']}"
- onblur="#{component.attributes['onblur']}"
- onfocus="#{component.attributes['onfocus']}"
onmouseover="#{component.attributes['onmouseover']}"
onmouseout="#{component.attributes['onmouseout']}"
onkeyup="#{component.attributes['onkeyup']}"
onkeydown="#{component.attributes['onkeydown']}"
- onkeypress="#{component.attributes['onkeypress']}" id="#{clientId}Input" value="#{component.attributes['value']}" disabled="#{disabled}" name="#{clientId}" type="text" class="rf-au-font rf-au-input" autocomplete="off"/>
+ onkeypress="#{component.attributes['onkeypress']}" id="#{clientId}Input" value="#{component.attributes['value']}" disabled="#{disabled}" name="#{clientId}" type="text" class="rf-au-fnt rf-au-inp" autocomplete="off"/>
<c:if test="#{component.attributes['showButton']}">
<c:if test="#{component.attributes['disabled']}">
- <div id="#{clientId}Button" class="rf-au-button">
- <div class="rf-au-button-arrow"></div>
+ <div id="#{clientId}Button" class="rf-au-btn">
+ <div class="rf-au-btn-arrow"></div>
</div>
</c:if>
<c:if test="#{!component.attributes['disabled']}">
- <div id="#{clientId}Button" class="rf-au-button">
- <div class="rf-au-button-arrow"></div>
+ <div id="#{clientId}Button" class="rf-au-btn">
+ <div class="rf-au-btn-arrow"></div>
</div>
</c:if>
</c:if>
@@ -51,21 +49,19 @@
onmousemove="#{component.attributes['onlistmousemove']}"
onmouseover="#{component.attributes['onlistmouseover']}"
onmouseout="#{component.attributes['onlistmouseout']}"
- onblur="#{component.attributes['onlistblur']}"
- onfocus="#{component.attributes['onlistfocus']}"
onkeyup="#{component.attributes['onlistkeyup']}"
onkeydown="#{component.attributes['onlistkeydown']}"
onkeypress="#{component.attributes['onlistkeypress']}"
- id="#{clientId}List" class="rf-au-list-cord">
+ id="#{clientId}List" class="rf-au-lst-cord">
- <div class="rf-au-shadow">
- <div class="rf-au-shadow-t"></div>
- <div class="rf-au-shadow-l"></div>
- <div class="rf-au-shadow-r"></div>
- <div class="rf-au-shadow-b"></div>
+ <div class="rf-au-shdw">
+ <div class="rf-au-shdw-t"></div>
+ <div class="rf-au-shdw-l"></div>
+ <div class="rf-au-shdw-r"></div>
+ <div class="rf-au-shdw-b"></div>
- <div class="rf-au-list-decoration">
- <div class="rf-au-list-scroll rf-au-list-width rf-au-list-height">
+ <div class="rf-au-lst-dcrtn">
+ <div class="rf-au-lst-scrl">
<cdk:body>
<cdk:call expression="encodeItemsContainer(facesContext, component)"/>
</cdk:body>
@@ -74,8 +70,18 @@
</div>
</div>
<script type="text/javascript">
+ <cdk:object name="mode" type="Object" value="#{component.attributes['mode']}" />
+ <cdk:scriptObject name="options">
+ <cdk:scriptOption name="buttonId" value="#{clientId}Button" />
+ <cdk:scriptOption attributes="selectedItemClass minChars filterFunction autofill disabled selectFirst tokens" />
+ <cdk:scriptOption attributes="onbegin oncomplete onerror onbeforedomupdate onchange onselectitem onfocus onblur" wrapper="eventHandler"/>
+ <cdk:scriptOption name="filterFunction" value="#{getClientFilterFunction(component)}" />
+ <cdk:scriptOption name="isCachedAjax" value="#{'ajax'==mode ? false : true}" defaultValue="true" />
+ <cdk:scriptOption name="ajaxMode" value="#{'client'==mode||'lazyClient'==mode ? false : true}" defaultValue="true" />
+ <cdk:scriptOption name="lazyClientMode" value="#{'lazyClient'==mode ? true : false}" defaultValue="false" />
+ </cdk:scriptObject>
new RichFaces.ui.Autocomplete("#{clientId}",
- "#{clientId}Input", #{getScriptOptions(component)}
+ "#{clientId}Input", #{toScriptArgs(options)}
);
</script>
</div>
Modified: branches/RF-7817/ui/input/ui/src/main/templates/inplaceInput.template.xml
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/templates/inplaceInput.template.xml 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/templates/inplaceInput.template.xml 2010-10-27 15:23:56 UTC (rev 19691)
@@ -30,7 +30,7 @@
<cc:interface>
<cdk:class>org.richfaces.renderkit.html.InplaceInputRenderer
</cdk:class>
- <cdk:superclass>org.richfaces.renderkit.InplaceInputBaseRenderer
+ <cdk:superclass>org.richfaces.renderkit.InplaceInputRendererBase
</cdk:superclass>
<cdk:component-family>org.richfaces.InplaceInput
</cdk:component-family>
@@ -41,48 +41,50 @@
<cc:implementation>
<cdk:object type="org.richfaces.component.InplaceState" name="inplaceState" value="#{getInplaceState(component)}" />
<cdk:object type="java.lang.String" name="inplaceValue" value="#{getValue(facesContext, component)}" />
-
- <span id="#{clientId}" class="#{getReadyStyleClass(component, inplaceState)}" cdk:passThroughWithExclusions="id class">
- <span id="#{clientId}:label" class="rf-ii-lbl">
+
+ <span id="#{clientId}" class="#{getStateStyleClass(component, inplaceState)}" cdk:passThroughWithExclusions="id class">
+ <span id="#{clientId}Label" class="rf-ii-lbl">
#{inplaceValue}
</span>
- <input id="#{clientId}:focus" type="image" style="position: absolute; top: 0px; left: 0px; outline-style: none;" class="rf-ii-none"/>
- <span id="#{clientId}:edit" class="#{getEditStyleClass(component, inplaceState)}">
- <input id="#{clientId}:input" autocomplete="off" name="#{clientId}"
- type="text" value="#{getInputValue(facesContext, component)}" class="rf-ii-f" style="width: #{component.attributes['inputWidth']};"
- cdk:passThrough="tabIndex">
- <cdk:call expression="renderInputHandlers(facesContext, component);"/>
- </input>
- <c:if test="#{component.attributes['showControls']}">
- <span class="rf-ii-btn-prepos">
- <span class="rf-ii-btn-pos">
- <span id="#{clientId}:btnshadow" class="rf-ii-btn-shadow">
- <span class="rf-ii-btn-shadow-t"></span>
- <span class="rf-ii-btn-shadow-l"></span>
- <span class="rf-ii-btn-shadow-r"></span>
- <span class="rf-ii-btn-shadow-b"></span>
-
- <span id="#{clientId}:btn" style="position : relative">
- <input type="image"
- id="#{clientId}:okbtn"
- src="#{getResourcePath(facesContext, 'org.richfaces/ico_ok.gif')}"
- class="rf-ii-btn" onmousedown="this.className='rf-ii-btn-p'"
- onmouseout="this.className='rf-ii-btn'" onmouseup="this.className='rf-ii-btn'" />
- <input type="image"
- id="#{clientId}:cancelbtn"
- src="#{getResourcePath(facesContext,'org.richfaces/ico_cancel.gif')}"
- class="rf-ii-btn" onmousedown="this.className='rf-ii-btn-press'"
- onmouseout="this.className='rf-ii-btn'" onmouseup="this.className='rf-ii-btn'" />
- <br />
+
+ <c:if test="#{!isDisable(inplaceState)}">
+ <input id="#{clientId}Focus" type="image" style="position: absolute; top: 0px; left: 0px; outline-style: none;" class="rf-ii-none"/>
+ <span id="#{clientId}Edit" class="#{getEditStyleClass(component, inplaceState)}">
+ <input id="#{clientId}Input" autocomplete="off" name="#{clientId}"
+ type="text" value="#{getInputValue(facesContext, component)}" class="rf-ii-fld" style="width: #{component.attributes['inputWidth']};" cdk:passThrough="tabIndex">
+ <cdk:call expression="renderInputHandlers(facesContext, component);"/>
+ </input>
+ <c:if test="#{component.attributes['showControls']}">
+ <span class="rf-ii-btn-prepos">
+ <span class="rf-ii-btn-pos">
+ <span id="#{clientId}Btnshadow" class="rf-ii-btn-shadow">
+ <span class="rf-ii-btn-shdw-t"></span>
+ <span class="rf-ii-btn-shdw-l"></span>
+ <span class="rf-ii-btn-shdw-r"></span>
+ <span class="rf-ii-btn-shdw-b"></span>
+
+ <span id="#{clientId}Btn" style="position : relative">
+ <input type="image"
+ id="#{clientId}Okbtn"
+ src="#{getResourcePath(facesContext, 'org.richfaces/ico_ok.gif')}"
+ class="rf-ii-btn" onmousedown="this.className='rf-ii-btn-p'"
+ onmouseout="this.className='rf-ii-btn'" onmouseup="this.className='rf-ii-btn'" />
+ <input type="image"
+ id="#{clientId}Cancelbtn"
+ src="#{getResourcePath(facesContext,'org.richfaces/ico_cancel.gif')}"
+ class="rf-ii-btn" onmousedown="this.className='rf-ii-btn-press'"
+ onmouseout="this.className='rf-ii-btn'" onmouseup="this.className='rf-ii-btn'" />
+ <br />
+ </span>
</span>
</span>
</span>
- </span>
- </c:if>
- </span>
- <script type="text/javascript">
- <cdk:call expression="buildScript(responseWriter, facesContext, component);"/>
- </script>
+ </c:if>
+ </span>
+ <script type="text/javascript">
+ <cdk:call expression="buildScript(responseWriter, facesContext, component, null);"/>
+ </script>
+ </c:if>
</span>
</cc:implementation>
</cdk:root>
\ No newline at end of file
Copied: branches/RF-7817/ui/input/ui/src/main/templates/inplaceSelect.template.xml (from rev 19674, trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/templates/inplaceSelect.template.xml (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,104 @@
+<?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: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.InplaceSelectRenderer
+ </cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.InplaceSelectRendererBase
+ </cdk:superclass>
+ <cdk:component-family>org.richfaces.InplaceSelect
+ </cdk:component-family>
+ <cdk:renderer-type>org.richfaces.InplaceSelectRenderer
+ </cdk:renderer-type>
+ </cc:interface>
+
+ <cc:implementation>
+ <cdk:object type="org.richfaces.component.InplaceState"
+ name="inplaceState" value="#{getInplaceState(component)}" />
+ <cdk:object type="java.lang.String" name="inplaceValue"
+ value="#{getSelectLabel(facesContext, component)}"/>
+
+ <cdk:object type="java.util.List" type-arguments="InplaceSelectBaseRenderer.ClientSelectItem" name="clientSelectItems"
+ value="#{getConvertedSelectItems(facesContext, component)}" />
+
+ <span id="#{clientId}" class="#{getStateStyleClass(component, inplaceState)}" cdk:passThroughWithExclusions="id class">
+
+ <span id="#{clientId}Label" class="rf-is-lbl">
+ #{inplaceValue}
+ </span>
+
+ <c:if test="#{!isDisable(inplaceState)}">
+ <input id="#{clientId}Focus" type="image" style="position: absolute; top: 0px; left: 0px; outline-style: none;" class="rf-is-none" />
+
+ <span id="#{clientId}Edit" class="#{getEditStyleClass(component, inplaceState)}">
+ <input id="#{clientId}selValue" name="#{clientId}" type="hidden" value="#{getValue(facesContext, component)}"/>
+ <input id="#{clientId}Input" autocomplete="off"
+ type="text" value="#{getSelectInputLabel(facesContext, component)}"
+ class="rf-is-fld" style="width: #{component.attributes['inputWidth']};" readonly="readonly"
+ cdk:passThrough="tabIndex">
+ <cdk:call expression="renderInputHandlers(facesContext, component);" />
+ </input>
+ <c:if test="#{component.attributes['showControls']}">
+ <span class="rf-is-btn-prepos">
+ <span class="rf-is-btn-pos">
+ <span id="#{clientId}Btnshadow" class="rf-is-shdw">
+ <span class="rf-is-shdw-t"></span>
+ <span class="rf-is-shdw-l"></span>
+ <span class="rf-is-shdw-r"></span>
+ <span class="rf-is-shdw-b"></span>
+
+ <span id="#{clientId}Btn" style="position : relative;">
+ <input type="image" id="#{clientId}Okbtn"
+ src="#{getResourcePath(facesContext, 'org.richfaces/ico_ok.gif')}"
+ class="rf-is-btn" onmousedown="this.className='rf-is-btn-press'"
+ onmouseout="this.className='rf-is-btn'" onmouseup="this.className='rf-is-btn'" />
+ <input type="image" id="#{clientId}Cancelbtn"
+ src="#{getResourcePath(facesContext,'org.richfaces/ico_cancel.gif')}"
+ class="rf-is-btn" onmousedown="this.className='rf-is-btn-press'"
+ onmouseout="this.className='rf-is-btn'" onmouseup="this.className='rf-is-btn'" />
+ <br />
+ </span>
+ </span>
+ </span>
+ </span>
+ </c:if>
+ <span id="#{clientId}List" style="#{component.attributes['openOnEdit'] ? '' : 'display: none'}" class="rf-is-lst-cord">
+ <cdk:call expression="renderListHandlers(facesContext, component);"/>
+ <span class="rf-is-lst-pos" style="width: #{component.attributes['listWidth']}">
+ <span class="rf-is-shdw">
+ <span class="rf-is-shdw-t"></span>
+ <span class="rf-is-shdw-l"></span>
+ <span class="rf-is-shdw-r"></span>
+ <span class="rf-is-shdw-b"></span>
+ <span class="rf-is-lst-dec">
+ <span class="rf-is-lst-scrl" id="#{clientId}Items" style="height: #{component.attributes['listHeight']}">
+ <cdk:call expression="encodeItems(facesContext, component, clientSelectItems);"/>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ <script type="text/javascript">
+ <cdk:call expression="buildScript(responseWriter, facesContext, component, clientSelectItems);" />
+ </script>
+ </c:if>
+ </span>
+ </cc:implementation>
+</cdk:root>
\ No newline at end of file
Modified: branches/RF-7817/ui/input/ui/src/main/templates/input.template.inc
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/templates/input.template.inc 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/templates/input.template.inc 2010-10-27 15:23:56 UTC (rev 19691)
@@ -22,9 +22,9 @@
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
-<span class="rf-ins-ci">
+<span class="rf-insl-inp-cntr">
<input xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core" name="#{clientId}" type="text"
- class="rf-ins-i #{component.attributes['inputClass']}" value="#{getInputValue(facesContext, component)}"
+ class="rf-insl-inp #{component.attributes['inputClass']}" value="#{getInputValue(facesContext, component)}"
cdk:passThrough="accesskey disabled maxlength size:inputSize tabindex" readonly="#{!component.attributes['enableManualInput']}"
style="#{component.attributes['showInput'] ? null : 'display: none;'}" />
</span>
\ No newline at end of file
Modified: branches/RF-7817/ui/input/ui/src/main/templates/inputnumberslider.template.xml
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/templates/inputnumberslider.template.xml 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/main/templates/inputnumberslider.template.xml 2010-10-27 15:23:56 UTC (rev 19691)
@@ -37,7 +37,7 @@
<cdk:resource-dependency library="org.richfaces" name="inputNumberSlider.js" />
</cc:interface>
<cc:implementation>
- <span id="#{clientId}" class="rf-ins #{component.attributes['styleClass']}" cdk:passThroughWithExclusions="id class">
+ <span id="#{clientId}" class="rf-insl #{component.attributes['styleClass']}" cdk:passThroughWithExclusions="id class">
<c:if test="#{isInputPosition(component, 'left') || isInputPosition(component, 'top')}">
<xi:include xpointer="xpointer(/*)" href="input.template.inc" />
<c:if test="#{isInputPosition(component, 'top') and component.attributes['showInput']}">
@@ -45,19 +45,19 @@
</c:if>
</c:if>
<c:if test="#{component.attributes['showArrows']}">
- <span class="rf-ins-db#{component.attributes['disabled'] ? '-d' : ''} #{component.attributes['decreaseClass']}" />
+ <span class="rf-insl-dec#{component.attributes['disabled'] ? '-dis' : ''} #{component.attributes['decreaseClass']}" />
</c:if>
- <span class="rf-ins-ta">
+ <span class="rf-insl-trc-cntr">
<c:if test="#{component.attributes['showBoundaryValues']}">
- <span class="rf-ins-mn">#{component.attributes['minValue']}</span>
- <span class="rf-ins-mx">#{component.attributes['maxValue']}</span>
+ <span class="rf-insl-mn">#{component.attributes['minValue']}</span>
+ <span class="rf-insl-mx">#{component.attributes['maxValue']}</span>
</c:if>
- <span class="rf-ins-t #{component.attributes['trackClass']}">
- <span class="rf-ins-h#{component.attributes['disabled'] ? '-d' : ''} #{component.attributes['handleClass']}" />
+ <span class="rf-insl-trc #{component.attributes['trackClass']}">
+ <span class="rf-insl-hnd#{component.attributes['disabled'] ? '-dis' : ''} #{component.attributes['handleClass']}" />
</span>
</span>
<c:if test="#{component.attributes['showArrows']}">
- <span class="rf-ins-ib#{component.attributes['disabled'] ? '-d' : ''} #{component.attributes['increaseClass']}" />
+ <span class="rf-insl-inc#{component.attributes['disabled'] ? '-dis' : ''} #{component.attributes['increaseClass']}" />
</c:if>
<c:if test="#{isInputPosition(component, 'right') || isInputPosition(component, 'bottom')}">
<c:if test="#{isInputPosition(component, 'bottom') and component.attributes['showInput']}">
@@ -66,13 +66,16 @@
<xi:include xpointer="xpointer(/*)" href="input.template.inc" />
</c:if>
<c:if test="#{component.attributes['showToolTip']}">
- <span class="rf-ins-tt #{component.attributes['toolTipClass']}">#{getInputValue(facesContext, component)}</span>
+ <span class="rf-insl-tt #{component.attributes['toolTipClass']}">#{getInputValue(facesContext, component)}</span>
</c:if>
+ <!-- TODO Rewrite the next line when the CDK will support normal way to take event handlers from attributes and behaviors. -->
+ <cdk:object name="onchange" type="String" value="#{convertToString(RenderKitUtils.getAttributeAndBehaviorsValue(facesContext, component, RenderKitUtils.attributes().generic('onchange', 'onchange', 'change').first()))}" />
<script type="text/javascript">new RichFaces.ui.InputNumberSlider('#{clientId}', {
delay: #{component.attributes['delay']},
disabled: #{component.attributes['disabled']},
maxValue: #{component.attributes['maxValue']},
minValue: #{component.attributes['minValue']},
+ onchange: #{onchange.length() > 0 ? 'function (event) {' + onchange + '}' : 'null' },
step: #{component.attributes['step']},
tabIndex: #{RenderKitUtils.shouldRenderAttribute(component.attributes['tabindex']) ? component.attributes['tabindex'] : 'null'}
}, {
Copied: branches/RF-7817/ui/input/ui/src/main/templates/inputnumberspinner.template.xml (from rev 19674, trunk/ui/input/ui/src/main/templates/inputnumberspinner.template.xml)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/templates/inputnumberspinner.template.xml (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/templates/inputnumberspinner.template.xml 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,62 @@
+<?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.InputNumberSpinnerRenderer</cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.InputRendererBase</cdk:superclass>
+ <cdk:component-family>javax.faces.Input</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.InputNumberSpinnerRenderer</cdk:renderer-type>
+ <cdk:resource-dependency library="org.richfaces" name="inputNumberSpinner.ecss" />
+ <cdk:resource-dependency library="org.richfaces" name="base-component.reslib" />
+ <cdk:resource-dependency name="jquery.position.js" />
+ <cdk:resource-dependency library="org.richfaces" name="inputNumberSpinner.js" />
+ </cc:interface>
+ <cc:implementation>
+ <span id="#{clientId}" class="rf-insp #{component.attributes['styleClass']}" cdk:passThroughWithExclusions="id class" >
+ <input name="#{clientId}" type="text"
+ class="rf-insp-inp #{component.attributes['inputClass']}" value="#{getInputValue(facesContext, component)}"
+ cdk:passThrough="accesskey disabled maxlength onblur onfocus onclick:oninputclick ondblclick:ondblinputclick onkeydown:oninputkeydown
+ onkeypress:oninputkeypress onkeyup:oninputkeyup onmousedown:oninputmousedown onmousemove:oninputmousemove onmouseout:oninputmouseout
+ onmouseover:oninputmouseover onmouseup:oninputmouseup onselect size:inputSize tabindex"
+ readonly="#{!component.attributes['enableManualInput']}" autocomplete="#{component.attributes['disableBrowserAutoComplete'] ? 'off' : ''}" />
+ <span class="rf-insp-btns">
+ <span class="rf-insp-inc#{component.attributes['disabled'] ? '-dis' : ''}" cdk:passThrough="onclick:onupclick" />
+ <span class="rf-insp-dec#{component.attributes['disabled'] ? '-dis' : ''}" cdk:passThrough="onclick:ondownclick" />
+ </span>
+ <!-- TODO Rewrite the next line when the CDK will support normal way to take event handlers from attributes and behaviors. -->
+ <cdk:object name="onchange" type="String" value="#{convertToString(RenderKitUtils.getAttributeAndBehaviorsValue(facesContext, component, RenderKitUtils.attributes().generic('onchange', 'onchange', 'change').first()))}" />
+ <script type="text/javascript">new RichFaces.ui.InputNumberSpinner('#{clientId}', {
+ cycled: #{component.attributes['cycled']},
+ maxValue: #{component.attributes['maxValue']},
+ minValue: #{component.attributes['minValue']},
+ onchange: #{onchange.length() > 0 ? 'function (event) {' + onchange + '}' : 'null' },
+ step: #{component.attributes['step']}
+ });</script>
+ </span>
+ </cc:implementation>
+</cdk:root>
Copied: branches/RF-7817/ui/input/ui/src/main/templates/select.template.xml (from rev 19674, trunk/ui/input/ui/src/main/templates/select.template.xml)
===================================================================
--- branches/RF-7817/ui/input/ui/src/main/templates/select.template.xml (rev 0)
+++ branches/RF-7817/ui/input/ui/src/main/templates/select.template.xml 2010-10-27 15:23:56 UTC (rev 19691)
@@ -0,0 +1,68 @@
+<?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.SelectRenderer</cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.SelectRendererBase</cdk:superclass>
+ <cdk:component-family>org.richfaces.Select</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.SelectRenderer</cdk:renderer-type>
+ <cdk:renders-children>true</cdk:renders-children>
+ </cc:interface>
+
+ <cc:implementation>
+
+ <cdk:object type="java.util.List" type-arguments="org.richfaces.renderkit.ClientSelectItem" name="clientSelectItems"
+ value="#{getConvertedSelectItems(facesContext, component)}" />
+
+ <cdk:object type="java.lang.Object" name="disabled" value="#{component.attributes['disabled']}" />
+
+ <div id="#{clientId}" class="rf-sel-fld">
+ <div style="position : relative; overflow : hidden; text-align : left; padding-right : 21px;">
+ <input id="#{clientId}selValue" name="#{clientId}" type="hidden" value="#{getInputValue(facesContext, component)}"/>
+ <input cdk:passThroughWithExclusions="class autocomplete id value disabled name type readonly"
+ id="#{clientId}Input"
+ value="#{getSelectLabel(facesContext, component)}"
+ disabled="#{disabled}"
+ type="text"
+ class="rf-sel-fnt rf-sel-inp"
+ autocomplete="off"
+ readonly="#{component.attributes['enableManualInput'] ? '' : 'readonly'}"/>
+
+ <c:if test="#{component.attributes['showButton']}">
+ <c:if test="#{component.attributes['disabled']}">
+ <div id="#{clientId}Button" class="rf-sel-btn">
+ <div class="rf-sel-btn-arrow"></div>
+ </div>
+ </c:if>
+ <c:if test="#{!component.attributes['disabled']}">
+ <div id="#{clientId}Button" class="rf-sel-btn">
+ <div class="rf-sel-btn-arrow"></div>
+ </div>
+ </c:if>
+ </c:if>
+ </div>
+
+ <div id="#{clientId}List" class="rf-sel-lst-cord">
+ <cdk:call expression="renderListHandlers(facesContext, component);"/>
+ <div class="rf-sel-shdw">
+ <div class="rf-sel-shdw-t"></div>
+ <div class="rf-sel-shdw-l"></div>
+ <div class="rf-sel-shdw-r"></div>
+ <div class="rf-sel-shdw-b"></div>
+
+ <div class="rf-sel-lst-dcrtn">
+ <div class="rf-sel-lst-scrl" id="#{clientId}Items" >
+ <cdk:call expression="encodeItems(facesContext, component, clientSelectItems);"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script type="text/javascript">
+ <cdk:call expression="buildScript(responseWriter, facesContext, component, clientSelectItems);"/>
+ </script>
+ </div>
+ </cc:implementation>
+</cdk:root>
Modified: branches/RF-7817/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java
===================================================================
--- branches/RF-7817/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java 2010-10-27 15:07:36 UTC (rev 19690)
+++ branches/RF-7817/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java 2010-10-27 15:23:56 UTC (rev 19691)
@@ -67,16 +67,16 @@
DomNode text = label.getFirstChild();
assertEquals(DomNode.TEXT_NODE, text.getNodeType());
- HtmlElement edit = page.getFirstByXPath("//*[@id = 'form:input_default:edit']");
+ HtmlElement edit = page.getFirstByXPath("//*[@id = 'form:input_defaultEdit']");
assertEquals("span", edit.getNodeName());
- assertEquals("rf-ii-e-s rf-ii-none", edit.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
+ assertEquals("rf-ii-edit rf-ii-none", edit.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
HtmlElement input = (HtmlElement)edit.getFirstChild();
assertEquals("input", input.getNodeName());
- assertEquals("rf-ii-f", input.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
+ assertEquals("rf-ii-fld", input.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
assertEquals(text.getNodeValue(), input.getAttribute(HtmlConstants.VALUE_ATTRIBUTE));
- List<?> buttons = page.getByXPath("//*[@id = 'form:input_default:btn']");
+ List<?> buttons = page.getByXPath("//*[@id = 'form:input_defaultBtn']");
assertEquals(true, buttons.isEmpty());
}
@@ -87,7 +87,7 @@
HtmlElement span = page.getFirstByXPath("//*[@id = 'form:input_edit']");
assertEquals("span", span.getNodeName());
- assertEquals("rf-ii-d-s", span.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
+ assertEquals("rf-ii-d-s rf-ii-e-s", span.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
HtmlElement label = (HtmlElement)span.getFirstChild();
assertEquals("span", label.getNodeName());
@@ -95,24 +95,24 @@
DomNode text = label.getFirstChild();
assertEquals(DomNode.TEXT_NODE, text.getNodeType());
- HtmlElement edit = page.getFirstByXPath("//*[@id = 'form:input_edit:edit']");
+ HtmlElement edit = page.getFirstByXPath("//*[@id = 'form:input_editEdit']");
assertEquals("span", edit.getNodeName());
- assertEquals("rf-ii-e-s", edit.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
+ assertEquals("rf-ii-edit", edit.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
HtmlElement input = (HtmlElement)edit.getFirstChild();
assertEquals("input", input.getNodeName());
- assertEquals("rf-ii-f", input.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
+ assertEquals("rf-ii-fld", input.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
assertEquals(text.getNodeValue(), input.getAttribute(HtmlConstants.VALUE_ATTRIBUTE));
- HtmlElement button = page.getFirstByXPath("//*[@id = 'form:input_edit:btn']");
+ HtmlElement button = page.getFirstByXPath("//*[@id = 'form:input_editBtn']");
assertEquals("span", button.getNodeName());
- HtmlElement okButton = page.getFirstByXPath("//*[@id = 'form:input_edit:okbtn']");
+ HtmlElement okButton = page.getFirstByXPath("//*[@id = 'form:input_editOkbtn']");
assertEquals("input", okButton.getNodeName());
assertEquals("rf-ii-btn", okButton.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
assertEquals("image", okButton.getAttribute(HtmlConstants.TYPE_ATTR));
- HtmlElement cancelButton = page.getFirstByXPath("//*[@id = 'form:input_edit:cancelbtn']");
+ HtmlElement cancelButton = page.getFirstByXPath("//*[@id = 'form:input_editCancelbtn']");
assertEquals("input", cancelButton.getNodeName());
assertEquals("rf-ii-btn", cancelButton.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
assertEquals("image", cancelButton.getAttribute(HtmlConstants.TYPE_ATTR));
@@ -124,7 +124,7 @@
HtmlPage page = environment.getPage("/test.jsf");
edit(page, "input_default", "Another Test String");
blur(page);
- DomText text = page.getFirstByXPath("//*[@id = 'form:input_default:label']/text()");
+ DomText text = page.getFirstByXPath("//*[@id = 'form:input_defaultLabel']/text()");
assertEquals("Another Test String", text.getTextContent());
HtmlElement span = page.getFirstByXPath("//*[@id = 'form:input_default']");
assertEquals("rf-ii-d-s rf-ii-c-s", span.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
@@ -136,7 +136,7 @@
}
private void typeNewValue(HtmlPage page, String inplaceInputId, String value) throws Exception {
- HtmlElement input = page.getFirstByXPath("//*[@id = 'form:" + inplaceInputId + ":input']");
+ HtmlElement input = page.getFirstByXPath("//*[@id = 'form:" + inplaceInputId + "Input']");
input.setAttribute(HtmlConstants.VALUE_ATTRIBUTE, "");
input.type(value);
}
@@ -144,8 +144,8 @@
private void edit(HtmlPage page, String inplaceInputId, String value) throws Exception {
HtmlElement span = page.getFirstByXPath("//*[@id = 'form:" + inplaceInputId + "']");
span.click();
- HtmlElement edit = page.getFirstByXPath("//*[@id = 'form:" + inplaceInputId + ":edit']");
- assertEquals("rf-ii-e-s", edit.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
+ HtmlElement edit = page.getFirstByXPath("//*[@id = 'form:" + inplaceInputId + "Edit']");
+ assertEquals("rf-ii-edit", edit.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
typeNewValue(page, inplaceInputId, value);
}
@@ -154,10 +154,10 @@
HtmlPage page = environment.getPage("/test.jsf");
edit(page, "input_controls", "Another Test String");
- HtmlElement cancel = page.getFirstByXPath("//*[@id = 'form:input_controls:cancelbtn']");
+ HtmlElement cancel = page.getFirstByXPath("//*[@id = 'form:input_controlsCancelbtn']");
cancel.mouseDown();
- DomText text = page.getFirstByXPath("//*[@id = 'form:input_controls:label']/text()");
+ DomText text = page.getFirstByXPath("//*[@id = 'form:input_controlsLabel']/text()");
assertEquals("Test String", text.getTextContent());
HtmlElement span = page.getFirstByXPath("//*[@id = 'form:input_controls']");
@@ -165,10 +165,10 @@
edit(page, "input_controls", "Another Test String");
- HtmlElement ok = page.getFirstByXPath("//*[@id = 'form:input_controls:okbtn']");
+ HtmlElement ok = page.getFirstByXPath("//*[@id = 'form:input_controlsOkbtn']");
ok.mouseDown();
- text = page.getFirstByXPath("//*[@id = 'form:input_controls:label']/text()");
+ text = page.getFirstByXPath("//*[@id = 'form:input_controlsLabel']/text()");
assertEquals("Another Test String", text.getTextContent());
span = page.getFirstByXPath("//*[@id = 'form:input_controls']");
@@ -178,7 +178,7 @@
blur(page);
- text = page.getFirstByXPath("//*[@id = 'form:input_controls:label']/text()");
+ text = page.getFirstByXPath("//*[@id = 'form:input_controlsLabel']/text()");
assertEquals("Test String", text.getTextContent());
}
15 years, 6 months
JBoss Rich Faces SVN: r19690 - in branches/RF-7817/ui/output: api/src/main/java/org/richfaces and 16 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-10-27 11:07:36 -0400 (Wed, 27 Oct 2010)
New Revision: 19690
Added:
branches/RF-7817/ui/output/api/src/main/java/org/richfaces/HeaderAlignment.java
branches/RF-7817/ui/output/api/src/main/java/org/richfaces/HeaderPosition.java
branches/RF-7817/ui/output/ui/richfaces-suppressions.xml
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractProgressBar.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTabPanel.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/NumberUtils.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTab.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTabPanel.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarAnimatedBackgroundImage.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarBaseRenderer.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab.js
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TabPanel.js
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/close.gif
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/close_act.gif
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/ico.gif
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.ecss
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.ecss
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/richfaces/
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties
branches/RF-7817/ui/output/ui/src/main/templates/progressBar.template.xml
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/component/UICollapsiblePanelTest.java
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/component/UITogglePanelTitledItemTest.java
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/IgnoreScriptsContent.java
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuRendererTest.java
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java
branches/RF-7817/ui/output/ui/src/test/resources/org/
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml
Removed:
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml
Modified:
branches/RF-7817/ui/output/api/pom.xml
branches/RF-7817/ui/output/ui/pom.xml
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelTitledItem.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/UITogglePanelTitledItem.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlAccordionItem.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTogglePanelTitledItem.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/CollapsiblePanelItem.js
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panel.ecss
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.ecss
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelSizer.js
branches/RF-7817/ui/output/ui/src/main/templates/panel.template.xml
branches/RF-7817/ui/output/ui/src/main/templates/popupPanel.template.xml
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java
Log:
Merged revisions 19156-19157,19159-19160,19176,19186-19187,19190,19194,19196,19199,19203-19204,19231-19234,19248-19249,19255-19256,19258-19262,19276,19279-19281,19283,19285,19291-19299,19307,19312,19315,19318-19319,19325,19341-19342,19345-19351,19353-19355,19358-19359,19364,19367-19369,19371,19374-19377,19379-19385,19387,19393-19394,19400,19402-19404,19418-19422,19426,19430-19431,19434-19441,19443-19444,19446,19468,19470,19477,19491,19498-19499,19501,19504,19506-19507,19517-19519,19525,19542-19543,19548,19550,19555,19557,19560-19561,19565-19566,19571-19573,19582-19585,19592-19593,19599,19601-19602,19613,19646,19657-19659,19665,19671-19674 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
Modified: branches/RF-7817/ui/output/api/pom.xml
===================================================================
--- branches/RF-7817/ui/output/api/pom.xml 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/api/pom.xml 2010-10-27 15:07:36 UTC (rev 19690)
@@ -34,6 +34,14 @@
<name>Richfaces UI Components: Output API</name>
<packaging>jar</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
<dependencies>
<!-- runtime -->
<dependency>
Copied: branches/RF-7817/ui/output/api/src/main/java/org/richfaces/HeaderAlignment.java (from rev 19674, trunk/ui/output/api/src/main/java/org/richfaces/HeaderAlignment.java)
===================================================================
--- branches/RF-7817/ui/output/api/src/main/java/org/richfaces/HeaderAlignment.java (rev 0)
+++ branches/RF-7817/ui/output/api/src/main/java/org/richfaces/HeaderAlignment.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,9 @@
+package org.richfaces;
+
+/**
+ * @author akolonitsky
+ * @since Aug 24, 2010
+ */
+public enum HeaderAlignment {
+ left, center, right, bottom, top
+}
Copied: branches/RF-7817/ui/output/api/src/main/java/org/richfaces/HeaderPosition.java (from rev 19674, trunk/ui/output/api/src/main/java/org/richfaces/HeaderPosition.java)
===================================================================
--- branches/RF-7817/ui/output/api/src/main/java/org/richfaces/HeaderPosition.java (rev 0)
+++ branches/RF-7817/ui/output/api/src/main/java/org/richfaces/HeaderPosition.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,9 @@
+package org.richfaces;
+
+/**
+ * @author akolonitsky
+ * @since Aug 24, 2010
+ */
+public enum HeaderPosition {
+ top, left, right, bottom
+}
Modified: branches/RF-7817/ui/output/ui/pom.xml
===================================================================
--- branches/RF-7817/ui/output/ui/pom.xml 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/pom.xml 2010-10-27 15:07:36 UTC (rev 19690)
@@ -38,11 +38,10 @@
<build>
<plugins>
<plugin>
- <!-- Checkstyle only required here because suppressions needed -->
- <artifactId>maven-checkstyle-plugin</artifactId>
- <configuration>
- <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
- </configuration>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <suppressionsLocation>${project.basedir}/richfaces-suppressions.xml</suppressionsLocation>
+ </configuration>
</plugin>
<plugin>
<groupId>org.richfaces.cdk</groupId>
@@ -69,6 +68,12 @@
<groupId>org.richfaces.ui.output</groupId>
<artifactId>richfaces-ui-output-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>xmlunit</groupId>
+ <artifactId>xmlunit</artifactId>
+ <version>1.2</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<scm>
Copied: branches/RF-7817/ui/output/ui/richfaces-suppressions.xml (from rev 19674, trunk/ui/output/ui/richfaces-suppressions.xml)
===================================================================
--- branches/RF-7817/ui/output/ui/richfaces-suppressions.xml (rev 0)
+++ branches/RF-7817/ui/output/ui/richfaces-suppressions.xml 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE suppressions PUBLIC
+ "-//Puppy Crawl//DTD Suppressions 1.0//EN"
+ "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
+
+<suppressions>
+ <suppress checks="IllegalCatch" files="AbstractTogglePanel.java" />
+</suppressions>
Copied: branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractProgressBar.java (from rev 19674, trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractProgressBar.java)
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractProgressBar.java (rev 0)
+++ branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractProgressBar.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,344 @@
+/**
+ * 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
+ */
+
+/*
+ * UIProgressBar.java Date created: 19.12.2007
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+
+package org.richfaces.component;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+import javax.faces.context.PartialViewContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.FacesEvent;
+
+import org.ajax4jsf.javascript.JSLiteral;
+import org.ajax4jsf.javascript.ScriptUtils;
+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.cdk.annotations.TagType;
+import org.richfaces.renderkit.HtmlConstants;
+import org.richfaces.renderkit.html.ProgressBarBaseRenderer;
+import org.richfaces.renderkit.util.CoreAjaxRendererUtils;
+
+/**
+ * Class provides base component class for progress bar
+ *
+ * @author "Andrey Markavtsov"
+ *
+ */
+@JsfComponent(tag = @Tag(type = TagType.Facelets), renderer = @JsfRenderer(type = "org.richfaces.ProgressBarRenderer"))
+public abstract class AbstractProgressBar extends UIComponentBase{
+
+ /** Component type */
+ public static final String COMPONENT_TYPE = "org.richfaces.ProgressBar";
+
+ /** Component family */
+ public static final String COMPONENT_FAMILY = "org.richfaces.ProgressBar";
+
+ /** Request parameter name containing component state to render */
+ public static final String FORCE_PERCENT_PARAM = "forcePercent";
+
+ /** Percent param name */
+ private static final String PERCENT_PARAM = "percent";
+
+ /** Max value attribute name */
+ private static final String MAXVALUE = "maxValue";
+
+ /** Min value attribute name */
+ private static final String MINVALUE = "minValue";
+
+ /** Enabled attribute name */
+ private static final String ENABLED = "enabled";
+
+ /** Enabled attribute name */
+ private static final String INTERVAL = "interval";
+
+ /** Markup data key */
+ private static final String MARKUP = "markup";
+
+ /** Complete class attribute name */
+ private static final String COMPLETECLASS = "completeClass";
+
+ /** Remain class attribute name */
+ private static final String REMAINCLASS = "remainClass";
+
+ /** Style class attribute name */
+ private static final String STYLECLASS = "styleClass";
+
+ /** Context key */
+ private static final String CONTEXT = "context";
+ @Attribute(events = @EventName("click"))
+ public abstract String getOnclick();
+
+ @Attribute(events = @EventName("dblclick"))
+ public abstract String getOndblclick();
+
+ @Attribute(events = @EventName("mousedown"))
+ public abstract String getOnmousedown();
+
+ @Attribute(events = @EventName("mouseup"))
+ public abstract String getOnmouseup();
+
+ @Attribute(events = @EventName("mouseover"))
+ public abstract String getOnmouseover();
+
+ @Attribute(events = @EventName("mousemove"))
+ public abstract String getOnmousemove();
+
+ @Attribute(events = @EventName("mouseout"))
+ public abstract String getOnmouseout();
+
+ @Attribute(events = @EventName("submit"))
+ public abstract String getOnsubmit();
+
+
+ @Attribute
+ public abstract String getLabel();
+
+ @Attribute
+ public abstract Object getData();
+ public abstract void setData(Object data);
+ @Attribute(defaultValue = "1000")
+ public abstract int getInterval();
+
+ @Attribute(defaultValue = "false")
+ public abstract boolean isEnabled();
+
+ @Attribute(events = @EventName("beforedomupdate"))
+ public abstract String getOnbeforedomupdate();
+
+ @Attribute(events = @EventName("complete"))
+ public abstract String getOncomplete();
+
+ @Attribute
+ public abstract String getCompleteClass();
+
+ @Attribute
+ public abstract String getFinishClass();
+
+ @Attribute
+ public abstract String getInitialClass();
+
+ @Attribute
+ public abstract String getRemainClass();
+
+ @Attribute
+ public abstract String getFocus();
+
+ @Attribute
+ public abstract String getReRenderAfterComplete();
+
+ @Attribute
+ public abstract String getMode();
+
+ @Attribute
+ public abstract int getMaxValue();
+
+ @Attribute
+ public abstract int getMinValue();
+
+ @Attribute
+ public abstract Object getValue();
+
+ @Attribute
+ public abstract Object getParameters();
+
+
+ /**
+ * Method performs broadcasting of jsf events to progress bar component
+ *
+ * @param event -
+ * Faces Event instance
+ */
+ public void broadcast(FacesEvent event) throws AbortProcessingException {
+
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ Map<String, String> params = facesContext.getExternalContext().getRequestParameterMap();
+ String clientId = this.getClientId(facesContext);
+
+ if (!params.containsKey(clientId)) {
+ return;
+ }
+ if (!params.containsKey(FORCE_PERCENT_PARAM)
+ && params.containsKey(PERCENT_PARAM)) {
+ Number value = NumberUtils.getNumber(this.getAttributes().get(
+ HtmlConstants.VALUE_ATTRIBUTE));
+ PartialViewContext pvc = FacesContext.getCurrentInstance().getPartialViewContext();
+ pvc.getRenderIds().remove(
+ this.getClientId());
+ this.setData(getResponseData(value, facesContext));
+
+ } else if (params.containsKey(FORCE_PERCENT_PARAM)) {
+ PartialViewContext pvc = FacesContext.getCurrentInstance().getPartialViewContext();
+ pvc.getRenderIds().add(this.getClientId());
+ String forcedState = params.get(FORCE_PERCENT_PARAM);
+ if ("completeState".equals(forcedState)) {
+ Object reRender = this.getAttributes().get("reRenderAfterComplete");
+ Set<String> ajaxRegions = CoreAjaxRendererUtils.asIdsSet(reRender);
+ if (ajaxRegions != null) {
+ for (Iterator<String> iter = ajaxRegions.iterator(); iter.hasNext();) {
+ String id = iter.next();
+ pvc.getExecuteIds().add(id);
+ pvc.getRenderIds().add(id);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns ajax response data
+ *
+ * @param uiComponent
+ * @param percent
+ * @return
+ */
+ private Map<Object, Object> getResponseData(Number value,
+ FacesContext facesContext) {
+
+ ProgressBarBaseRenderer renderer = (ProgressBarBaseRenderer) this
+ .getRenderer(facesContext);
+
+ Map<Object, Object> map = new HashMap<Object, Object>();
+ map.put(HtmlConstants.VALUE_ATTRIBUTE, value);
+ map.put(INTERVAL, this.getInterval());
+
+ if (this.getAttributes().get(HtmlConstants.STYLE_ATTRIBUTE) != null) {
+ map.put(HtmlConstants.STYLE_ATTRIBUTE, this.getAttributes()
+ .get(HtmlConstants.STYLE_ATTRIBUTE));
+ }
+
+ map.put(ENABLED, (Boolean) this.getAttributes().get(ENABLED));
+
+ if (!isSimple(renderer)) {
+ map.put(MARKUP, getMarkup(facesContext, renderer));
+ map.put(CONTEXT, getContext(renderer, value));
+ }
+
+ addStyles2Responce(map, COMPLETECLASS, this.getAttributes().get(
+ COMPLETECLASS));
+ addStyles2Responce(map, REMAINCLASS, this.getAttributes().get(
+ REMAINCLASS));
+ addStyles2Responce(map, STYLECLASS, this.getAttributes().get(
+ STYLECLASS));
+ return map;
+
+ }
+
+ /**
+ * Returns context for macrosubstitution
+ *
+ * @param renderer
+ * @param percent
+ * @return
+ */
+ private JSLiteral getContext(ProgressBarBaseRenderer renderer,
+ Number percent) {
+ StringBuffer buffer = new StringBuffer("{");
+ buffer.append("\"value\":");
+ buffer.append(ScriptUtils.toScript(percent.toString())).append(",");
+ buffer.append("\"minValue\":");
+ buffer.append(
+ ScriptUtils.toScript(this.getAttributes().get(MINVALUE)
+ .toString())).append(",");
+ buffer.append("\"maxValue\":");
+ buffer.append(ScriptUtils.toScript(this.getAttributes().get(MAXVALUE)
+ .toString()));
+
+ String parameters = handleParameters(renderer.getParameters(this));
+ if (parameters != null) {
+ buffer.append(",");
+ buffer.append(parameters);
+ }
+ buffer.append("}");
+ return new JSLiteral(buffer.toString());
+ }
+
+ private String handleParameters(String str){
+ if (str != null && str.length() > 0) {
+ StringBuilder s = new StringBuilder();
+ while(str.indexOf(":") != -1){
+ String a = str.substring(0, str.indexOf(":"));
+ str = str.substring(str.indexOf(":") );
+ s.append("\"");
+ s.append(a);
+ s.append("\"");
+ if (str.indexOf(",") != -1) {
+ String b = str.substring(0, str.indexOf(",") +1);
+ str = str.substring(str.indexOf(",") +1 );
+ s.append(b);
+ } else{
+ s.append(str);
+ return s.toString();
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Return true if markup is simple
+ *
+ * @return
+ */
+ private boolean isSimple(ProgressBarBaseRenderer renderer) {
+ return renderer.isSimpleMarkup(this);
+ }
+
+ /**
+ * Returns label markup
+ *
+ * @param context
+ * @param renderer
+ * @return
+ */
+ private String getMarkup(FacesContext context,
+ ProgressBarBaseRenderer renderer) {
+ return renderer.getMarkup(context, this).toString();
+ }
+
+ /**
+ * Add component classes to ajax response
+ *
+ * @param buffer
+ * @param attr
+ * @param newValue
+ */
+ private void addStyles2Responce(Map<Object, Object> map, String key,
+ Object className) {
+ if (className != null) {
+ map.put(key, className);
+ }
+ }
+
+}
Copied: branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTabPanel.java (from rev 19674, trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTabPanel.java)
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTabPanel.java (rev 0)
+++ branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTabPanel.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,54 @@
+/*
+ * 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;
+
+
+
+/**
+ * @author akolonitsky
+ * @since 2010-08-24
+ */
+public abstract class AbstractTabPanel extends UITogglePanel {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.TabPanel";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.TabPanel";
+
+ protected AbstractTabPanel() {
+ setRendererType("org.richfaces.TabPanel");
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ @Override
+ public String getActiveItem() {
+ String res = super.getActiveItem();
+ if (res == null) {
+ res = getFirstItem().getName();
+ }
+ return res;
+ }
+}
Modified: branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -459,9 +459,9 @@
}
public AbstractTogglePanelItem getItemByIndex(final int index) {
- List<AbstractTogglePanelItem> children = getRenderedChildren();
+ List<AbstractTogglePanelItem> children = getRenderedItems();
if (isCycledSwitching()) {
- int size = getRenderedChildren().size();
+ int size = getRenderedItems().size();
return children.get((size + index) % size);
} else if (index < 0 || index >= children.size()) {
return null;
@@ -470,7 +470,7 @@
}
}
- private List<AbstractTogglePanelItem> getRenderedChildren() {
+ public List<AbstractTogglePanelItem> getRenderedItems() {
List<AbstractTogglePanelItem> res = new ArrayList<AbstractTogglePanelItem>(getChildCount());
for (UIComponent child : getChildren()) {
if (child.isRendered() && child instanceof AbstractTogglePanelItem) {
@@ -516,7 +516,7 @@
}
public AbstractTogglePanelItem getLastItem() {
- return getItemByIndex(getRenderedChildren().size() - 1);
+ return getItemByIndex(getRenderedItems().size() - 1);
}
public int getChildIndex(String name) {
@@ -524,7 +524,7 @@
throw new IllegalArgumentException("Name is required parameter.");
}
- List<AbstractTogglePanelItem> items = getRenderedChildren();
+ List<AbstractTogglePanelItem> items = getRenderedItems();
for (int ind = 0; ind < items.size(); ind++) {
if (name.equals(items.get(ind).getName())) {
return ind;
Modified: branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelTitledItem.java
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelTitledItem.java 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelTitledItem.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -41,7 +41,7 @@
public enum HeaderStates {
active("act"),
inactive("inact"),
- disable("dis");
+ disabled("dis");
private final String abbreviation;
Copied: branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/NumberUtils.java (from rev 19674, trunk/ui/output/ui/src/main/java/org/richfaces/component/NumberUtils.java)
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/NumberUtils.java (rev 0)
+++ branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/NumberUtils.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,40 @@
+package org.richfaces.component;
+
+import java.math.BigDecimal;
+
+public final class NumberUtils {
+ private NumberUtils() {
+
+ }
+ /**
+ * Converts value attr to number value
+ *
+ * @param v -
+ * value attr
+ * @return result
+ */
+ public static Number getNumber(Object v) {
+ Number result = null;
+ if (v != null) {
+ try {
+ if (v instanceof String) { // String
+ result = Double.parseDouble((String) v);
+ } else {
+ Number n = (Number) v;
+ if ((n instanceof BigDecimal) || (n instanceof Double) // Double
+ // or
+ // BigDecimal
+ || (n instanceof Float)) {
+ result = n.floatValue();
+ } else if (n instanceof Integer || n instanceof Long) { // Integer
+ result = n.longValue();
+ }
+ }
+ } catch (Exception e) {
+ e.getMessage();
+ }
+ return result;
+ }
+ return new Integer(0);
+ }
+}
Modified: branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/UITogglePanelTitledItem.java
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/UITogglePanelTitledItem.java 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/UITogglePanelTitledItem.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -44,7 +44,7 @@
}
public String getHeader() {
- return (String) getStateHelper().eval(PropertyKeys.header);
+ return (String) getStateHelper().eval(PropertyKeys.header, getName());
}
public void setHeader(String header) {
Modified: branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -25,6 +25,7 @@
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.component.behavior.ClientBehaviorContext;
+import javax.faces.context.FacesContext;
import org.ajax4jsf.component.behavior.ClientBehavior;
import org.richfaces.component.AbstractTogglePanel;
@@ -97,17 +98,26 @@
+ comp.getClientId(getFacesContext()) + ") has not been found.");
}
} else {
- UIComponent control = comp;
- while (control != null) {
- if (control instanceof AbstractTogglePanel) {
- return (AbstractTogglePanel) control;
- }
+ return getEnclosedPanel(comp);
+ }
+ }
- control = control.getParent();
+ public static AbstractTogglePanel getEnclosedPanel(UIComponent comp) {
+ if (comp == null) {
+ return null;
+ }
+
+ UIComponent control = comp;
+ while (control != null) {
+ if (control instanceof AbstractTogglePanel) {
+ return (AbstractTogglePanel) control;
}
- throw new FacesException("Parent panel for control (id="
- + comp.getClientId(getFacesContext()) + ") has not been found.");
+
+ control = control.getParent();
}
+
+ throw new FacesException("Parent panel for control (id="
+ + comp.getClientId(FacesContext.getCurrentInstance()) + ") has not been found.");
}
@Override
@@ -125,4 +135,4 @@
// setTargetPanel((String) value);
// }
}
-}
\ No newline at end of file
+}
Modified: branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlAccordionItem.java
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlAccordionItem.java 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlAccordionItem.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -22,20 +22,22 @@
package org.richfaces.component.html;
-import org.richfaces.component.UITogglePanelTitledItem;
-import javax.faces.component.behavior.ClientBehaviorHolder;
-
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+
+import org.richfaces.component.UITogglePanelTitledItem;
+import org.richfaces.component.behavior.ToggleControl;
+
/**
* @author akolonitsky
* @since 2010-08-13
*/
public class HtmlAccordionItem extends UITogglePanelTitledItem implements ClientBehaviorHolder {
- public static final String COMPONENT_TYPE = "org.richfaces.TogglePanelTitledItem";
+ public static final String COMPONENT_TYPE = "org.richfaces.AccordionItem";
public static final String COMPONENT_FAMILY = "org.richfaces.TogglePanelTitledItem";
@@ -94,8 +96,12 @@
return COMPONENT_FAMILY;
}
+ public HtmlAccordion getAccordion() {
+ return (HtmlAccordion) ToggleControl.getEnclosedPanel(this);
+ }
+
public String getHeaderClassActive() {
- return (String) getStateHelper().eval(PropertyKeys.headerClassActive);
+ return (String) getStateHelper().eval(PropertyKeys.headerClassActive, getAccordion().getItemHeaderClassActive());
}
public void setHeaderClassActive(String headerClassActive) {
@@ -103,7 +109,7 @@
}
public String getHeaderClassDisabled() {
- return (String) getStateHelper().eval(PropertyKeys.headerClassDisabled);
+ return (String) getStateHelper().eval(PropertyKeys.headerClassDisabled, getAccordion().getItemHeaderClassDisabled());
}
public void setHeaderClassDisabled(String headerClassDisabled) {
@@ -111,7 +117,7 @@
}
public String getHeaderClassInactive() {
- return (String) getStateHelper().eval(PropertyKeys.headerClassInactive);
+ return (String) getStateHelper().eval(PropertyKeys.headerClassInactive, getAccordion().getItemHeaderClassInactive());
}
public void setHeaderClassInactive(String headerClassInactive) {
@@ -119,7 +125,7 @@
}
public String getHeaderClass() {
- return (String) getStateHelper().eval(PropertyKeys.headerClass);
+ return (String) getStateHelper().eval(PropertyKeys.headerClass, getAccordion().getItemHeaderClass());
}
public void setHeaderClass(String headerClass) {
@@ -135,7 +141,7 @@
}
public String getContentClass() {
- return (String) getStateHelper().eval(PropertyKeys.contentClass);
+ return (String) getStateHelper().eval(PropertyKeys.contentClass, getAccordion().getItemContentClass());
}
public void setContentClass(String contentClass) {
Copied: branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTab.java (from rev 19674, trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTab.java)
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTab.java (rev 0)
+++ branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTab.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,309 @@
+/*
+ * 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.html;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+
+import javax.faces.component.behavior.ClientBehaviorHolder;
+
+import org.richfaces.component.UITogglePanelTitledItem;
+
+/**
+ * @author akolonitsky
+ * @since 2010-08-27
+ */
+public class HtmlTab extends UITogglePanelTitledItem implements ClientBehaviorHolder {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.TabPanelItem";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.TogglePanelTitledItem";
+
+ private static final Collection<String> EVENT_NAMES = Collections.unmodifiableCollection(Arrays.asList(
+ "headerclick",
+ "headerdblclick",
+ "headermousedown",
+ "headermousemove",
+ "headermouseup",
+ "enter",
+ "leave",
+ "click",
+ "dblclick",
+ "mousedown",
+ "mousemove",
+ "mouseout",
+ "mouseover",
+ "mouseup"
+ ));
+
+
+ public enum PropertyKeys {
+ headerClassActive,
+ headerClassDisabled,
+ headerClassInactive,
+ headerClass,
+ headerStyle,
+ contentClass,
+ onheaderclick,
+ onheaderdblclick,
+ onheadermousedown,
+ onheadermousemove,
+ onheadermouseup,
+ onenter,
+ onleave,
+ lang,
+ title,
+ style,
+ styleClass,
+ dir,
+ onclick,
+ ondblclick,
+ onmousedown,
+ onmousemove,
+ onmouseout,
+ onmouseover,
+ onmouseup
+ }
+
+ public HtmlTab() {
+ setRendererType("org.richfaces.Tab");
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ public HtmlTabPanel getTabPanel() {
+ return (HtmlTabPanel) this.getParent();
+ }
+
+ public String getHeaderClassActive() {
+ return (String) getStateHelper().eval(PropertyKeys.headerClassActive, getTabPanel().getTabHeaderClassActive());
+ }
+
+ public void setHeaderClassActive(String headerClassActive) {
+ getStateHelper().put(PropertyKeys.headerClassActive, headerClassActive);
+ }
+
+ public String getHeaderClassDisabled() {
+ return (String) getStateHelper().eval(PropertyKeys.headerClassDisabled, getTabPanel().getTabHeaderClassDisabled());
+ }
+
+ public void setHeaderClassDisabled(String headerClassDisabled) {
+ getStateHelper().put(PropertyKeys.headerClassDisabled, headerClassDisabled);
+ }
+
+ public String getHeaderClassInactive() {
+ return (String) getStateHelper().eval(PropertyKeys.headerClassInactive, getTabPanel().getTabHeaderClassInactive());
+ }
+
+ public void setHeaderClassInactive(String headerClassInactive) {
+ getStateHelper().put(PropertyKeys.headerClassInactive, headerClassInactive);
+ }
+
+ public String getHeaderClass() {
+ return (String) getStateHelper().eval(PropertyKeys.headerClass, getTabPanel().getTabHeaderClass());
+ }
+
+ public void setHeaderClass(String headerClass) {
+ getStateHelper().put(PropertyKeys.headerClass, headerClass);
+ }
+
+ public String getHeaderStyle() {
+ return (String) getStateHelper().eval(PropertyKeys.headerStyle);
+ }
+
+ public void setHeaderStyle(String headerStyle) {
+ getStateHelper().put(PropertyKeys.headerStyle, headerStyle);
+ }
+
+ public String getContentClass() {
+ return (String) getStateHelper().eval(PropertyKeys.contentClass, getTabPanel().getTabContentClass());
+ }
+
+ public void setContentClass(String contentClass) {
+ getStateHelper().put(PropertyKeys.contentClass, contentClass);
+ }
+
+ public String getOnheaderclick() {
+ return (String) getStateHelper().eval(PropertyKeys.onheaderclick);
+ }
+
+ public void setOnheaderclick(String onheaderclick) {
+ getStateHelper().put(PropertyKeys.onheaderclick, onheaderclick);
+ }
+
+ public String getOnheaderdblclick() {
+ return (String) getStateHelper().eval(PropertyKeys.onheaderdblclick);
+ }
+
+ public void setOnheaderdblclick(String onheaderdblclick) {
+ getStateHelper().put(PropertyKeys.onheaderdblclick, onheaderdblclick);
+ }
+
+ public String getOnheadermousedown() {
+ return (String) getStateHelper().eval(PropertyKeys.onheadermousedown);
+ }
+
+ public void setOnheadermousedown(String onheadermousedown) {
+ getStateHelper().put(PropertyKeys.onheadermousedown, onheadermousedown);
+ }
+
+ public String getOnheadermousemove() {
+ return (String) getStateHelper().eval(PropertyKeys.onheadermousemove);
+ }
+
+ public void setOnheadermousemove(String onheadermousemove) {
+ getStateHelper().put(PropertyKeys.onheadermousemove, onheadermousemove);
+ }
+
+ public String getOnheadermouseup() {
+ return (String) getStateHelper().eval(PropertyKeys.onheadermouseup);
+ }
+
+ public void setOnheadermouseup(String onheadermouseup) {
+ getStateHelper().put(PropertyKeys.onheadermouseup, onheadermouseup);
+ }
+
+ public String getOnenter() {
+ return (String) getStateHelper().eval(PropertyKeys.onenter);
+ }
+
+ public void setOnenter(String onenter) {
+ getStateHelper().put(PropertyKeys.onenter, onenter);
+ }
+
+ public String getOnleave() {
+ return (String) getStateHelper().eval(PropertyKeys.onleave);
+ }
+
+ public void setOnleave(String onleave) {
+ getStateHelper().put(PropertyKeys.onleave, onleave);
+ }
+
+ public String getLang() {
+ return (String) getStateHelper().eval(PropertyKeys.lang);
+ }
+
+ public void setLang(String lang) {
+ getStateHelper().put(PropertyKeys.lang, lang);
+ }
+
+ public String getTitle() {
+ return (String) getStateHelper().eval(PropertyKeys.title);
+ }
+
+ public void setTitle(String title) {
+ getStateHelper().put(PropertyKeys.title, title);
+ }
+
+ public String getStyle() {
+ return (String) getStateHelper().eval(PropertyKeys.style);
+ }
+
+ public void setStyle(String style) {
+ getStateHelper().put(PropertyKeys.style, style);
+ }
+
+ public String getStyleClass() {
+ return (String) getStateHelper().eval(PropertyKeys.styleClass);
+ }
+
+ public void setStyleClass(String styleClass) {
+ getStateHelper().put(PropertyKeys.styleClass, styleClass);
+ }
+
+ public String getDir() {
+ return (String) getStateHelper().eval(PropertyKeys.dir);
+ }
+
+ public void setDir(String dir) {
+ getStateHelper().put(PropertyKeys.dir, dir);
+ }
+
+ public String getOnclick() {
+ return (String) getStateHelper().eval(PropertyKeys.onclick);
+ }
+
+ public void setOnclick(String onclick) {
+ getStateHelper().put(PropertyKeys.onclick, onclick);
+ }
+
+ public String getOndblclick() {
+ return (String) getStateHelper().eval(PropertyKeys.ondblclick);
+ }
+
+ public void setOndblclick(String ondblclick) {
+ getStateHelper().put(PropertyKeys.ondblclick, ondblclick);
+ }
+
+ public String getOnmousedown() {
+ return (String) getStateHelper().eval(PropertyKeys.onmousedown);
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ getStateHelper().put(PropertyKeys.onmousedown, onmousedown);
+ }
+
+ public String getOnmousemove() {
+ return (String) getStateHelper().eval(PropertyKeys.onmousemove);
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ getStateHelper().put(PropertyKeys.onmousemove, onmousemove);
+ }
+
+ public String getOnmouseout() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseout);
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ getStateHelper().put(PropertyKeys.onmouseout, onmouseout);
+ }
+
+ public String getOnmouseover() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseover);
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ getStateHelper().put(PropertyKeys.onmouseover, onmouseover);
+ }
+
+ public String getOnmouseup() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseup);
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ getStateHelper().put(PropertyKeys.onmouseup, onmouseup);
+ }
+
+
+
+ @Override
+ public Collection<String> getEventNames() {
+ return EVENT_NAMES;
+ }
+}
+
Copied: branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTabPanel.java (from rev 19674, trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTabPanel.java)
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTabPanel.java (rev 0)
+++ branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTabPanel.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,265 @@
+/*
+ * 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.html;
+
+import org.richfaces.HeaderPosition;
+import org.richfaces.HeaderAlignment;
+import org.richfaces.component.AbstractTabPanel;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+
+/**
+ * @author akolonitsky
+ * @since 2010-08-27
+ */
+public class HtmlTabPanel extends AbstractTabPanel implements ClientBehaviorHolder {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.TabPanel";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.TabPanel";
+
+ private static final Collection<String> EVENT_NAMES = Collections.unmodifiableCollection(Arrays.asList(
+ "itemchange",
+ "beforeitemchange",
+ "click",
+ "dblclick",
+ "mousedown",
+ "mousemove",
+ "mouseout",
+ "mouseover",
+ "mouseup"
+ ));
+
+
+ public enum PropertyKeys {
+ headerPosition,
+ headerAlignment,
+ tabHeaderClassActive,
+ tabHeaderClassDisabled,
+ tabHeaderClassInactive,
+ tabContentClass,
+ tabHeaderClass,
+ onitemchange,
+ onbeforeitemchange,
+ lang,
+ title,
+ style,
+ styleClass,
+ dir,
+ onclick,
+ ondblclick,
+ onmousedown,
+ onmousemove,
+ onmouseout,
+ onmouseover,
+ onmouseup
+ }
+
+ public HtmlTabPanel() {
+ setRendererType("org.richfaces.TabPanel");
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ public HeaderPosition getHeaderPosition() {
+ return (HeaderPosition) getStateHelper().eval(PropertyKeys.headerPosition);
+ }
+
+ public void setHeaderPosition(HeaderPosition headerPosition) {
+ getStateHelper().put(PropertyKeys.headerPosition, headerPosition);
+ }
+
+ public HeaderAlignment getHeaderAlignment() {
+ return (HeaderAlignment) getStateHelper().eval(PropertyKeys.headerAlignment);
+ }
+
+ public void setHeaderAlignment(HeaderAlignment headerAlignment) {
+ getStateHelper().put(PropertyKeys.headerAlignment, headerAlignment);
+ }
+
+ public String getTabHeaderClassActive() {
+ return (String) getStateHelper().eval(PropertyKeys.tabHeaderClassActive);
+ }
+
+ public void setTabHeaderClassActive(String tabHeaderClassActive) {
+ getStateHelper().put(PropertyKeys.tabHeaderClassActive, tabHeaderClassActive);
+ }
+
+ public String getTabHeaderClassDisabled() {
+ return (String) getStateHelper().eval(PropertyKeys.tabHeaderClassDisabled);
+ }
+
+ public void setTabHeaderClassDisabled(String tabHeaderClassDisabled) {
+ getStateHelper().put(PropertyKeys.tabHeaderClassDisabled, tabHeaderClassDisabled);
+ }
+
+ public String getTabHeaderClassInactive() {
+ return (String) getStateHelper().eval(PropertyKeys.tabHeaderClassInactive);
+ }
+
+ public void setTabHeaderClassInactive(String tabHeaderClassInactive) {
+ getStateHelper().put(PropertyKeys.tabHeaderClassInactive, tabHeaderClassInactive);
+ }
+
+ public String getTabContentClass() {
+ return (String) getStateHelper().eval(PropertyKeys.tabContentClass);
+ }
+
+ public void setTabContentClass(String tabContentClass) {
+ getStateHelper().put(PropertyKeys.tabContentClass, tabContentClass);
+ }
+
+ public String getTabHeaderClass() {
+ return (String) getStateHelper().eval(PropertyKeys.tabHeaderClass);
+ }
+
+ public void setTabHeaderClass(String tabHeaderClass) {
+ getStateHelper().put(PropertyKeys.tabHeaderClass, tabHeaderClass);
+ }
+
+ public String getOnitemchange() {
+ return (String) getStateHelper().eval(PropertyKeys.onitemchange);
+ }
+
+ public void setOnitemchange(String onitemchange) {
+ getStateHelper().put(PropertyKeys.onitemchange, onitemchange);
+ }
+
+ public String getOnbeforeitemchange() {
+ return (String) getStateHelper().eval(PropertyKeys.onbeforeitemchange);
+ }
+
+ public void setOnbeforeitemchange(String onbeforeitemchange) {
+ getStateHelper().put(PropertyKeys.onbeforeitemchange, onbeforeitemchange);
+ }
+
+ public String getLang() {
+ return (String) getStateHelper().eval(PropertyKeys.lang);
+ }
+
+ public void setLang(String lang) {
+ getStateHelper().put(PropertyKeys.lang, lang);
+ }
+
+ public String getTitle() {
+ return (String) getStateHelper().eval(PropertyKeys.title);
+ }
+
+ public void setTitle(String title) {
+ getStateHelper().put(PropertyKeys.title, title);
+ }
+
+ public String getStyle() {
+ return (String) getStateHelper().eval(PropertyKeys.style);
+ }
+
+ public void setStyle(String style) {
+ getStateHelper().put(PropertyKeys.style, style);
+ }
+
+ public String getStyleClass() {
+ return (String) getStateHelper().eval(PropertyKeys.styleClass);
+ }
+
+ public void setStyleClass(String styleClass) {
+ getStateHelper().put(PropertyKeys.styleClass, styleClass);
+ }
+
+ public String getDir() {
+ return (String) getStateHelper().eval(PropertyKeys.dir);
+ }
+
+ public void setDir(String dir) {
+ getStateHelper().put(PropertyKeys.dir, dir);
+ }
+
+ public String getOnclick() {
+ return (String) getStateHelper().eval(PropertyKeys.onclick);
+ }
+
+ public void setOnclick(String onclick) {
+ getStateHelper().put(PropertyKeys.onclick, onclick);
+ }
+
+ public String getOndblclick() {
+ return (String) getStateHelper().eval(PropertyKeys.ondblclick);
+ }
+
+ public void setOndblclick(String ondblclick) {
+ getStateHelper().put(PropertyKeys.ondblclick, ondblclick);
+ }
+
+ public String getOnmousedown() {
+ return (String) getStateHelper().eval(PropertyKeys.onmousedown);
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ getStateHelper().put(PropertyKeys.onmousedown, onmousedown);
+ }
+
+ public String getOnmousemove() {
+ return (String) getStateHelper().eval(PropertyKeys.onmousemove);
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ getStateHelper().put(PropertyKeys.onmousemove, onmousemove);
+ }
+
+ public String getOnmouseout() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseout);
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ getStateHelper().put(PropertyKeys.onmouseout, onmouseout);
+ }
+
+ public String getOnmouseover() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseover);
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ getStateHelper().put(PropertyKeys.onmouseover, onmouseover);
+ }
+
+ public String getOnmouseup() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseup);
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ getStateHelper().put(PropertyKeys.onmouseup, onmouseup);
+ }
+
+
+
+ @Override
+ public Collection<String> getEventNames() {
+ return EVENT_NAMES;
+ }
+}
+
Modified: branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTogglePanelTitledItem.java
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTogglePanelTitledItem.java 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTogglePanelTitledItem.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -22,17 +22,19 @@
package org.richfaces.component.html;
-import org.richfaces.component.UITogglePanelTitledItem;
-import javax.faces.component.behavior.ClientBehaviorHolder;
-
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+
+import org.richfaces.component.UITogglePanelTitledItem;
+
/**
* @author akolonitsky
* @since 2010-08-13
*/
+//TODO alex - what's the purpose of this class?
public class HtmlTogglePanelTitledItem extends UITogglePanelTitledItem implements ClientBehaviorHolder {
public static final String COMPONENT_TYPE = "org.richfaces.TogglePanelTitledItem";
Modified: branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -137,7 +137,7 @@
boolean isDisabled = titledItem.isDisabled();
encodeHeader(context, titledItem, writer, HeaderStates.inactive, !isActive && !isDisabled);
encodeHeader(context, titledItem, writer, HeaderStates.active, isActive && !isDisabled);
- encodeHeader(context, titledItem, writer, HeaderStates.disable, isDisabled);
+ encodeHeader(context, titledItem, writer, HeaderStates.disabled, isDisabled);
writer.endElement("div");
}
Modified: branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -21,15 +21,14 @@
package org.richfaces.renderkit.html;
-import java.io.IOException;
+import org.richfaces.component.UIPanel;
+import org.richfaces.renderkit.RendererBase;
import javax.faces.application.ResourceDependency;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import java.io.IOException;
-import org.richfaces.component.UIPanel;
-import org.richfaces.renderkit.RendererBase;
-
/**
* @author amarkhel
* @since Jun 14, 2010
@@ -39,12 +38,12 @@
public PanelBaseRenderer() {
}
-
+
public void renderHeaderFacet(FacesContext context, UIComponent component) throws IOException {
- UIComponent headerFacet = component.getFacet("header");
- headerFacet.encodeAll(context);
+ UIComponent headerFacet = component.getFacet("header");
+ headerFacet.encodeAll(context);
}
-
+
@Override
protected Class<? extends UIComponent> getComponentClass() {
return UIPanel.class;
Modified: branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -1,5 +1,7 @@
package org.richfaces.renderkit.html;
+import static org.richfaces.renderkit.RenderKitUtils.addToScriptHash;
+
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
@@ -20,7 +22,6 @@
import org.richfaces.json.JSONException;
import org.richfaces.json.JSONMap;
import org.richfaces.renderkit.RendererBase;
-import org.richfaces.renderkit.util.RendererUtils;
//TODO nick - JSF have concept of library, it should be used instead of '/' in resource names
@ResourceDependencies( {
@@ -176,41 +177,47 @@
result.append("',");
Map<String, Object> attributes = component.getAttributes();
Map<String, Object> options = new HashMap<String, Object>();
- RendererUtils utils = getUtils();
- utils.addToScriptHash(options, "width", panel.getWidth(), "-1");
- utils.addToScriptHash(options, "height", panel.getHeight(), "-1");
- utils.addToScriptHash(options, "minWidth", panel.getMinWidth(), "-1");
- utils.addToScriptHash(options, "minHeight", panel.getMinHeight(), "-1");
- utils.addToScriptHash(options, "maxWidth", panel.getMaxWidth(), "" +Integer.MAX_VALUE);
- utils.addToScriptHash(options, "maxHeight", panel.getMaxHeight(), "" +Integer.MAX_VALUE);
- utils.addToScriptHash(options, "moveable", panel.isMoveable(), "true");
- utils.addToScriptHash(options, "followByScroll", panel.isFollowByScroll(), "true");
- utils.addToScriptHash(options, "left", panel.getLeft(), "auto");
- utils.addToScriptHash(options, "top", panel.getTop(), "auto");
- utils.addToScriptHash(options, "zindex", panel.getZIndex(), "100");
- utils.addToScriptHash(options, "shadowDepth", panel.getShadowDepth(), "2");
- utils.addToScriptHash(options, "shadowOpacity", panel.getShadowOpacity(), "0.1");
- utils.addToScriptHash(options, "domElementAttachment", panel.getDomElementAttachment());
+ addToScriptHash(options, "width", panel.getWidth(), "-1");
+ addToScriptHash(options, "height", panel.getHeight(), "-1");
+ addToScriptHash(options, "minWidth", panel.getMinWidth(), "-1");
+ addToScriptHash(options, "minHeight", panel.getMinHeight(), "-1");
+ addToScriptHash(options, "maxWidth", panel.getMaxWidth(), "" +Integer.MAX_VALUE);
+ addToScriptHash(options, "maxHeight", panel.getMaxHeight(), "" +Integer.MAX_VALUE);
+ addToScriptHash(options, "moveable", panel.isMoveable(), "true");
+ addToScriptHash(options, "followByScroll", panel.isFollowByScroll(), "true");
+ addToScriptHash(options, "left", panel.getLeft(), "auto");
+ addToScriptHash(options, "top", panel.getTop(), "auto");
+ addToScriptHash(options, "zindex", panel.getZIndex(), "100");
+ addToScriptHash(options, "shadowDepth", panel.getShadowDepth(), "2");
+ addToScriptHash(options, "shadowOpacity", panel.getShadowOpacity(), "0.1");
+ addToScriptHash(options, "domElementAttachment", panel.getDomElementAttachment());
- utils.addToScriptHash(options, "keepVisualState", panel.isKeepVisualState(), "false");
- utils.addToScriptHash(options, "show", panel.isShow(), "false");
- utils.addToScriptHash(options, "modal", panel.isModal(), "true");
- utils.addToScriptHash(options, "autosized", panel.isAutosized(), "false");
- utils.addToScriptHash(options, "resizeable", panel.isResizeable(), "false");
- utils.addToScriptHash(options, "overlapEmbedObjects", panel.isOverlapEmbedObjects(), "false");
- utils.addToScriptHash(options, "visualOptions", writeVisualOptions(context, panel));
- utils.addToScriptHash(options, "onresize", attributes.get("onresize"));
- utils.addToScriptHash(options, "onmove", attributes.get("onmove"));
- utils.addToScriptHash(options, "onshow", attributes.get("onshow"));
- utils.addToScriptHash(options, "onhide", attributes.get("onhide"));
- utils.addToScriptHash(options, "onbeforeshow", attributes.get("onbeforeshow"));
- utils.addToScriptHash(options, "onbeforehide", attributes.get("onbeforehide"));
+ addToScriptHash(options, "keepVisualState", panel.isKeepVisualState(), "false");
+ addToScriptHash(options, "show", panel.isShow(), "false");
+ addToScriptHash(options, "modal", panel.isModal(), "true");
+ addToScriptHash(options, "autosized", panel.isAutosized(), "false");
+ addToScriptHash(options, "resizeable", panel.isResizeable(), "false");
+ addToScriptHash(options, "overlapEmbedObjects", panel.isOverlapEmbedObjects(), "false");
+ addToScriptHash(options, "visualOptions", writeVisualOptions(context, panel));
+ addToScriptHash(options, "onresize", buildEventFunction(attributes.get("onresize")));
+ addToScriptHash(options, "onmove", buildEventFunction(attributes.get("onmove")));
+ addToScriptHash(options, "onshow", buildEventFunction(attributes.get("onshow")));
+ addToScriptHash(options, "onhide", buildEventFunction(attributes.get("onhide")));
+ addToScriptHash(options, "onbeforeshow", buildEventFunction(attributes.get("onbeforeshow")));
+ addToScriptHash(options, "onbeforehide", buildEventFunction(attributes.get("onbeforehide")));
result.append(ScriptUtils.toScript(options));
result.append(");");
return result.toString();
}
+ private Object buildEventFunction(Object eventFunction) {
+ if(eventFunction != null && eventFunction.toString().length() > 0) {
+ return "new Function(\"" + eventFunction.toString() + "\");";
+ }
+ return null;
+ }
+
public Map<String, Object> getHandledVisualOptions(AbstractPopupPanel panel) {
String options = panel.getVisualOptions();
Map<String, Object> result;
Copied: branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarAnimatedBackgroundImage.java (from rev 19674, trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarAnimatedBackgroundImage.java)
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarAnimatedBackgroundImage.java (rev 0)
+++ branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarAnimatedBackgroundImage.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,168 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.renderkit.html;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GradientPaint;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+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.renderkit.util.ColorUtils;
+import org.richfaces.resource.CacheableResource;
+import org.richfaces.resource.DynamicResource;
+import org.richfaces.resource.ImageType;
+import org.richfaces.resource.Java2DAnimatedUserResource;
+import org.richfaces.resource.StateHolderResource;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+//TODO - add version
+@DynamicResource
+public class ProgressBarAnimatedBackgroundImage implements Java2DAnimatedUserResource, StateHolderResource, CacheableResource {
+
+ private static final int NUMBER_OF_FRAMES = 12;
+
+ private static final Dimension DIMENSION = new Dimension(24, 48);
+
+ private int frameNumber = 0;
+
+ private Color basicColor;
+
+ public Map<String, String> getResponseHeaders() {
+ return null;
+ }
+
+ public Date getLastModified() {
+ return null;
+ }
+
+ public ImageType getImageType() {
+ return ImageType.GIF;
+ }
+
+ public Dimension getDimension() {
+ return DIMENSION;
+ }
+
+ public boolean isLooped() {
+ return true;
+ }
+
+ public int getFrameDelay() {
+ return 1000;
+ }
+
+ public void startFramesSequence() {
+ frameNumber = 0;
+ }
+
+ public boolean hasNextFrame() {
+ return frameNumber < NUMBER_OF_FRAMES;
+ }
+
+ /**
+ * Creates a main stage for progress bar background.
+ *
+ * @param context
+ * resource context
+ * @return a <code>BufferedImage</code> object
+ */
+ private BufferedImage createMainStage() {
+ Color progressbarBackgroundColor = basicColor;
+ Color progressbarSpiralColor = ColorUtils.adjustLightness(basicColor, 0.2f);
+
+ Dimension dimension = getDimension();
+ BufferedImage retVal = getImageType().createImage(dimension.width, dimension.height * 2);
+ Graphics g = retVal.getGraphics();
+ try {
+ g.setColor(progressbarBackgroundColor);
+ g.fillRect(0, 0, dimension.width, dimension.height * 2);
+ g.setColor(progressbarSpiralColor);
+ for (int k : new int[] { -24, 0, 24, 48, 72 }) {
+ g.fillPolygon(new int[] { 0, 24, 24, 0 }, new int[] { 24 + k, k, 12 + k, 36 + k }, 4);
+ }
+ } finally {
+ if (g != null) {
+ g.dispose();
+ }
+ }
+
+ return retVal;
+ }
+
+ public void paint(Graphics2D g2d, Dimension dimension) {
+ frameNumber++;
+
+ BufferedImage mainStage = createMainStage();
+ BufferedImage frame = mainStage.getSubimage(0, 48 - frameNumber * 2, dimension.width, dimension.height);
+ g2d.drawImage(frame, null, null);
+ Color progressbarShadowStartColor = ColorUtils.overwriteAlpha(ColorUtils.adjustLightness(basicColor, 0.7f), 0.6f);
+ Color progressbarShadowEndColor = ColorUtils.overwriteAlpha(ColorUtils.adjustLightness(basicColor, 0.3f), 0.6f);
+ // paint a shadow in the form of semi-transparent gradient
+ g2d.setPaint(new GradientPaint(0, 0, progressbarShadowStartColor, 0, 7, progressbarShadowEndColor));
+ g2d.fillRect(0, 0, dimension.width, 7);
+ }
+
+ public boolean isTransient() {
+ return false;
+ }
+
+ public void writeState(FacesContext context, DataOutput dataOutput) throws IOException {
+ // TODO Auto-generated method stub
+ Skin skin = SkinFactory.getInstance(context).getSkin(context);
+ Integer color = skin.getColorParameter(context, Skin.SELECT_CONTROL_COLOR);
+ dataOutput.writeInt(color.intValue());
+ }
+
+ public void readState(FacesContext context, DataInput dataInput) throws IOException {
+ basicColor = new Color(dataInput.readInt());
+ }
+
+ public boolean isCacheable(FacesContext context) {
+ return true;
+ }
+
+ public Date getExpires(FacesContext context) {
+ return null;
+ }
+
+ public int getTimeToLive(FacesContext context) {
+ return 0;
+ }
+
+ public String getEntityTag(FacesContext context) {
+ return null;
+ }
+}
Copied: branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarBaseRenderer.java (from rev 19674, trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarBaseRenderer.java)
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarBaseRenderer.java (rev 0)
+++ branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarBaseRenderer.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,396 @@
+/**
+ * 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
+ */
+
+/*
+ * AbstractProgressBarRenderer.java Date created: 20.12.2007
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+
+package org.richfaces.renderkit.html;
+
+import static org.richfaces.renderkit.RenderKitUtils.addToScriptHash;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.HashMap;
+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 javax.faces.context.PartialViewContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.event.ActionEvent;
+
+import org.ajax4jsf.javascript.JSLiteral;
+import org.ajax4jsf.javascript.ScriptUtils;
+import org.richfaces.component.AbstractProgressBar;
+import org.richfaces.component.NumberUtils;
+import org.richfaces.log.Logger;
+import org.richfaces.log.RichfacesLogger;
+import org.richfaces.renderkit.RendererBase;
+import org.richfaces.renderkit.util.RendererUtils;
+
+/**
+ * Abstract progress bar renderer
+ *
+ * @author "Andrey Markavtsov"
+ *
+ */
+@ResourceDependencies( {
+ @ResourceDependency(library = "org.richfaces", name = "ajax.reslib"),
+ @ResourceDependency(library = "org.richfaces", name = "base-component.reslib"),
+ @ResourceDependency(library = "org.richfaces", name = "progressBar.js"),
+ @ResourceDependency(library = "org.richfaces", name = "progressBar.ecss")
+
+})
+public class ProgressBarBaseRenderer extends RendererBase {
+
+ private static final String INITIAL_FACET = "initial";
+ private static final String COMPLETE_FACET = "complete";
+ private static final Logger LOG = RichfacesLogger.APPLICATION.getLogger();
+
+
+ @Override
+ protected void doDecode(FacesContext context, UIComponent component) {
+ super.doDecode(context, component);
+ if (component.isRendered()) {
+ new ActionEvent(component).queue();
+ PartialViewContext pvc = context.getPartialViewContext();
+ pvc.getRenderIds().add(component.getClientId(context));
+ }
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.renderkit.TemplateEncoderRendererBase#encodeChildren(javax.faces.context.FacesContext,
+ * javax.faces.component.UIComponent)
+ */
+ @Override
+ public void encodeChildren(FacesContext context, UIComponent component) throws IOException {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.renderkit.RendererBase#doEncodeChildren(javax.faces.context.ResponseWriter,
+ * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+ */
+ @Override
+ public void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+
+ }
+
+ public final boolean getRendersChildren() {
+ return true;
+ }
+
+ /**
+ * Gets state forced from javascript
+ *
+ * @param component
+ * @return
+ */
+ public String getForcedState(FacesContext context, UIComponent component) {
+ String forcedState = null;
+ Map<String, String> params = context.getExternalContext()
+ .getRequestParameterMap();
+ if (params.containsKey(AbstractProgressBar.FORCE_PERCENT_PARAM)) {
+ forcedState = params.get(AbstractProgressBar.FORCE_PERCENT_PARAM);
+ }
+ return forcedState;
+ }
+
+ /**
+ * Renderes label markup
+ *
+ * @param context
+ * @param component
+ * @return
+ */
+ public StringBuffer getMarkup(FacesContext context, UIComponent component) {
+ StringBuffer result = new StringBuffer();
+ try {
+ result = new StringBuffer(getMarkupBody(context, component, hasChildren(component)));
+
+ } catch (Exception e) {
+ LOG.error("Error occurred during rendering of progress bar label. It switched to empty string", e);
+ }
+
+ return result;
+
+ }
+
+
+
+ protected String getMarkupBody(FacesContext context, UIComponent component, boolean children) throws IOException {
+ ResponseWriter writer = context.getResponseWriter();
+ StringWriter dumpingWriter = new StringWriter();
+ ResponseWriter clonedWriter = writer.cloneWithWriter(dumpingWriter);
+ context.setResponseWriter(clonedWriter);
+ try {
+ if (children) {
+ this.renderChildren(context, component);
+ } else if (component.getAttributes().get("label") != null) {
+ clonedWriter.write(component.getAttributes().get("label").toString());
+ }
+ } finally {
+ clonedWriter.flush();
+ context.setResponseWriter(writer);
+ }
+
+ return dumpingWriter.toString();
+ }
+
+
+
+
+ /**
+ * Encodes script for state rendering in client mode
+ *
+ * @param context
+ * @param component
+ * @param state
+ * @throws IOException
+ */
+ public String getRenderStateScript(FacesContext context,
+ UIComponent component, String state) throws IOException {
+ StringBuffer script = new StringBuffer("\n");
+ script.append(
+ "RichFaces.$('" + component.getClientId(context)
+ + "').renderState('").append(state).append(
+ "');");
+ return script.toString();
+ }
+
+
+
+ /**
+ * Encode initial javascript
+ *
+ * @param context
+ * @param component
+ * @throws IOException
+ */
+ public String getInitialScript(FacesContext context,
+ UIComponent component, String state) throws IOException {
+ AbstractProgressBar progressBar = (AbstractProgressBar) component;
+ StringBuffer script = new StringBuffer();
+ Map<String, Object> options = new HashMap<String, Object>();
+ RendererUtils utils = getUtils();
+
+ String clientId = component.getClientId(context);
+
+ addToScriptHash(options, "mode", component.getAttributes().get("mode"), "ajax");
+ addToScriptHash(options, "minValue", component.getAttributes().get("minValue"), "0");
+ addToScriptHash(options, "maxValue", component.getAttributes().get("maxValue"), "100");
+ addToScriptHash(options, "context", getContext(component));
+
+ Integer interval = new Integer(progressBar.getInterval());
+ addToScriptHash(options, "pollinterval", interval);
+ addToScriptHash(options, "enabled", progressBar.isEnabled());
+ addToScriptHash(options, "pollId", progressBar.getClientId(context));
+ addToScriptHash(options, "state", state, "initialState");
+ addToScriptHash(options, "value", NumberUtils.getNumber(component.getAttributes().get("value")));
+ addToScriptHash(options, "onsubmit", buildEventFunction(component.getAttributes().get("onsubmit")));
+ script.append("new RichFaces.ui.ProgressBar('").append(clientId).append("'");
+ if (!options.isEmpty()) {
+ script.append(",").append(ScriptUtils.toScript(options));
+ }
+ script.append(")\n;");
+ return script.toString();
+ }
+
+ private Object buildEventFunction(Object eventFunction) {
+ if(eventFunction != null && eventFunction.toString().length() > 0) {
+ return "new Function(\"" + eventFunction.toString() + "\");";
+ }
+ return null;
+ }
+
+ /**
+ * Creates options map for AJAX requests
+ *
+ * @param clientId
+ * @param progressBar
+ * @param context
+ * @return
+ */
+ public String getPollScript(FacesContext context, UIComponent component) {
+ return "RichFaces.$('" + component.getClientId() + "').poll()";
+
+ }
+
+ public String getStopPollScript(FacesContext context, UIComponent component) {
+ return "RichFaces.$('" + component.getClientId() + "').disable()";
+
+ }
+
+ /**
+ * Check if component mode is AJAX
+ *
+ * @param component
+ * @return
+ */
+ public boolean isAjaxMode(UIComponent component) {
+ String mode = (String) component.getAttributes().get("mode");
+ return "ajax".equalsIgnoreCase(mode);
+ }
+
+ public String getCurrentOrForcedState(FacesContext context, UIComponent component){
+ String forcedState = getForcedState(context,component);
+ if (forcedState != null) {
+ return forcedState;
+ }
+ return getCurrentState(context, component);
+ }
+
+ public String getCurrentState(FacesContext context, UIComponent component){
+ Number minValue = NumberUtils.getNumber(component.getAttributes().get("minValue"));
+ Number maxValue = NumberUtils.getNumber(component.getAttributes().get("maxValue"));
+ Number value = NumberUtils.getNumber(component.getAttributes().get("value"));
+ if (value.doubleValue() <= minValue.doubleValue()) {
+ return "initialState";
+ } else if (value.doubleValue() > maxValue.doubleValue()) {
+ return "completeState";
+ } else {
+ return "progressState";
+ }
+ }
+
+ public String getShellStyle(FacesContext context, UIComponent component){
+ return (!isSimpleMarkup(component)) ? "rf-pb-shl-dig "
+ : "rf-pb-shl ";
+ }
+
+ public String getWidth(UIComponent component){
+ Number value = NumberUtils.getNumber(component.getAttributes().get("value"));
+ Number minValue = NumberUtils.getNumber(component.getAttributes().get("minValue"));
+ Number maxValue = NumberUtils.getNumber(component.getAttributes().get("maxValue"));
+ Number percent = calculatePercent(value, minValue, maxValue);
+
+ return String.valueOf(percent.intValue());
+ }
+
+ public void renderInitialFacet(FacesContext context, UIComponent component) throws IOException {
+ renderFacet(context, component, INITIAL_FACET);
+ }
+
+ public void renderCompleteFacet(FacesContext context, UIComponent component) throws IOException {
+ renderFacet(context, component, COMPLETE_FACET);
+ }
+
+ private void renderFacet(FacesContext context, UIComponent component, String facet) throws IOException {
+ UIComponent headerFacet = component.getFacet(facet);
+ if(headerFacet != null) {
+ headerFacet.encodeAll(context);
+ }
+ }
+
+
+ /**
+ * Returns parameters attr
+ *
+ * @param component
+ * @param renderer
+ * @param percent
+ * @return
+ */
+ public String getParameters(UIComponent component) {
+ String parameters = (String) component.getAttributes()
+ .get("parameters");
+ return parameters;
+ }
+
+ /**
+ * Returns context for macrosubstitution
+ *
+ * @param component
+ * @return
+ */
+ private JSLiteral getContext(UIComponent component) {
+ StringBuffer buffer = new StringBuffer();
+ String parameters = getParameters(component);
+ JSLiteral literal = null;
+ if (parameters != null) {
+ buffer.append("{").append(parameters).append("}");
+ literal = new JSLiteral(buffer.toString());
+ }
+ return literal;
+ }
+
+ /**
+ * Return true if component has children components
+ *
+ * @param component
+ * @return
+ */
+ private boolean hasChildren(UIComponent component) {
+ return (component.getChildCount() != 0);
+ }
+
+ /**
+ * Returns true if markup should rendered as simple 2 divs
+ *
+ * @param component
+ * @return
+ */
+ public boolean isSimpleMarkup(UIComponent component) {
+ if (hasChildren(component)) {
+ return false;
+ } else {
+ if (component.getAttributes().get("label") != null) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+
+
+ /**
+ * Calculates percent value according to min & max value
+ *
+ * @param value
+ * @param minValue
+ * @param maxValue
+ * @return
+ */
+ public Number calculatePercent(Number value, Number minValue,
+ Number maxValue) {
+ if (minValue.doubleValue() < value.doubleValue()
+ && value.doubleValue() < maxValue.doubleValue()) {
+ return (Number) ((value.doubleValue() - minValue.doubleValue()) * 100.0 / (maxValue
+ .doubleValue() - minValue.doubleValue()));
+ } else if (value.doubleValue() <= minValue.doubleValue()) {
+ return 0;
+ } else if (value.doubleValue() >= maxValue.doubleValue()) {
+ return 100;
+ }
+ return 0;
+ }
+
+}
Copied: branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java (from rev 19674, trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java)
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java (rev 0)
+++ branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,227 @@
+/*
+ * 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.html;
+
+import static org.richfaces.component.AbstractTogglePanelTitledItem.HeaderStates.active;
+import static org.richfaces.component.AbstractTogglePanelTitledItem.HeaderStates.disabled;
+import static org.richfaces.component.AbstractTogglePanelTitledItem.HeaderStates.inactive;
+import static org.richfaces.component.html.HtmlAccordion.PropertyKeys.height;
+import static org.richfaces.component.util.HtmlUtil.concatClasses;
+import static org.richfaces.component.util.HtmlUtil.concatStyles;
+import static org.richfaces.renderkit.RenderKitUtils.renderPassThroughAttributes;
+
+import java.io.IOException;
+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 javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.javascript.JSObject;
+import org.richfaces.component.AbstractTabPanel;
+import org.richfaces.component.AbstractTogglePanel;
+import org.richfaces.component.AbstractTogglePanelItem;
+import org.richfaces.component.AbstractTogglePanelTitledItem;
+import org.richfaces.component.html.HtmlTab;
+import org.richfaces.component.util.HtmlUtil;
+import org.richfaces.renderkit.HtmlConstants;
+import org.richfaces.renderkit.RenderKitUtils;
+
+/**
+ * @author akolonitsky
+ * @since 2010-08-24
+ */
+@ResourceDependencies( { // TODO review
+ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(name = "richfaces-event.js"),
+ @ResourceDependency(name = "richfaces-base-component.js"),
+ @ResourceDependency(library = "org.richfaces", name = "tabPanel.ecss"),
+ @ResourceDependency(library = "org.richfaces", name = "TogglePanel.js"),
+ @ResourceDependency(library = "org.richfaces", name = "TabPanel.js")
+})
+public class TabPanelRenderer extends TogglePanelRenderer {
+
+ private static final RenderKitUtils.Attributes HEADER_ATTRIBUTES = RenderKitUtils.attributes()
+ .generic("onclick", HtmlTab.PropertyKeys.onheaderclick.toString(), "headerclick")
+ .generic("ondblclick", HtmlTab.PropertyKeys.onheaderdblclick.toString(), "headerdblclick")
+ .generic("onmousedown", HtmlTab.PropertyKeys.onheadermousedown.toString(), "headermousedown")
+ .generic("onmousemove", HtmlTab.PropertyKeys.onheadermousemove.toString(), "headermousemove")
+ .generic("onmouseup", HtmlTab.PropertyKeys.onheadermouseup.toString(), "headermouseup");
+
+ private static final String DIV = "div";
+ private static final String STYLE = "style";
+ private static final String CLASS = "class";
+
+ @Override
+ protected void doEncodeBegin(ResponseWriter w, FacesContext context, UIComponent comp) throws IOException {
+ super.doEncodeBegin(w, context, comp);
+ writeJavaScript(w, context, comp);
+
+ writeTabsLine(w, context, comp);
+ writeTabsLineSeparator(w);
+ }
+
+ private void writeTabsLineSeparator(ResponseWriter writer) throws IOException {
+ writer.write("<div class='rf-tb-hdr_brd'></div>");
+ }
+
+ private void writeTabsLine(ResponseWriter w, FacesContext context, UIComponent comp) throws IOException {
+ w.startElement(DIV, comp);
+ w.writeAttribute(CLASS, "rf-tb-hdr-tabline-vis", null);
+
+ w.startElement("table", comp);
+ w.writeAttribute("class", "rf-tb-hdr-tabs", null);
+ w.writeAttribute("cellspacing", "0", null);
+ w.startElement("tbody", comp);
+ w.startElement("tr", comp);
+
+ writeTopTabFirstSpacer(w, comp);
+
+ for (AbstractTogglePanelItem item : ((AbstractTogglePanel) comp).getRenderedItems()) {
+ AbstractTogglePanelTitledItem tab = (AbstractTogglePanelTitledItem) item;
+ writeTopTabHeader(context, w, tab);
+ writeTopTabSpacer(w, comp);
+ }
+
+ writeTopTabLastSpacer(w, comp);
+
+ w.endElement("tr");
+ w.endElement("tbody");
+ w.endElement("table");
+
+ writeTopTabsControl(w, comp, "rf-tb-hdr-scrl_l rf-tb-hdn", "\u00AB");
+ writeTopTabsControl(w, comp, "rf-tb-hdr-tablst rf-tb-hdn", "\u2193");
+ writeTopTabsControl(w, comp, "rf-tb-hdr-scrl_r rf-tb-hdn", "\u00BB");
+
+ w.endElement("div");
+ }
+
+ @Override
+ protected String getStyle(UIComponent component) {
+ return concatStyles(attributeAsString(component, "style"), "width: 100%;");
+ }
+
+ @Override
+ protected String getStyleClass(UIComponent component) {
+ return HtmlUtil.concatClasses("rf-tbp", attributeAsString(component, "styleClass"));
+ }
+
+ private void writeTopTabHeader(FacesContext context, ResponseWriter writer, AbstractTogglePanelTitledItem tab) throws IOException {
+ boolean isActive = tab.isActive();
+ boolean isDisabled = tab.isDisabled();
+
+ encodeTabHeader(context, tab, writer, inactive, !isActive && !isDisabled);
+ encodeTabHeader(context, tab, writer, active, isActive && !isDisabled);
+ encodeTabHeader(context, tab, writer, disabled, isDisabled);
+
+ }
+
+ private void encodeTabHeader(FacesContext context, AbstractTogglePanelTitledItem tab, ResponseWriter writer,
+ AbstractTogglePanelTitledItem.HeaderStates state, Boolean isDisplay) throws IOException {
+
+
+ writer.startElement("td", tab);
+ writer.writeAttribute("id", tab.getClientId() + ":header:" + state.toString(), null);
+ renderPassThroughAttributes(context, tab, HEADER_ATTRIBUTES);
+ String name = "headerClass" + capitalize(state.toString());
+ writer.writeAttribute("class", concatClasses("rf-tb-hdr rf-tb-hdr-" + state.abbreviation(),
+ attributeAsString(tab, HtmlTab.PropertyKeys.headerClass), attributeAsString(tab, name)), null);
+ writer.writeAttribute("style", concatStyles(isDisplay ? "" : "display : none", attributeAsString(tab, HtmlTab.PropertyKeys.headerStyle.toString())), null);
+
+ writer.startElement("span", tab);
+ writer.writeAttribute("class", "rf-tb-lbl", null);
+
+ UIComponent headerFacet = tab.getHeaderFacet(state);
+ if (headerFacet != null && headerFacet.isRendered()) {
+ headerFacet.encodeAll(context);
+ } else {
+ Object headerText = tab.getAttributes().get("header");
+ if (headerText != null && !headerText.equals("")) {
+ writer.writeText(headerText, null);
+ }
+ }
+
+ writer.endElement("span");
+
+ writer.endElement("td");
+ }
+
+
+
+ private void writeTopTabsControl(ResponseWriter w, UIComponent comp, String styles, String text) throws IOException {
+ w.startElement("div", comp);
+ w.writeAttribute("class", styles, null);
+ w.writeText(text, null);
+ w.endElement("div");
+ }
+
+ private void writeTopTabFirstSpacer(ResponseWriter w, UIComponent comp) throws IOException {
+ writeTopTabSpacer(w, comp, "padding-left: 5px;", "rf-tb-hdr-spcr");
+ }
+
+ private void writeTopTabSpacer(ResponseWriter w, UIComponent comp) throws IOException {
+ writeTopTabSpacer(w, comp, "", "rf-tb-hdr-spcr rf-tb-hortab-tabspcr_wdh");
+ }
+
+ private void writeTopTabLastSpacer(ResponseWriter w, UIComponent comp) throws IOException {
+ writeTopTabSpacer(w, comp, "padding-right: 5px; width: 100%;", "rf-tb-hdr-spcr");
+ }
+
+ private void writeTopTabSpacer(ResponseWriter w, UIComponent comp, String style, String classStyle) throws IOException {
+ w.startElement("td", comp);
+ w.writeAttribute(STYLE, style, null);
+ w.writeAttribute(CLASS, classStyle, null);
+ w.write("<br />");
+ w.endElement("td");
+ }
+
+ @Override
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+ writer.endElement(HtmlConstants.DIV_ELEM);
+ }
+
+ @Override
+ protected JSObject getScriptObject(FacesContext context, UIComponent component) {
+ return new JSObject("RichFaces.ui.TabPanel",
+ component.getClientId(), getScriptObjectOptions(context, component));
+ }
+
+ @Override
+ protected Map<String, Object> getScriptObjectOptions(FacesContext context, UIComponent component) {
+ Map<String, Object> options = super.getScriptObjectOptions(context, component);
+ options.put("isKeepHeight", !attributeAsString(component, height).isEmpty());
+ options.remove("items");
+
+ return options;
+ }
+
+ @Override
+ protected Class<? extends UIComponent> getComponentClass() {
+ return AbstractTabPanel.class;
+ }
+}
+
Copied: branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java (from rev 19674, trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java)
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java (rev 0)
+++ branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,121 @@
+/*
+ * 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.html;
+
+import static org.richfaces.component.util.HtmlUtil.concatClasses;
+
+import java.io.IOException;
+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 javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.javascript.JSObject;
+import org.richfaces.component.AbstractTogglePanelTitledItem;
+import org.richfaces.renderkit.HtmlConstants;
+
+/**
+ * @author akolonitsky
+ * @since 2010-08-24
+ */
+@ResourceDependencies( { // TODO review
+ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(name = "richfaces-event.js"),
+ @ResourceDependency(name = "richfaces-base-component.js"),
+ @ResourceDependency(library = "org.richfaces", name = "TogglePanelItem.js"),
+ @ResourceDependency(library = "org.richfaces", name = "Tab.js")
+})
+public class TabRenderer extends TogglePanelItemRenderer {
+
+ @Override
+ protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+ super.doEncodeBegin(writer, context, component);
+
+ encodeContentBegin(component, writer);
+ }
+
+ @Override
+ protected String getStyleClass(UIComponent component) {
+ return concatClasses("rf-tb", attributeAsString(component, "styleClass"));
+ }
+
+ @Override
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+ encodeContentEnd(component, writer);
+
+ super.doEncodeEnd(writer, context, component);
+ }
+
+ @Override
+ protected void writeJavaScript(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+ Object script = getScriptObject(context, component);
+ if (script == null) {
+ return;
+ }
+
+ writer.startElement(HtmlConstants.SCRIPT_ELEM, component);
+ writer.writeAttribute(HtmlConstants.TYPE_ATTR, "text/javascript", "type");
+ writer.writeText(script, null);
+ writer.endElement(HtmlConstants.SCRIPT_ELEM);
+ }
+
+ private void encodeContentBegin(UIComponent component, ResponseWriter writer) throws IOException {
+ writer.startElement("div", component);
+ writer.writeAttribute("class", concatClasses("rf-tb-cnt", attributeAsString(component, "contentClass")), null);
+ writer.writeAttribute("id", component.getClientId() + ":content", null);
+
+ AbstractTogglePanelTitledItem item = (AbstractTogglePanelTitledItem) component;
+ if (!item.isActive() || item.isDisabled()) {
+ writer.writeAttribute("style", "display: none", null);
+ }
+ }
+
+ private void encodeContentEnd(UIComponent component, ResponseWriter responseWriter) throws IOException {
+ responseWriter.endElement("div");
+ }
+
+ @Override
+ protected JSObject getScriptObject(FacesContext context, UIComponent component) {
+ return new JSObject("RichFaces.ui.Tab", component.getClientId(),
+ getScriptObjectOptions(context, component));
+ }
+
+ @Override
+ protected Map<String, Object> getScriptObjectOptions(FacesContext context, UIComponent component) {
+ Map<String, Object> res = super.getScriptObjectOptions(context, component);
+ res.put("disabled", ((AbstractTogglePanelTitledItem) component).isDisabled());
+
+ return res;
+ }
+
+ @Override
+ protected Class<? extends UIComponent> getComponentClass() {
+ return AbstractTogglePanelTitledItem.class;
+ }
+}
+
Modified: branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -22,23 +22,18 @@
package org.richfaces.renderkit.html;
-import org.richfaces.component.behavior.ToggleControl;
-
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import javax.faces.component.behavior.ClientBehavior;
import javax.faces.component.behavior.ClientBehaviorContext;
import javax.faces.render.ClientBehaviorRenderer;
-import javax.faces.render.FacesBehaviorRenderer;
-import javax.faces.render.RenderKitFactory;
+import org.richfaces.component.behavior.ToggleControl;
+
/**
* @author akolonitsky
*
*/
-@FacesBehaviorRenderer(
- rendererType = "org.richfaces.component.behavior.ToggleControl",
- renderKitId = RenderKitFactory.HTML_BASIC_RENDER_KIT)
@ResourceDependencies({
@ResourceDependency(name = "jquery.js"),
@ResourceDependency(name = "richfaces.js") })
Modified: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-10-27 15:07:36 UTC (rev 19690)
@@ -491,7 +491,7 @@
</component>
<component>
- <component-type>org.richfaces.TogglePanelTitledItem</component-type>
+ <component-type>org.richfaces.AccordionItem</component-type>
<component-class>org.richfaces.component.html.HtmlAccordionItem</component-class>
<property>
<description></description>
@@ -653,8 +653,15 @@
<property-name>onmouseup</property-name>
<property-class>java.lang.String</property-class>
</property>
-
</component>
+ <component>
+ <component-type>org.richfaces.TabPanel</component-type>
+ <component-class>org.richfaces.component.html.HtmlTabPanel</component-class>
+ </component>
+ <component>
+ <component-type>org.richfaces.TabPanelItem</component-type>
+ <component-class>org.richfaces.component.html.HtmlTab</component-class>
+ </component>
<render-kit>
<render-kit-id>HTML_BASIC</render-kit-id>
@@ -683,6 +690,7 @@
<renderer-type>org.richfaces.AccordionItem</renderer-type>
<renderer-class>org.richfaces.renderkit.html.AccordionItemRenderer</renderer-class>
</renderer>
+
<renderer>
<component-family>org.richfaces.Panel</component-family>
<renderer-type>org.richfaces.PanelRenderer</renderer-type>
@@ -699,8 +707,32 @@
<cdk:renders-children>false</cdk:renders-children>
</renderer-extension>
</renderer>
- </render-kit>
+ <renderer>
+ <component-family>org.richfaces.TabPanel</component-family>
+ <renderer-type>org.richfaces.TabPanel</renderer-type>
+ <renderer-class>org.richfaces.renderkit.html.TabPanelRenderer</renderer-class>
+ </renderer>
+ <renderer>
+ <component-family>org.richfaces.TogglePanelTitledItem</component-family>
+ <renderer-type>org.richfaces.Tab</renderer-type>
+ <renderer-class>org.richfaces.renderkit.html.TabRenderer</renderer-class>
+ </renderer>
+ <renderer>
+ <component-family>org.richfaces.ProgressBar</component-family>
+ <renderer-type>org.richfaces.ProgressBarRenderer</renderer-type>
+ <renderer-class>org.richfaces.renderkit.html.ProgressBarRenderer</renderer-class>
+ <renderer-extension>
+ <cdk:renders-children>false</cdk:renders-children>
+ </renderer-extension>
+ </renderer>
+
+ <client-behavior-renderer>
+ <client-behavior-renderer-type>org.richfaces.component.behavior.ToggleControl</client-behavior-renderer-type>
+ <client-behavior-renderer-class>org.richfaces.renderkit.html.ToggleControlRenderer</client-behavior-renderer-class>
+ </client-behavior-renderer>
+ </render-kit>
+
<faces-config-extension>
<cdk:taglib>
<cdk:shortName>output</cdk:shortName>
Modified: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-10-27 15:07:36 UTC (rev 19690)
@@ -21,6 +21,13 @@
</component>
</tag>
<tag>
+ <tag-name>progressBar</tag-name>
+ <component>
+ <component-type>org.richfaces.ProgressBar</component-type>
+ <renderer-type>org.richfaces.ProgressBarRenderer</renderer-type>
+ </component>
+ </tag>
+ <tag>
<tag-name>popupPanel</tag-name>
<component>
<component-type>org.richfaces.PopupPanel</component-type>
@@ -29,6 +36,22 @@
</tag>
<tag>
+ <tag-name>tabPanel</tag-name>
+ <component>
+ <component-type>org.richfaces.TabPanel</component-type>
+ <renderer-type>org.richfaces.TabPanel</renderer-type>
+ </component>
+ </tag>
+ <tag>
+ <tag-name>tab</tag-name>
+ <component>
+ <component-type>org.richfaces.TabPanelItem</component-type>
+ <renderer-type>org.richfaces.Tab</renderer-type>
+ </component>
+ </tag>
+
+
+ <tag>
<tag-name>collapsiblePanel</tag-name>
<component>
<component-type>org.richfaces.CollapsiblePanel</component-type>
@@ -718,9 +741,8 @@
<tag>
<tag-name>accordionItem</tag-name>
<component>
- <component-type>org.richfaces.TogglePanelTitledItem</component-type>
+ <component-type>org.richfaces.AccordionItem</component-type>
<renderer-type>org.richfaces.AccordionItem</renderer-type>
-
</component>
<attribute>
<description></description>
@@ -882,6 +904,6 @@
<name>onmouseup</name>
<type>java.lang.String</type>
</attribute>
-
</tag>
+
</facelet-taglib>
Modified: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/CollapsiblePanelItem.js
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/CollapsiblePanelItem.js 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/CollapsiblePanelItem.js 2010-10-27 15:07:36 UTC (rev 19690)
@@ -45,7 +45,7 @@
},
__state : function () {
- return this.getName() === "true" ? "expanded" : "collapsed";
+ return this.getName() === "true" ? "exp" : "colps";
},
__header : function (state) {
Copied: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab.js (from rev 19674, trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab.js)
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab.js (rev 0)
+++ branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab.js 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,136 @@
+/*
+ * 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.
+ */
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.Tab = rf.ui.TogglePanelItem.extendClass({
+ // class name
+ name:"Tab",
+
+ /**
+ * @class AccordionItem
+ * @name AccordionItem
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ rf.ui.TogglePanelItem.call(this, componentId, options);
+ this.index = options["index"];
+ this.getTogglePanel().getItems()[this.index] = this;
+
+ //TODO - optimize this
+ rf.Event.bindById(this.id + ":header:active", "click", this.__onHeaderClick, this)
+ rf.Event.bindById(this.id + ":header:inactive", "click", this.__onHeaderClick, this)
+ },
+
+ /***************************** Public Methods ****************************************************************/
+
+ __onHeaderClick : function (comp) {
+ this.getTogglePanel().switchToItem(this.getName());
+ },
+
+ /**
+ * @param state {string} = inactive | active | disabled
+ * in that case looking header by css class appropriate to this state
+ *
+ * @return {jQuery Object}
+ * */
+ __header : function (state) {
+ var res = $(rf.getDomElement(this.id + ":header"));
+ if (state) {
+ return $(rf.getDomElement(this.id + ":header:" + state));
+ }
+
+ return res;
+ },
+
+ /**
+ * @return {jQuery Object}
+ * */
+ __content : function () {
+ if (!this.__content_) {
+ this.__content_ = $(rf.getDomElement(this.id + ":content"));
+ }
+ return this.__content_;
+ },
+
+ /**
+ * @private
+ *
+ * used in TogglePanel
+ * */
+ __enter : function () {
+
+ this.__content().show();
+ this.__header("inactive").hide();
+ this.__header("active").show();
+
+ return this.__fireEnter();
+ },
+
+ getHeight : function (recalculate) {
+ if (recalculate || !this.__height) {
+ this.__height = $(rf.getDomElement(this.id)).outerHeight(true)
+ }
+
+ return this.__height;
+ },
+
+ /**
+ * @private
+ *
+ * used in TogglePanel
+ * */
+ __leave : function () {
+ var continueProcess = this.__fireLeave();
+ if (!continueProcess) {
+ return false;
+ }
+
+ this.__content().hide();
+ this.__header("active").hide();
+ this.__header("inactive").show();
+
+ return true;
+ },
+
+ /***************************** Private Methods ********************************************************/
+
+
+ destroy: function () {
+ var parent = this.getTogglePanel();
+ delete parent.getItems()[this.index];
+
+ rf.Event.unbindById(this.id);
+
+ //TODO - optimize
+ rf.Event.unbindById(this.id + ":header:active");
+ rf.Event.unbindById(this.id + ":header:inactive");
+
+ this.$super.destroy.call(this);
+ }
+ });
+})(jQuery, RichFaces);
Copied: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TabPanel.js (from rev 19674, trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TabPanel.js)
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TabPanel.js (rev 0)
+++ branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TabPanel.js 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ */
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.TabPanel = rf.ui.TogglePanel.extendClass({
+ // class name
+ name:"TabPanel",
+
+ /**
+ * @class TabPanel
+ * @name TabPanel
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ rf.ui.TogglePanel.call(this, componentId, options);
+ this.items = [];
+
+ this.isKeepHeight = options["isKeepHeight"] || false
+ },
+
+ /***************************** Public Methods ****************************************************************/
+
+
+
+ /***************************** Private Methods ********************************************************/
+
+
+ destroy: function () {
+ rf.Event.unbindById(this.id, "."+this.namespace);
+
+ rf.ui.TogglePanel.destroy.call(this);
+ }
+ });
+})(jQuery, RichFaces);
Copied: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/close.gif (from rev 19674, trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/close.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/close_act.gif (from rev 19674, trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/close_act.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/ico.gif (from rev 19674, trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/ico.gif)
===================================================================
(Binary files differ)
Modified: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panel.ecss
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panel.ecss 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panel.ecss 2010-10-27 15:07:36 UTC (rev 19690)
@@ -6,7 +6,7 @@
padding:1px;
}
-.rf-p-hr{
+.rf-p-hdr{
background-color:'#{richSkin.headerBackgroundColor}';
border-color:'#{richSkin.headerBackgroundColor}';
font-size:'#{richSkin.headerSizeFont}';
Modified: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.ecss
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.ecss 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.ecss 2010-10-27 15:07:36 UTC (rev 19690)
@@ -1,4 +1,4 @@
-.rf-pp-b {
+.rf-pp-btn {
outline-style: none;
position: absolute;
clip: rect(0px 0px 1px 1px);
@@ -7,32 +7,33 @@
left: 0px;
top: 0px;
z-index: -300;
- opacity:0.1;
- filter : 'alpha(opacity=10)';
+ opacity: 0.1;
+ filter: 'alpha(opacity = 10)';
}
-.rf-pp-sh {
- position : fixed;
- width : 100%;
- height : 100%;
- top:0px;
- left : 0px;
- background : #D0D0D0;
- opacity:0.5;
- filter : 'alpha(opacity=50)';
+.rf-pp-shade {
+ position: fixed;
+ width: 100%;
+ height: 100%;
+ top: 0px;
+ left: 0px;
+ background-color: #D0D0D0;
+ opacity: 0.5;
+ filter: 'alpha(opacity = 50)';
}
-.rf-pp-shw {
- background-color : #000000;
- opacity:0.1;
- filter : 'alpha(opacity=10)';
+.rf-pp-shdw {
+ background-color: #000000;
+ opacity: 0.1;
+ filter: 'alpha(opacity = 10)';
}
-.rf-pp-cr {
+
+.rf-pp-cntr {
border : '1px solid #{richSkin.panelBorderColor}';
background : '#{richSkin.generalBackgroundColor}';
z-index:100;
}
-.rf-pp-h {
+.rf-pp-hdr {
background : "url(#{resource['org.richfaces.renderkit.html.GradientA']})";
repeat-x : 'top left #{richSkin.headerBackgroundColor}';
position : relative;
@@ -40,7 +41,7 @@
cursor : move;
padding : 2px;
}
-.rf-pp-h-ct {
+.rf-pp-hdr-cnt {
overflow : hidden;
white-space : nowrap;
text-overflow: ellipsis;
@@ -51,7 +52,7 @@
padding : 2px;
padding-left : 10px;
}
-.rf-pp-h-cs {
+.rf-pp-hdr-cntrls {
position : absolute;
top : 2px;
right : 2px;
@@ -64,27 +65,27 @@
z-index:100;
}
-.rf-pp-ct-sr {
+.rf-pp-cnt-scrlr {
position : relative;
top : 0px;
left : 0px;
overflow : auto;
}
-.rf-pp-ct {
+.rf-pp-cnt {
position : relative;
padding : 10px;
color : '#{richSkin.generalTextColor}';
font-family : '#{richSkin.generalFamilyFont}';
font-size : '#{richSkin.generalSizeFont}';
}
-.rf-pp-hr {
- background : red;
- filter : 'alpha(opacity=0)';
+.rf-pp-hndlr {
opacity:0;
position : absolute;
margin : -4px;
+ filter : 'alpha(opacity = 0)';
}
-.rf-pp-hr-l {
+
+.rf-pp-hndlr-l {
width : 7px;
height : 100%;
top : 0px;
@@ -92,7 +93,7 @@
cursor : w-resize;
}
-.rf-pp-hr-r {
+.rf-pp-hndlr-r {
width : 7px;
height : 100%;
top : 0px;
@@ -100,7 +101,7 @@
cursor : w-resize;
}
-.rf-pp-if {
+.rf-pp-ifr {
position: absolute;
left: 0px;
top: 0px;
@@ -109,14 +110,14 @@
z-index: -1;
}
-.rf-pp-hr-t {
+.rf-pp-hndlr-t {
width : 100%;
height : 7px;
top : 0px;
left : 0px;
cursor : n-resize;
}
-.rf-pp-hr-b {
+.rf-pp-hndlr-b {
width : 100%;
height : 7px;
bottom : 0px;
@@ -124,28 +125,28 @@
cursor : n-resize;
}
-.rf-pp-hr-tl {
+.rf-pp-hndlr-tl {
width : 10px;
height : 10px;
top : 0px;
left : 0px;
cursor : nw-resize;
}
-.rf-pp-hr-tr {
+.rf-pp-hndlr-tr {
width : 10px;
height : 10px;
top : 0px;
right : 0px;
cursor : ne-resize;
}
-.rf-pp-hr-bl {
+.rf-pp-hndlr-bl {
width : 10px;
height : 10px;
bottom : 0px;
left : 0px;
cursor : ne-resize;
}
-.rf-pp-hr-br {
+.rf-pp-hndlr-br {
width : 10px;
height : 10px;
bottom : 0px;
Modified: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2010-10-27 15:07:36 UTC (rev 19690)
@@ -68,6 +68,7 @@
this.cdiv = $(richfaces.getDomElement(id + "_container"));
this.contentDiv = $(richfaces.getDomElement(id + "_content"));
this.shadowDiv = $(richfaces.getDomElement(id + "_shadow"));
+ this.shadeDiv = $(richfaces.getDomElement(id + "_shade"));
this.scrollerDiv = $(richfaces.getDomElement(id + "_content_scroller"));
this.borders = new Array();
@@ -215,12 +216,13 @@
},
show: function(event, opts) {
+ var element = this.cdiv;
if(!this.shown && this.invokeEvent("beforeshow",event,null,element)) {
this.preventFocus();
- var element = this.div;
+
if (!this.domReattached) {
- this.parent = element.parent();
+ this.parent = this.div.parent();
var domElementAttachment;
if (opts) {
@@ -243,7 +245,9 @@
if (newParent != this.parent) {
this.saveInputValues(element);
- element.insertBefore(newParent.firstChild);
+ this.shadeDiv.insertAfter(newParent.lastChild);
+ this.shadowDiv.insertAfter(newParent.lastChild);
+ this.cdiv.insertAfter(newParent.lastChild);
this.domReattached = true;
} else {
this.parent.show();
@@ -316,7 +320,7 @@
if (this.options.overlapEmbedObjects && !this.iframe) {
this.iframe = this.markerId + "IFrame";
$("<iframe src=\"javascript:''\" frameborder=\"0\" scrolling=\"no\" id=\"" + this.iframe + "\" " +
- "class=\"rf-pp-if\" style=\"width:" +this.options.width + "px; height:" + this.options.height + "px;\">" +
+ "class=\"rf-pp-ifr\" style=\"width:" +this.options.width + "px; height:" + this.options.height + "px;\">" +
"</iframe>").insertBefore($(':first-child', this.cdiv)[0]);
eIframe = $(richfaces.getDomElement(this.iframe));
@@ -365,8 +369,8 @@
this.shadowDiv.css('opacity', this.options.shadowOpacity);
this.shadowDiv.css('filter ', 'alpha(opacity='+this.options.shadowOpacity*100 +');');
- element.css('visibility', '');
- element.css('display', 'block');
+ this.div.css('visibility', '');
+ this.div.css('display', 'block');
if (this.options.autosized) {
this.shadowDiv.css('height', this.cdiv[0].clientHeight);
this.shadowDiv.css('width', this.cdiv[0].clientWidth);
@@ -475,7 +479,7 @@
},
hide: function(event, opts) {
- var element = this.id;
+ var element = this.cdiv;
this.restoreFocus();
if (this.shown && this.invokeEvent("beforehide",event,null,element)) {
@@ -487,12 +491,11 @@
if (this.parent) {
if (this.domReattached) {
this.saveInputValues(element);
+ this.div.append(this.shadeDiv);
+ this.div.append(this.shadowDiv);
+ this.div.append(element);
- this.parent.append(element);
-
this.domReattached = false;
- } else {
- this.parent.hide();
}
}
@@ -510,7 +513,7 @@
}
this.shown = false;
-
+ this.invokeEvent("hide",event,null,element)
}
},
@@ -544,14 +547,14 @@
if (newSize >= this.currentMinWidth || this.options.autosized) {
if (diff.deltaWidth) {
cssHashWH.width = newSize + 'px';
- shadowHashWH.width = newSize + shadowDepth + 'px';
+ shadowHashWH.width = newSize + 'px';
contentHashWH.width = newSize - scrollerWidth + 'px';
scrollerHashWH.width = newSize - scrollerWidth + 'px';
}
} else {
if (diff.deltaWidth) {
cssHashWH.width = this.currentMinWidth + 'px';
- shadowHashWH.width = this.currentMinWidth + shadowDepth + 'px';
+ shadowHashWH.width = this.currentMinWidth + 'px';
contentHashWH.width = this.currentMinWidth - scrollerWidth + 'px';
scrollerHashWH.width = this.currentMinWidth - scrollerWidth + 'px';
vetoes.vx = oldSize - this.currentMinWidth;
@@ -563,7 +566,7 @@
if (newSize > this.options.maxWidth) {
if (diff.deltaWidth) {
cssHashWH.width = this.currentMaxWidth + 'px';
- shadowHashWH.width = this.currentMaxWidth + shadowDepth + 'px';
+ shadowHashWH.width = this.currentMaxWidth + 'px';
contentHashWH.width = this.currentMaxWidth - scrollerWidth + 'px';
scrollerHashWH.width = this.currentMaxWidth - scrollerWidth + 'px';
vetoes.vx = oldSize - this.currentMaxWidth;
@@ -599,13 +602,13 @@
if (newSize >= this.currentMinHeight || this.options.autosized) {
if (diff.deltaHeight) {
cssHashWH.height = newSize + 'px';
- shadowHashWH.height = newSize + shadowDepth + 'px';
+ shadowHashWH.height = newSize + 'px';
scrollerHashWH.height = newSize - scrollerHeight + 'px';
}
} else {
if (diff.deltaHeight) {
cssHashWH.height = this.currentMinHeight + 'px';
- shadowHashWH.height = this.currentMinHeight + shadowDepth + 'px';
+ shadowHashWH.height = this.currentMinHeight + 'px';
scrollerHashWH.height = this.currentMinHeight - scrollerHeight + 'px';
vetoes.vy = oldSize - this.currentMinHeight;
}
@@ -616,7 +619,7 @@
if (newSize > this.options.maxHeight) {
if (diff.deltaHeight) {
cssHashWH.height = this.currentMaxHeight + 'px';
- shadowHashWH.height = this.currentMaxHeight + shadowDepth + 'px';
+ shadowHashWH.height = this.currentMaxHeight + 'px';
scrollerHashWH.height = this.currentMaxHeight - scrollerHeight + 'px';
vetoes.vy = oldSize - this.currentMaxHeight;
}
@@ -710,8 +713,8 @@
findForm: function(elt) {
var target = elt;
while (target) {
- if (!target.tagName /* document node doesn't have tagName */
- || target.tagName.toLowerCase() != "form") {
+ if (target[0] && (!target[0].tagName /* document node doesn't have tagName */
+ || target[0].tagName.toLowerCase() != "form")) {
target = $(target).parent();
} else {
@@ -748,7 +751,7 @@
invokeEvent: function(eventName, event, value, element) {
- var eventFunction = this.options['on'+eventName];
+ var eventFunction = eval(this.options['on'+eventName]);
var result;
if (eventFunction) {
Modified: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelSizer.js
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelSizer.js 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelSizer.js 2010-10-27 15:07:36 UTC (rev 19690)
@@ -114,7 +114,7 @@
doDiff : function(dx, dy) {
return new richfaces.ui.PopupPanel.Sizer.Diff(0, dy, 0, -dy);
- },
+ }
});
Copied: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.ecss (from rev 19674, trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.ecss)
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.ecss (rev 0)
+++ branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.ecss 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,44 @@
+.rf-pb-cnt{
+height : 13px;
+white-space : nowrap;
+width : 200px;
+}
+.rf-pb-upl{
+background-repeat : repeat-x;
+background-image : "url(#{resource['org.richfaces.images:pbAniBg.gif']})";
+background-color : '#{richSkin.selectControlColor}';
+height : 13px;
+}
+.rf-pb-upl-dig{
+overflow : hidden; position : absolute; top : 0px; left : 0px;
+border-color : '#{richSkin.panelBorderColor}';
+}
+.rf-pb-shl{
+margin-bottom : 2px; border : 1px solid;
+background-color : '#{richSkin.controlBackgroundColor}';
+border-color : '#{richSkin.panelBorderColor}';
+}
+.rf-pb-shl-dig{
+position : relative; margin-bottom : 2px; border : 1px solid; overflow: hidden;
+border-color : '#{richSkin.panelBorderColor}';
+color : '#{richSkin.controlTextColor}';
+font-family : '#{richSkin.generalFamilyFont}';
+font-size : '#{richSkin.generalSizeFont}';
+}
+.rf-pb-rmnd{
+text-align : center; font-weight : bold; position : relative;
+background-color : '#{richSkin.controlBackgroundColor}';
+text-color : '#{richSkin.controlTextColor}';
+height : 13px;
+width : 200px;
+padding: 0px;
+}
+.rf-pb-cmpltd{
+text-align : center; font-weight : bold; background-repeat : repeat-x;
+background-color : '#{richSkin.selectControlColor}';
+text-color : '#{richSkin.controlBackgroundColor}';
+height : 13px;
+width : 200px;
+padding: 0px;
+background-image : "url(#{resource['org.richfaces.images:pbAniBg.gif']})";
+}
Copied: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js (from rev 19674, trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js)
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js (rev 0)
+++ branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,293 @@
+//ProgressBar = {};
+//ProgressBar = Class.create();
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ // Constructor definition
+ rf.ui.ProgressBar = function(componentId, options) {
+ // call constructor of parent class
+ $super.constructor.call(this, componentId);
+ this.id = componentId;
+ this.attachToDom(this.id);
+ this.options = $.extend({}, defaultOptions, options);
+ var f = this.getForm();
+ this.formId = (f) ? f.id : null;
+ this.disabled = false;
+ this.state = this.options.state;
+ this.value = this.options.value;
+ this.minValue = this.options.minValue;
+ this.maxValue = this.options.maxValue;
+ var component = this;
+ this.options.beforedomupdate = function(event) {
+ component.onComplete(event.data);
+ }
+
+ };
+
+ // Extend component class and add protected methods from parent class to our container
+ rf.BaseComponent.extend(rf.ui.ProgressBar);
+
+ // define super class link
+ var $super = rf.ui.ProgressBar.$super;
+
+ var defaultOptions = {
+ mode: "ajax",
+ minValue: 0,
+ maxValue: 100,
+ state : "initialState"
+ };
+
+ var getForm = function () {
+ var parentForm = rf.getDomElement(this.id);
+ while (parentForm.tagName && parentForm.tagName.toLowerCase() != 'form') {
+ parentForm = parentForm.parentNode;
+ }
+ return parentForm;
+ };
+
+ var getValue = function () {
+ return this.value;
+ };
+
+ var getParameter = function (ev, params, paramName) {
+ if (!params) {
+ params = ev;
+ }
+ if (params && params[paramName]) {
+ return params[paramName];
+ }
+ return params;
+ };
+
+ var onComplete = function (data) {
+ if (!rf.getDomElement(this.id) || this.disabled) { return; }
+ if (data) {
+ this.value = data['value'];
+ if (this.state == "progressState") {
+ if (this.value > this.getMaxValue()) {
+ this.options.enabled=false;
+ this.forceState("completeState",null);
+ return;
+ }
+ this.updateComponent(data);
+ this.renderLabel(data['markup'], data['context']);
+ } else if (this.state == "initialState" && this.value > this.getMinValue()) {
+ this.state = "progressState";
+ this.forceState("progressState");
+ return;
+ }
+ this.poll();
+ }
+
+ };
+ var poll = function () {
+ if(this.options.enabled){
+ this.options.parameters = this.options.parameters || {};
+ this.options.parameters['percent'] = "percent";
+ this.options.parameters[this.id] = this.id;
+ var component = this;
+ window.setTimeout(function(){
+ if(component.options.onsubmit){
+ var onsubmit = eval(component.options.onsubmit)
+ var result = onsubmit.call(component);
+ if (result!=false) {
+ result = true;
+ }
+ if(result){
+ rf.ajax(component.options.pollId, null, component.options);
+ }
+ }else{
+ rf.ajax(component.options.pollId, null, component.options);
+ }
+
+ },this.options.pollinterval);
+ }
+ };
+
+ var updateComponent = function (data) {
+ this.setValue(this.value);
+ if (!data['enabled']) { this.disable(); }
+ this.updateClassName(rf.getDomElement(this.id + ":complete"), data['completeClass']);
+ this.updateClassName(rf.getDomElement(this.id + ":remain"), data['remainClass']);
+ this.updateClassName(rf.getDomElement(this.id), data['styleClass']);
+
+ if (this.options.pollinterval != data['interval']) {
+ this.options.pollinterval = data['interval'];
+ }
+ };
+
+ var updateClassName = function (o, newName) {
+ if (!newName) return;
+ if (o && o.className) {
+ if (o.className.indexOf(newName) < 0){
+ o.className = o.className + " " + newName;
+ }
+ }
+ };
+ var getContext = function () {
+ var context = this.context;
+ if (!context) { context = {}; }
+ context['minValue'] = (this.minValue == 0 ? "0" : this.minValue);
+ context['maxValue'] = (this.maxValue == 0 ? "0" : this.maxValue);
+ context['value'] = (this.value == 0 ? "0" : this.value);
+ if (this.progressVar) {
+ context[this.progressVar] = context['value'];
+ }
+ return context;
+ };
+
+ var getMode = function () {
+ return this.mode;
+ };
+ var getMaxValue = function () {
+ return this.maxValue;
+ };
+ var getMinValue = function () {
+ return this.minValue;
+ };
+ var isAjaxMode = function () {
+ return (this.getMode() == "ajax");
+ };
+ var calculatePercent = function(v) {
+ var min = parseFloat(this.getMinValue());
+ var max = parseFloat(this.getMaxValue());
+ var value = parseFloat(v);
+ if (value > min && value < max) {
+ return (100*(value - min))/(max - min);
+ } else if (value <= min) {
+ return 0;
+ } else if (value >= max) {
+ return 100;
+ }
+ };
+ var setValue = function (ev, val) {
+ val = this.getParameter(ev, val, "value");
+ this.value = val;
+ if (!this.isAjaxMode()) {
+ if (parseFloat(val) <= parseFloat(this.getMinValue())) {
+ this.switchState("initialState");
+ }else if (parseFloat(val) > parseFloat(this.getMaxValue())) {
+ this.switchState("completeState");
+ }else {
+ this.switchState("progressState");
+ }
+ }
+ if (!this.isAjaxMode() && this.state != "progressState") return;
+
+ if (this.markup) {
+ this.renderLabel(this.markup, this.getContext());
+ }
+ var p = this.calculatePercent(val);
+ var d = $(rf.getDomElement(this.id + ":upload"));
+ if (d != null) d.css('width', p + "%");
+
+ };
+
+ var renderLabel = function (markup, context) {
+ if (!markup || this.state != "progressState") {
+ return;
+ }
+ if (!context) {
+ context = this.getContext();
+ }
+ var html = this.interpolate(markup, context);
+ var remain = rf.getDomElement(this.id + ":remain");
+ var complete = rf.getDomElement(this.id + ":complete");
+ if(remain && complete){
+ remain.innerHTML = complete.innerHTML = html;
+ }
+
+ };
+ var interpolate = function (placeholders, context) {
+ for(var k in context) {
+ var v = context[k];
+ var regexp = new RegExp("\\{" + k + "\\}", "g");
+ placeholders = placeholders.replace(regexp, v);
+ }
+ return placeholders;
+ };
+
+ var enable = function (ev) {
+ if (!this.isAjaxMode()) {
+ this.switchState("progressState");
+ this.setValue(this.getMinValue() + 1);
+ }else if (!(this.value > this.getMaxValue())) {
+ this.disable();
+ this.poll();
+ }
+ this.disabled = false;
+ };
+ var disable = function () {
+ this.disabled = true;
+ };
+ var finish = function () {
+ if (!this.isAjaxMode()) {
+ this.switchState("completeState");
+ }else {
+ this.disable();
+ this.forceState("complete");
+ }
+ };
+ var hideAll = function () {
+ $(rf.getDomElement(this.id + ":progressState")).hide();
+ $(rf.getDomElement(this.id + ":completeState")).hide();
+ $(rf.getDomElement(this.id + ":initialState")).hide();
+ };
+ var switchState = function (state) {
+ this.state = state;
+ this.hideAll();
+ $(rf.getDomElement(this.id + ":" + state)).show();
+ };
+ var renderState = function (state) {
+ this.state = state;
+ this.hideAll();
+ $(rf.getDomElement(this.id + ":" + state)).show();
+ };
+ var forceState = function (state, oncomplete) {
+ var options = {};
+ options['parameters'] = options['parameters'] || {};
+ options['parameters']['forcePercent'] = state;
+ options['parameters'][this.id] = this.id;
+ if (oncomplete) {
+ options['oncomplete'] = oncomplete;
+ }
+ rf.ajax(this.formId, null, options);
+ };
+
+ /*
+ * Prototype definition
+ */
+ $.extend(rf.ui.ProgressBar.prototype, (function () {
+ return {
+ /*
+ * public API functions
+ */
+ name:"ProgressBar",
+ getForm: getForm,
+ getValue: getValue,
+ getParameter: getParameter,
+ onComplete: onComplete,
+ poll: poll,
+ updateComponent: updateComponent,
+ updateClassName: updateClassName,
+ getContext: getContext,
+ getMode: getMode,
+ getMaxValue: getMaxValue,
+ getMinValue: getMinValue,
+ isAjaxMode: isAjaxMode,
+ calculatePercent: calculatePercent,
+ setValue: setValue,
+ enable: enable,
+ disable: disable,
+ finish: finish,
+ hideAll: hideAll,
+ interpolate: interpolate,
+ renderLabel: renderLabel,
+ switchState: switchState,
+ renderState: renderState,
+ forceState: forceState
+
+ };
+ })());
+})(jQuery, RichFaces);
Copied: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.ecss (from rev 19674, trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.ecss)
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.ecss (rev 0)
+++ branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.ecss 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,136 @@
+.rf-tb-hdr {
+ white-space: nowrap;
+ border: "1px solid #{richSkin.panelBorderColor}";
+ cursor : pointer;
+ padding : 0px 5px 3px 5px;
+ vertical-align : top;
+ background-image: "url(#{resource['org.richfaces.images:tabBg.png']})";
+ background-position: top;
+ background-repeat: repeat-x;
+ background-color: "#{richSkin.tabBackgroundColor}";
+ color: '#{richSkin.generalTextColor}';
+}
+
+
+.rf-tb-hdr-act {
+ border-bottom: 0px;
+ font-weight: bold;
+ vertical-align: top;
+ background-image: "url(#{resource['org.richfaces.images:actTabBg.png']})";
+ background-position: top;
+ background-repeat: repeat-x;
+ background-color: "#{richSkin.additionalBackgroundColor}";
+ cursor: default;
+}
+
+.rf-tb-hdr-inact {
+}
+
+.rf-tb-hdr-dis {
+ color: "#{richSkin.tabDisabledTextColor}";
+ cursor: default;
+}
+
+.rf-tb-hdr-tabline-vis {
+ background:url("tabline_bg.gif") repeat-x scroll center top;
+ background-color: "#{richSkin.additionalBackgroundColor}";
+
+ border-color: "#{richSkin.panelBorderColor}";
+ border-style: solid;
+ border-width: 1px;
+
+ border-bottom-width: 0px;
+
+ padding-top: 2px;
+ overflow: hidden;
+ height: 25px;
+ white-space: nowrap;
+ position: relative;
+}
+
+.rf-tb-hdr-tabs {
+ border: 0px;
+ width: 100%;
+ height: 100%;
+}
+
+.rf-tb-hdr-spcr {
+ border-bottom: "1px solid #{richSkin.panelBorderColor}";
+}
+
+.rf-tb-hortab-tabspcr_wdh {
+ padding-left: 1px;
+}
+
+.rf-tb-lbl {
+ white-space: nowrap;
+ font-family: '#{richSkin.generalFamilyFont}';
+ font-size: '#{richSkin.generalSizeFont}';
+}
+
+.rf-tb-hdn {
+ display: none
+}
+
+.rf-tb-hdr-scrl_l {
+ background: "url(#{resource['org.richfaces.images:actTabBg.png']}) top repeat-x #{richSkin.additionalBackgroundColor}";
+ position: absolute;
+ top: 1px;
+ left: 1px;
+ width: 15px;
+ height: 25px;
+ border: "1px solid #{richSkin.panelBorderColor}";
+ text-align: center;
+ font-weight: bold;
+ font-family: '#{richSkin.generalFamilyFont}';
+ font-size: '#{richSkin.generalSizeFont}';
+ padding-top: 6px;
+}
+
+.rf-tb-hdr-scrl_r {
+ background: "url(#{resource['org.richfaces.images:actTabBg.png']}) top repeat-x #{richSkin.additionalBackgroundColor}";
+ position: absolute;
+ top: 1px;
+ right: 17px;
+ width: 15px;
+ height: 25px;
+ border: "1px solid #{richSkin.panelBorderColor}";
+ text-align: center;
+ font-family: '#{richSkin.generalFamilyFont}';
+ font-size: '#{richSkin.generalSizeFont}';
+ font-weight: bold;
+ padding-top: 6px;
+}
+
+.rf-tb-hdr-tablst {
+ background: "url(#{resource['org.richfaces.images:actTabBg.png']}) top repeat-x #{richSkin.additionalBackgroundColor}";
+ position: absolute;
+ top: 1px;
+ right: 1px;
+ width: 15px;
+ height: 25px;
+ border: "1px solid #{richSkin.panelBorderColor}";
+ font-weight: bold;
+ text-align: center;
+ font-family: '#{richSkin.generalFamilyFont}';
+ font-size: 14px;
+ padding-top: 2px;
+}
+
+.rf-tb-hdr_brd {
+ border: "1px solid #{richSkin.panelBorderColor}";
+ border-top: 0px;
+ height: 2px;
+ background: '#{richSkin.tabBackgroundColor}';
+}
+
+.rf-tb-cnt {
+ border: "1px solid #{richSkin.panelBorderColor}";
+ border-top: 0px;
+ font-family: '#{richSkin.generalFamilyFont}';
+ font-size: '#{richSkin.generalSizeFont}';
+ padding: 10px;
+ background: '#{richSkin.generalBackgroundColor}';
+}
+
+
Copied: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/richfaces (from rev 19674, trunk/ui/output/ui/src/main/resources/META-INF/richfaces)
Deleted: branches/RF-7817/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-10-26 17:10:27 UTC (rev 19674)
+++ branches/RF-7817/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties 2010-10-27 15:07:36 UTC (rev 19690)
@@ -1,16 +0,0 @@
-org.richfaces.images\:tabBg.png=org.richfaces.renderkit.html.BaseGradient\
- {width=5, height=26, baseColorParam=tabBackgroundColor, gradientColorParam=generalBackgroundColor}
-
-org.richfaces.images\:actTabBottomBg.png=org.richfaces.renderkit.html.BaseGradient\
- {width=5, height=26, baseColorParam=tabBackgroundColor, gradientColorParam=generalBackgroundColor}
-
-org.richfaces.images\:actTabBg.png=org.richfaces.renderkit.html.BaseGradient\
- {width=5, height=26, baseColorParam=generalBackgroundColor, gradientColorParam=tabBackgroundColor}
-
-org.richfaces.images\:actLeftTabBg.png=org.richfaces.renderkit.html.BaseGradient\
- {width=26, height=5, baseColorParam=tabBackgroundColor, gradientColorParam=generalBackgroundColor, horizontal=true}
-
-org.richfaces.images\:actRightTabBg.png=org.richfaces.renderkit.html.BaseGradient\
- {width=26, height=5, baseColorParam=generalBackgroundColor, gradientColorParam=tabBackgroundColor, horizontal=true}
-
-org.richfaces.images\:pbAniBg.gif=org.richfaces.renderkit.html.ProgressBarAnimatedBackgroundImage
\ No newline at end of file
Copied: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties (from rev 19674, trunk/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties)
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties (rev 0)
+++ branches/RF-7817/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,16 @@
+org.richfaces.images\:tabBg.png=org.richfaces.renderkit.html.BaseGradient\
+ {width=5, height=26, baseColorParam=tabBackgroundColor, gradientColorParam=generalBackgroundColor}
+
+org.richfaces.images\:actTabBottomBg.png=org.richfaces.renderkit.html.BaseGradient\
+ {width=5, height=26, baseColorParam=tabBackgroundColor, gradientColorParam=generalBackgroundColor}
+
+org.richfaces.images\:actTabBg.png=org.richfaces.renderkit.html.BaseGradient\
+ {width=5, height=26, baseColorParam=generalBackgroundColor, gradientColorParam=tabBackgroundColor}
+
+org.richfaces.images\:actLeftTabBg.png=org.richfaces.renderkit.html.BaseGradient\
+ {width=26, height=5, baseColorParam=tabBackgroundColor, gradientColorParam=generalBackgroundColor, horizontal=true}
+
+org.richfaces.images\:actRightTabBg.png=org.richfaces.renderkit.html.BaseGradient\
+ {width=26, height=5, baseColorParam=generalBackgroundColor, gradientColorParam=tabBackgroundColor, horizontal=true}
+
+org.richfaces.images\:pbAniBg.gif=org.richfaces.renderkit.html.ProgressBarAnimatedBackgroundImage
\ No newline at end of file
Modified: branches/RF-7817/ui/output/ui/src/main/templates/panel.template.xml
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/templates/panel.template.xml 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/templates/panel.template.xml 2010-10-27 15:07:36 UTC (rev 19690)
@@ -17,13 +17,13 @@
<div cdk:passThroughWithExclusions="id,value,styleClass,class" id="#{clientId}" class="rf-p #{component.attributes['styleClass']}">
<c:choose>
<c:when test="#{component.getFacet('header') != null and component.getFacet('header').rendered}">
- <div id="#{clientId}_header" class="rf-p-hr #{component.attributes['headerClass']}">
+ <div id="#{clientId}_header" class="rf-p-hdr #{component.attributes['headerClass']}">
<!-- <cc:renderFacet name="header" />-->
<cdk:call expression="renderHeaderFacet(facesContext, component)" />
</div>
</c:when>
<c:when test="#{component.attributes['header']!= null and not component.attributes['header'].equals('')}">
- <div id="#{clientId}_header" class="rf-p-hr #{component.attributes['headerClass']}">
+ <div id="#{clientId}_header" class="rf-p-hdr #{component.attributes['headerClass']}">
#{component.attributes['header']}
</div>
</c:when>
Modified: branches/RF-7817/ui/output/ui/src/main/templates/popupPanel.template.xml
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/templates/popupPanel.template.xml 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/templates/popupPanel.template.xml 2010-10-27 15:07:36 UTC (rev 19690)
@@ -24,49 +24,49 @@
onmousedown="#{component.attributes['onmaskmousedown']}"
onmousemove="#{component.attributes['onmaskmousemove']}"
onmouseover="#{component.attributes['onmaskmouseover']}"
- onmouseout="#{component.attributes['onmaskmouseout']}" class="rf-pp-sh">
- <button class="rf-pp-b" id="#{clientId}FirstHref"></button>
+ onmouseout="#{component.attributes['onmaskmouseout']}" class="rf-pp-shade">
+ <button class="rf-pp-btn" id="#{clientId}FirstHref"></button>
</div>
</c:if>
- <div id="#{clientId}_shadow" style="position: #{component.attributes['followByScroll'] ? 'fixed' : 'absolute'};" class="rf-pp-shw"/>
- <div id="#{clientId}_container" style="position: #{component.attributes['followByScroll'] ? 'fixed' : 'absolute'};" cdk:passThroughWithExclusions="id style class styleClass" class="rf-pp-cr #{component.attributes['styleClass']}">
+ <div id="#{clientId}_shadow" style="position: #{component.attributes['followByScroll'] ? 'fixed' : 'absolute'};" class="rf-pp-shdw"/>
+ <div id="#{clientId}_container" style="position: #{component.attributes['followByScroll'] ? 'fixed' : 'absolute'};" cdk:passThroughWithExclusions="id style class styleClass" class="rf-pp-cntr #{component.attributes['styleClass']}">
<c:if test="#{component.getFacet('header')!=null and component.getFacet('header').rendered}">
- <div id="#{clientId}_header" class="rf-pp-h #{component.attributes['headerClass']}" >
- <div id="#{clientId}_header_content" class="rf-pp-h-ct">
+ <div id="#{clientId}_header" class="rf-pp-hdr #{component.attributes['headerClass']}" >
+ <div id="#{clientId}_header_content" class="rf-pp-hdr-cnt">
<cdk:call expression="renderHeaderFacet(facesContext, component)"/>
</div>
</div>
</c:if>
<c:if test="#{component.attributes['header'] != null and (component.getFacet('header')==null or !component.getFacet('header').rendered)}">
- <div id="#{clientId}_header" class="rf-pp-h #{component.attributes['headerClass']}" >
- <div id="#{clientId}_header_content" class="rf-pp-h-ct">
+ <div id="#{clientId}_header" class="rf-pp-hdr #{component.attributes['headerClass']}" >
+ <div id="#{clientId}_header_content" class="rf-pp-hdr-cnt">
#{component.attributes['header']}
</div>
</div>
</c:if>
<c:if test="#{component.getFacet('controls')!=null and component.getFacet('controls').rendered}">
- <div id="#{clientId}_header_controls" class="rf-pp-h-cs #{component.attributes['controlsClass']}">
+ <div id="#{clientId}_header_controls" class="rf-pp-hdr-cntrls #{component.attributes['controlsClass']}">
<cdk:call expression="renderControlsFacet(facesContext, component)"/>
</div>
</c:if>
- <div id="#{clientId}_content_scroller" style="#{getStyleIfTrimmed(component)}" class="rf-pp-ct-sr">
- <div id="#{clientId}_content" class="rf-pp-ct" style="#{component.attributes['style']}">
+ <div id="#{clientId}_content_scroller" style="#{getStyleIfTrimmed(component)}" class="rf-pp-cnt-scrlr">
+ <div id="#{clientId}_content" class="rf-pp-cnt" style="#{component.attributes['style']}">
<cdk:call expression="renderChildren(facesContext, component)"/>
</div>
</div>
<c:if test="#{component.attributes['resizeable']}">
- <div id="#{clientId}ResizerW" class="rf-pp-hr rf-pp-hr-l"></div>
- <div id="#{clientId}ResizerE" class="rf-pp-hr rf-pp-hr-r"></div>
- <div id="#{clientId}ResizerN" class="rf-pp-hr rf-pp-hr-t"></div>
+ <div id="#{clientId}ResizerW" class="rf-pp-hndlr rf-pp-hndlr-l"></div>
+ <div id="#{clientId}ResizerE" class="rf-pp-hndlr rf-pp-hndlr-r"></div>
+ <div id="#{clientId}ResizerN" class="rf-pp-hndlr rf-pp-hndlr-t"></div>
- <div id="#{clientId}ResizerS" class="rf-pp-hr rf-pp-hr-b"></div>
- <div id="#{clientId}ResizerNW" class="rf-pp-hr rf-pp-hr-tl"></div>
- <div id="#{clientId}ResizerNE" class="rf-pp-hr rf-pp-hr-tr"></div>
- <div id="#{clientId}ResizerSW" class="rf-pp-hr rf-pp-hr-bl"></div>
- <div id="#{clientId}ResizerSE" class="rf-pp-hr rf-pp-hr-br"></div>
+ <div id="#{clientId}ResizerS" class="rf-pp-hndlr rf-pp-hndlr-b"></div>
+ <div id="#{clientId}ResizerNW" class="rf-pp-hndlr rf-pp-hndlr-tl"></div>
+ <div id="#{clientId}ResizerNE" class="rf-pp-hndlr rf-pp-hndlr-tr"></div>
+ <div id="#{clientId}ResizerSW" class="rf-pp-hndlr rf-pp-hndlr-bl"></div>
+ <div id="#{clientId}ResizerSE" class="rf-pp-hndlr rf-pp-hndlr-br"></div>
</c:if>
</div>
Copied: branches/RF-7817/ui/output/ui/src/main/templates/progressBar.template.xml (from rev 19674, trunk/ui/output/ui/src/main/templates/progressBar.template.xml)
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/templates/progressBar.template.xml (rev 0)
+++ branches/RF-7817/ui/output/ui/src/main/templates/progressBar.template.xml 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,81 @@
+<?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.ProgressBarRenderer</cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.html.ProgressBarBaseRenderer</cdk:superclass>
+ <cdk:component-family>org.richfaces.ProgressBarRenderer</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.ProgressBarRenderer</cdk:renderer-type>
+ </cc:interface>
+
+ <cc:implementation>
+ <c:choose>
+ <c:when test="#{isAjaxMode(component)}">
+ <cdk:object type="java.lang.String" name="state" value="#{getCurrentOrForcedState(facesContext, component)}" />
+
+ <c:if test="#{state eq 'initialState'}">
+ <div id="#{clientId}" class="#{component.attributes['initialClass']}" style="#{component.attributes['style']}">
+ <cdk:call expression="renderInitialFacet(facesContext, component)"/>
+ </div>
+ </c:if>
+ <c:if test="#{state eq 'completeState'}">
+ <div id="#{clientId}" class="#{component.attributes['finishClass']}" style="#{component.attributes['style']}">
+ <cdk:call expression="renderCompleteFacet(facesContext, component)"/>
+ </div>
+ </c:if>
+ <c:if test="#{state eq 'progressState'}">
+ <cdk:object type="java.lang.String" name="shellStyle" value="#{getShellStyle(facesContext, component)}" />
+ <div cdk:passThroughWithExclusions="onclick, ondblclick, onmouseup, onmousedown, onmousemove, onmouseover, onmouseout" id="#{clientId}" class="rf-pb-cnt #{shellStyle} #{component.attributes['styleClass']}" style="#{component.attributes['style']}">
+ <c:if test="#{!isSimpleMarkup(component)}">
+ <div class="rf-pb-rmnd #{component.attributes['remainClass']}" id="#{clientId}:remain" style="#{component.attributes['style']}"/>
+ <div class="rf-pb-upl-dig" id="#{clientId}:upload" style="#{component.attributes['style']}; width:#{getWidth(component)}%;">
+ <div class="rf-pb-cmpltd #{component.attributes['completeClass']}" id="#{clientId}:complete" style="#{component.attributes['style']}"/>
+ </div>
+ </c:if>
+ <c:if test="#{isSimpleMarkup(component)}">
+ <div class="rf-pb-upl #{component.attributes['completeClass']}" id="#{clientId}:upload" style="#{component.attributes['style']}; width:#{getWidth(component)}%;"/>
+ </c:if>
+ <script type="text/javascript">
+ #{getInitialScript(facesContext, component, 'progressState')}
+ #{getPollScript(facesContext, component)}
+ </script>
+
+ </div>
+ </c:if>
+ </c:when>
+ <c:otherwise>
+ <div id="#{clientId}" >
+ <div id="#{clientId}:initialState" class="#{component.attributes['initialClass']}" style="#{component.attributes['style']} display:none;">
+ <cdk:call expression="renderInitialFacet(facesContext, component)"/>
+ </div>
+ <cdk:object type="java.lang.String" name="shellStyle" value="#{getShellStyle(facesContext, component)}" />
+ <div cdk:passThroughWithExclusions="onclick, ondblclick, onmouseup, onmousedown, onmousemove, onmouseover, onmouseout" id="#{clientId}:progressState" class="rf-pb-cnt #{shellStyle} #{component.attributes['styleClass']}" style="#{component.attributes['style']} display:none;">
+ <c:if test="#{!isSimpleMarkup(component)}">
+ <div class="rf-pb-rmnd #{component.attributes['remainClass']}" id="#{clientId}:remain" style="#{component.attributes['style']}"/>
+ <div class="rf-pb-upl-dig" id="#{clientId}:upload" style="#{component.attributes['style']}; width=#{getWidth(component)}%;">
+ <div class="rf-pb-cmpltd #{component.attributes['completeClass']}" id="#{clientId}:complete" style="#{component.attributes['style']}"/>
+ </div>
+ </c:if>
+ <c:if test="#{isSimpleMarkup(component)}">
+ <div class="rf-pb-upl #{component.attributes['completeClass']}" id="#{clientId}:upload" style="#{component.attributes['style']}; width=#{getWidth(component)}%;"/>
+ </c:if>
+ </div>
+ <div id="#{clientId}:completeState" class="#{component.attributes['finishClass']}" style="#{component.attributes['style']} display:none;">
+ <cdk:call expression="renderCompleteFacet(facesContext, component)"/>
+ </div>
+ <cdk:object type="java.lang.String" name="state" value="#{getCurrentState(facesContext, component)}" />
+ <script type="text/javascript">
+ #{getInitialScript(facesContext, component, state)}
+ #{getRenderStateScript(facesContext, component, state)}
+ </script>
+ </div>
+
+ </c:otherwise>
+ </c:choose>
+ </cc:implementation>
+</cdk:root>
\ No newline at end of file
Copied: branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/component/UICollapsiblePanelTest.java (from rev 19674, trunk/ui/output/ui/src/test/java/org/richfaces/component/UICollapsiblePanelTest.java)
===================================================================
--- branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/component/UICollapsiblePanelTest.java (rev 0)
+++ branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/component/UICollapsiblePanelTest.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,50 @@
+/*
+ * 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 org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.faces.component.UIComponent;
+import java.util.List;
+
+/**
+ * @author akolonitsky
+ * @since 2010-08-27
+ */
+public class UICollapsiblePanelTest {
+
+ private UICollapsiblePanel collapsiblePanel;
+
+ @Before
+ public void setUp () {
+ collapsiblePanel = new UICollapsiblePanel();
+ }
+
+ @Test
+ public void testSomething() {
+ Assert.assertNotNull(collapsiblePanel);
+ }
+}
+
Copied: branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/component/UITogglePanelTitledItemTest.java (from rev 19674, trunk/ui/output/ui/src/test/java/org/richfaces/component/UITogglePanelTitledItemTest.java)
===================================================================
--- branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/component/UITogglePanelTitledItemTest.java (rev 0)
+++ branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/component/UITogglePanelTitledItemTest.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,50 @@
+/*
+ * 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 org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.faces.component.UIComponent;
+import java.util.List;
+
+/**
+ * @author akolonitsky
+ * @since 2010-08-24
+ */
+public class UITogglePanelTitledItemTest {
+
+ private UITogglePanelTitledItem togglePanelTitledItem;
+
+ @Before
+ public void setUp () {
+ togglePanelTitledItem = new UITogglePanelTitledItem();
+ }
+
+ @Test
+ public void testSomething() {
+ Assert.assertNotNull(togglePanelTitledItem);
+ }
+}
+
Copied: branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/IgnoreScriptsContent.java (from rev 19674, trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/IgnoreScriptsContent.java)
===================================================================
--- branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/IgnoreScriptsContent.java (rev 0)
+++ branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/IgnoreScriptsContent.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,60 @@
+/**
+ * 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;
+
+import org.custommonkey.xmlunit.Difference;
+import org.custommonkey.xmlunit.DifferenceConstants;
+import org.custommonkey.xmlunit.DifferenceListener;
+import org.custommonkey.xmlunit.IgnoreTextAndAttributeValuesDifferenceListener;
+import org.w3c.dom.Node;
+
+import java.util.Arrays;
+
+/**
+ * @author akolonitsky
+ * @since Oct 22, 2010
+ */
+public class IgnoreScriptsContent implements DifferenceListener {
+ private static final int[] IGNORE = new int[] {
+ DifferenceConstants.HAS_DOCTYPE_DECLARATION_ID,
+ DifferenceConstants.DOCTYPE_NAME_ID,
+ DifferenceConstants.DOCTYPE_PUBLIC_ID_ID,
+ DifferenceConstants.DOCTYPE_SYSTEM_ID_ID
+ };
+
+ static {
+ Arrays.sort(IGNORE);
+ }
+
+ public int differenceFound(Difference difference) {
+ if (DifferenceConstants.TEXT_VALUE_ID == difference.getId()
+ && !"script".equalsIgnoreCase(difference.getTestNodeDetail().getNode().getLocalName())) {
+
+ return RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR;
+ }
+ return RETURN_ACCEPT_DIFFERENCE;
+ }
+
+ public void skippedComparison(Node node, Node node1) {
+
+ }
+}
Copied: branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuRendererTest.java (from rev 19674, trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuRendererTest.java)
===================================================================
--- branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuRendererTest.java (rev 0)
+++ branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuRendererTest.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,47 @@
+/*
+ * 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.html;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.xml.sax.SAXException;
+
+import java.io.IOException;
+
+ /**
+ * @author akolonitsky
+ * @since 2010-10-25
+ */
+public class PanelMenuRendererTest extends RendererTestBase {
+
+ @Test
+ @Ignore
+ public void testDoEncode() throws IOException, SAXException {
+ doTest("panelMenu", "panelMenu");
+ }
+
+}
+
+
+
Modified: branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java
===================================================================
--- branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -130,7 +130,7 @@
assertNotNull(nestedPanelContainer.getElementById("nestedPanelContainer_header"));
assertEquals("||||", nestedPanelContainer.getElementById("nestedPanelContainer_header").getTextContent().trim());
HtmlElement nestedPanelContainerHeader = page.getElementById("nestedPanelContainer_header");
- assertEquals("rf-p-hr outpanelHeader", nestedPanelContainerHeader.getAttribute("class"));
+ assertEquals("rf-p-hdr outpanelHeader", nestedPanelContainerHeader.getAttribute("class"));
assertEquals("Benefits of Usin", nestedPanelContainer
.getElementById("nestedPanelContainer_body")
.getTextContent().trim().substring(0, 16));
Modified: branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java
===================================================================
--- branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -89,30 +89,30 @@
assertNotNull(panelWithFacet);
assertEquals("visibility: hidden;", panelWithFacet.getAttribute("style"));
HtmlElement panelShade = panelWithFacet.getElementById("panel_shade");
- assertEquals("rf-pp-sh", panelShade.getAttribute("class"));
+ assertEquals("rf-pp-shade", panelShade.getAttribute("class"));
assertNotNull(panelShade);
HtmlElement panelShadow = panelWithFacet.getElementById("panel_shadow");
- assertEquals("rf-pp-shw", panelShadow.getAttribute("class"));
+ assertEquals("rf-pp-shdw", panelShadow.getAttribute("class"));
assertNotNull(panelShadow);
HtmlElement panelContainer = panelWithFacet.getElementById("panel_container");
assertNotNull(panelContainer);
- assertEquals("rf-pp-cr panelStyle", panelContainer.getAttribute("class"));
+ assertEquals("rf-pp-cntr panelStyle", panelContainer.getAttribute("class"));
HtmlElement panelScroller = panelWithFacet.getElementById("panel_content_scroller");
assertNotNull(panelScroller);
- assertEquals("rf-pp-ct-sr", panelScroller.getAttribute("class"));
+ assertEquals("rf-pp-cnt-scrlr", panelScroller.getAttribute("class"));
HtmlElement panelContent = panelWithFacet.getElementById("panel_content");
assertNotNull(panelContent);
- assertEquals("rf-pp-ct", panelContent.getAttribute("class"));
+ assertEquals("rf-pp-cnt", panelContent.getAttribute("class"));
assertEquals("The CDK includes", panelContent
.getTextContent().trim().substring(0, 16));
HtmlElement panelHeader = panelWithFacet.getElementById("panel_header");
assertNotNull(panelHeader);
- assertEquals("rf-pp-h header", panelHeader.getAttribute("class"));
+ assertEquals("rf-pp-hdr header", panelHeader.getAttribute("class"));
//assertEquals("cursor: move;", panelHeader.getAttribute("style"));
assertEquals("Write your own custom rich components with built-in AJAX", panelHeader.getTextContent().trim());
HtmlElement panelResizer = panelWithFacet.getElementById("panelResizerN");
assertNotNull(panelResizer);
- assertEquals("rf-pp-hr rf-pp-hr-t", panelResizer.getAttribute("class"));
+ assertEquals("rf-pp-hndlr rf-pp-hndlr-t", panelResizer.getAttribute("class"));
assertEquals("cursor: N-resize;", panelResizer.getAttribute("style"));
List<HtmlElement> result = page.getElementsByName("script");
HtmlElement button = panelWithFacet.getElementById("button");
Copied: branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java (from rev 19674, trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java)
===================================================================
--- branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java (rev 0)
+++ branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,92 @@
+/**
+ * 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;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.XMLUnit;
+import org.jboss.test.faces.htmlunit.HtmlUnitEnvironment;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.xml.sax.SAXException;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.net.URISyntaxException;
+
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * @author akolonitsky
+ * @since Oct 22, 2010
+ */
+public abstract class RendererTestBase {
+
+ static {
+ XMLUnit.setNormalizeWhitespace(true);
+ XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true);
+ XMLUnit.setIgnoreWhitespace(true);
+ XMLUnit.setIgnoreComments(true);
+
+ }
+
+ protected HtmlUnitEnvironment environment;
+
+ @Before
+ public void setUp() throws URISyntaxException {
+ environment = new HtmlUnitEnvironment();
+ environment.withWebRoot(new File(this.getClass().getResource(".").toURI()));
+ environment.start();
+ }
+
+ @After
+ public void tearDown() {
+ environment.release();
+ environment = null;
+ }
+
+ protected void doTest(String pageName, String pageElementToTest) throws IOException, SAXException {
+ HtmlPage page = environment.getPage('/' + pageName + ".jsf");
+ HtmlElement panel = page.getElementById(pageElementToTest);
+ assertNotNull(panel);
+
+ checkXmlStructure(pageName, panel.asXml());
+ }
+
+ protected void checkXmlStructure(String pageName, String pageCode) throws SAXException, IOException {
+ InputStream expectedPageCode = this.getClass().getResourceAsStream(pageName + ".xmlunit.xml");
+ if (expectedPageCode == null) {
+ return;
+ }
+
+ Diff xmlDiff = new Diff(new StringReader(pageCode), new InputStreamReader(expectedPageCode));
+ xmlDiff.overrideDifferenceListener(new IgnoreScriptsContent());
+ Assert.assertTrue("XML was not similar:" + xmlDiff.toString(), xmlDiff.similar());
+ }
+
+}
+
Copied: branches/RF-7817/ui/output/ui/src/test/resources/org (from rev 19674, trunk/ui/output/ui/src/test/resources/org)
Copied: branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces (from rev 19674, trunk/ui/output/ui/src/test/resources/org/richfaces)
Copied: branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit (from rev 19674, trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit)
Copied: branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html (from rev 19674, trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html)
Deleted: branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml 2010-10-26 17:10:27 UTC (rev 19674)
+++ branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml 2010-10-27 15:07:36 UTC (rev 19690)
@@ -1,47 +0,0 @@
-<?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.
--->
-
-
-<!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:fn="http://java.sun.com/jsp/jstl/functions"
- 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:pn="http://richfaces.org/output"
- xmlns:rich="http://richfaces.org/rich">
-
- <h:head>
- <title>Richfaces PanelMenu Test</title>
- </h:head>
-
-<h:body>
- <h:form id="f" style="border:blue solid thin;">
- <pn:panelMenu id="panelMenu">
- <!-- TODO -->
- </pn:panelMenu>
- </h:form>
-</h:body>
-</html>
-
-
Copied: branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml (from rev 19674, trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml)
===================================================================
--- branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml (rev 0)
+++ branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,47 @@
+<?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.
+-->
+
+
+<!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:fn="http://java.sun.com/jsp/jstl/functions"
+ 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:pn="http://richfaces.org/output"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <h:head>
+ <title>Richfaces PanelMenu Test</title>
+ </h:head>
+
+<h:body>
+ <h:form id="f" style="border:blue solid thin;">
+ <pn:panelMenu id="panelMenu">
+ <!-- TODO -->
+ </pn:panelMenu>
+ </h:form>
+</h:body>
+</html>
+
+
Deleted: branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml 2010-10-26 17:10:27 UTC (rev 19674)
+++ branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml 2010-10-27 15:07:36 UTC (rev 19690)
@@ -1,5 +0,0 @@
-<div id="panelMenu" class="rf-panelMenu">
- <script type="text/javascript">
- // Text between <script> ... </script> don't compared
- </script>
-</div>
Copied: branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml (from rev 19674, trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml)
===================================================================
--- branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml (rev 0)
+++ branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml 2010-10-27 15:07:36 UTC (rev 19690)
@@ -0,0 +1,5 @@
+<div id="panelMenu" class="rf-panelMenu">
+ <script type="text/javascript">
+ // Text between <script> ... </script> don't compared
+ </script>
+</div>
15 years, 6 months
JBoss Rich Faces SVN: r19689 - in branches/RF-7817/ui/misc/ui: src/main/java/org/richfaces/renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-10-27 11:01:04 -0400 (Wed, 27 Oct 2010)
New Revision: 19689
Modified:
branches/RF-7817/ui/misc/ui/pom.xml
branches/RF-7817/ui/misc/ui/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java
branches/RF-7817/ui/misc/ui/src/main/templates/jquery.template.xml
Log:
Merged revisions 19156-19157,19159-19160,19176,19186-19187,19190,19194,19196,19199,19203-19204,19231-19234,19248-19249,19255-19256,19258-19262,19276,19279-19281,19283,19285,19291-19299,19307,19312,19315,19318-19319,19325,19341-19342,19345-19351,19353-19355,19358-19359,19364,19367-19369,19371,19374-19377,19379-19385,19387,19393-19394,19400,19402-19404,19418-19422,19426,19430-19431,19434-19441,19443-19444,19446,19468,19470,19477,19491,19498-19499,19501,19504,19506-19507,19517-19519,19525,19542-19543,19548,19550,19555,19557,19560-19561,19565-19566,19571-19573,19582-19585,19592-19593,19599,19601-19602,19613,19646,19657-19659,19665,19671-19674 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
Modified: branches/RF-7817/ui/misc/ui/pom.xml
===================================================================
--- branches/RF-7817/ui/misc/ui/pom.xml 2010-10-27 14:59:44 UTC (rev 19688)
+++ branches/RF-7817/ui/misc/ui/pom.xml 2010-10-27 15:01:04 UTC (rev 19689)
@@ -40,6 +40,9 @@
<groupId>org.richfaces.cdk</groupId>
<artifactId>maven-cdk-plugin</artifactId>
</plugin>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
</plugins>
</build>
Modified: branches/RF-7817/ui/misc/ui/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java
===================================================================
--- branches/RF-7817/ui/misc/ui/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java 2010-10-27 14:59:44 UTC (rev 19688)
+++ branches/RF-7817/ui/misc/ui/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java 2010-10-27 15:01:04 UTC (rev 19689)
@@ -22,21 +22,13 @@
package org.richfaces.renderkit;
-import java.util.HashMap;
-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 javax.faces.render.Renderer;
-import org.ajax4jsf.javascript.ScriptUtils;
-import org.richfaces.component.AbstractJQuery;
-import org.richfaces.component.JQueryAttachType;
-import org.richfaces.component.JQueryTiming;
import org.richfaces.component.util.HtmlUtil;
-import org.richfaces.renderkit.util.RendererUtils;
/**
* @author nick
@@ -48,8 +40,6 @@
})
public abstract class JQueryRendererBase extends Renderer {
- private RendererUtils rendererUtils = RendererUtils.getInstance();
-
protected String getEscapedSelector(FacesContext context, UIComponent component) {
String selector = (String) component.getAttributes().get("selector");
@@ -60,17 +50,4 @@
return selector;
}
- protected String getOptionsAsJavascriptString(FacesContext context, UIComponent component) {
- AbstractJQuery jQuery = (AbstractJQuery) component;
-
- Map<String,Object> map = new HashMap<String, Object>();
-
- rendererUtils.addToScriptHash(map, "selector", getEscapedSelector(context, jQuery));
- rendererUtils.addToScriptHash(map, "event", jQuery.getEvent());
- rendererUtils.addToScriptHash(map, "query", jQuery.getQuery());
- rendererUtils.addToScriptHash(map, "attachType", jQuery.getAttachType(), JQueryAttachType.DEFAULT.toString());
- rendererUtils.addToScriptHash(map, "timing", jQuery.getTiming(), JQueryTiming.DEFAULT.toString());
-
- return ScriptUtils.toScript(map);
- }
}
Modified: branches/RF-7817/ui/misc/ui/src/main/templates/jquery.template.xml
===================================================================
--- branches/RF-7817/ui/misc/ui/src/main/templates/jquery.template.xml 2010-10-27 14:59:44 UTC (rev 19688)
+++ branches/RF-7817/ui/misc/ui/src/main/templates/jquery.template.xml 2010-10-27 15:01:04 UTC (rev 19689)
@@ -10,20 +10,28 @@
<cdk:component-family>org.richfaces.JQuery</cdk:component-family>
<cdk:renderer-type>org.richfaces.JQueryRenderer</cdk:renderer-type>
<cdk:renders-children>true</cdk:renders-children>
+
+ <cdk:import package="org.richfaces.component" names="JQueryAttachType JQueryTiming" />
</cc:interface>
<cc:implementation>
<span id="#{clientId}" style="display: none;">
<script type="text/javascript">
<cdk:object name="functionName" value="#{component.attributes['name']}" />
- <cdk:object name="options" value="#{getOptionsAsJavascriptString(facesContext, component)}" />
+
+ <cdk:scriptObject name="options">
+ <cdk:scriptOption name="selector" value="#{getEscapedSelector(facesContext, component)}" />
+ <cdk:scriptOption attributes="event query" />
+ <cdk:scriptOption name="attachType" value="#{component.attributes['attachType']}" defaultValue="JQueryAttachType.DEFAULT" />
+ <cdk:scriptOption name="timing" value="#{component.attributes['timing']}" defaultValue="JQueryTiming.DEFAULT" />
+ </cdk:scriptObject>
<c:choose>
<c:when test="#{not empty functionName}">
- #{functionName} = RichFaces.jQuery.createFunction(#{options});
+ #{functionName} = RichFaces.jQuery.createFunction(#{toScriptArgs(options)});
</c:when>
<c:otherwise>
- RichFaces.jQuery.query(#{options});
+ RichFaces.jQuery.query(#{toScriptArgs(options)});
</c:otherwise>
</c:choose>
</script>
15 years, 6 months
JBoss Rich Faces SVN: r19688 - branches/RF-7817/ui/parent.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-10-27 10:59:44 -0400 (Wed, 27 Oct 2010)
New Revision: 19688
Modified:
branches/RF-7817/ui/parent/pom.xml
Log:
Merged revisions 19156-19157,19159-19160,19176,19186-19187,19190,19194,19196,19199,19203-19204,19231-19234,19248-19249,19255-19256,19258-19262,19276,19279-19281,19283,19285,19291-19299,19307,19312,19315,19318-19319,19325,19341-19342,19345-19351,19353-19355,19358-19359,19364,19367-19369,19371,19374-19377,19379-19385,19387,19393-19394,19400,19402-19404,19418-19422,19426,19430-19431,19434-19441,19443-19444,19446,19468,19470,19477,19491,19498-19499,19501,19504,19506-19507,19517-19519,19525,19542-19543,19548,19550,19555,19557,19560-19561,19565-19566,19571-19573,19582-19585,19592-19593,19599,19601-19602,19613,19646,19657-19659,19665,19671-19674 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
Modified: branches/RF-7817/ui/parent/pom.xml
===================================================================
--- branches/RF-7817/ui/parent/pom.xml 2010-10-27 14:47:25 UTC (rev 19687)
+++ branches/RF-7817/ui/parent/pom.xml 2010-10-27 14:59:44 UTC (rev 19688)
@@ -71,9 +71,6 @@
<plugins>
<!-- Trigger checkstyle checking for this module -->
<plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.0-beta-1</version>
15 years, 6 months
JBoss Rich Faces SVN: r19687 - in branches/RF-7817/ui/iteration: ui and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-10-27 10:47:25 -0400 (Wed, 27 Oct 2010)
New Revision: 19687
Modified:
branches/RF-7817/ui/iteration/api/pom.xml
branches/RF-7817/ui/iteration/ui/pom.xml
branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataGridRenderer.java
branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java
branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ListRendererBase.java
branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java
branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.ecss
branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.js
branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datatable.ecss
branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.ecss
branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.js
branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/list.ecss
branches/RF-7817/ui/iteration/ui/src/main/templates/datascroller.template.xml
branches/RF-7817/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java
branches/RF-7817/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ExtendedDataTableRendererTest.java
branches/RF-7817/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ListRendererTest.java
Log:
Merged revisions 19156-19157,19159-19160,19176,19186-19187,19190,19194,19196,19199,19203-19204,19231-19234,19248-19249,19255-19256,19258-19262,19276,19279-19281,19283,19285,19291-19299,19307,19312,19315,19318-19319,19325,19341-19342,19345-19351,19353-19355,19358-19359,19364,19367-19369,19371,19374-19377,19379-19385,19387,19393-19394,19400,19402-19404,19418-19422,19426,19430-19431,19434-19441,19443-19444,19446,19468,19470,19477,19491,19498-19499,19501,19504,19506-19507,19517-19519,19525,19542-19543,19548,19550,19555,19557,19560-19561,19565-19566,19571-19573,19582-19585,19592-19593,19599,19601-19602,19613,19646,19657-19659,19665,19671-19674 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
Modified: branches/RF-7817/ui/iteration/api/pom.xml
===================================================================
--- branches/RF-7817/ui/iteration/api/pom.xml 2010-10-27 14:34:46 UTC (rev 19686)
+++ branches/RF-7817/ui/iteration/api/pom.xml 2010-10-27 14:47:25 UTC (rev 19687)
@@ -34,6 +34,14 @@
<name>Richfaces UI Components: Iteration API</name>
<packaging>jar</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
<dependencies>
<dependency>
<groupId>org.richfaces.ui.core</groupId>
Modified: branches/RF-7817/ui/iteration/ui/pom.xml
===================================================================
--- branches/RF-7817/ui/iteration/ui/pom.xml 2010-10-27 14:34:46 UTC (rev 19686)
+++ branches/RF-7817/ui/iteration/ui/pom.xml 2010-10-27 14:47:25 UTC (rev 19687)
@@ -53,9 +53,12 @@
<groupId>org.richfaces.cdk</groupId>
<artifactId>maven-cdk-plugin</artifactId>
</plugin>
- </plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
</build>
-
+
<scm>
<connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/iteration/datas...</connection>
<developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/iteration/datascro...</developerConnection>
Modified: branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataGridRenderer.java
===================================================================
--- branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataGridRenderer.java 2010-10-27 14:34:46 UTC (rev 19686)
+++ branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataGridRenderer.java 2010-10-27 14:47:25 UTC (rev 19687)
@@ -54,16 +54,13 @@
public void begin(ResponseWriter writer, FacesContext context, UIComponent component, Object[] params)
throws IOException {
- AbstractDataGrid dataGrid = (AbstractDataGrid)component;
- String clientId = dataGrid.getClientId(context) + ":h";
+ String clientId = component.getClientId(context) + ":h";
boolean partial = (Boolean)(Boolean)params[0];
if(partial) {
context.getPartialViewContext().getPartialResponseWriter().startUpdate(clientId);
}
- int columns = dataGrid.getColumns();
-
writer.startElement(HtmlConstants.THEAD_ELEMENT, component);
writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, clientId , null);
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-thead", null);
@@ -71,7 +68,11 @@
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-h", null);
writer.startElement(HtmlConstants.TH_ELEM, component);
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-h-c", null);
- writer.writeAttribute(HtmlConstants.COLSPAN_ATTRIBUTE, columns, null);
+
+ int columns = (Integer)component.getAttributes().get("columns");
+ if(columns != Integer.MIN_VALUE) {
+ writer.writeAttribute(HtmlConstants.COLSPAN_ATTRIBUTE, columns, null);
+ }
}
public void end(ResponseWriter writer, FacesContext context, UIComponent component, Object[] params)
@@ -92,10 +93,8 @@
public void begin(ResponseWriter writer, FacesContext context, UIComponent component, Object[] params)
throws IOException {
- AbstractDataGrid dataGrid = (AbstractDataGrid)component;
- String clientId = dataGrid.getClientId(context) + ":f";
-
- int columns = dataGrid.getColumns();
+ String clientId = component.getClientId(context) + ":f";
+
boolean partial = (Boolean)(Boolean)params[0];
if(partial) {
context.getPartialViewContext().getPartialResponseWriter().startUpdate(clientId);
@@ -108,7 +107,11 @@
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-f", null);
writer.startElement(HtmlConstants.TD_ELEM, component);
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-f-c", null);
- writer.writeAttribute(HtmlConstants.COLSPAN_ATTRIBUTE, columns, null);
+
+ int columns = (Integer)component.getAttributes().get("columns");
+ if(columns != Integer.MIN_VALUE) {
+ writer.writeAttribute(HtmlConstants.COLSPAN_ATTRIBUTE, columns, null);
+ }
}
public void end(ResponseWriter writer, FacesContext context, UIComponent component, Object[] params)
@@ -144,6 +147,11 @@
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-nd", null);
writer.startElement(HtmlConstants.TD_ELEM, component);
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-nd-c", null);
+
+ int columns = (Integer)component.getAttributes().get("columns");
+ if(columns != Integer.MIN_VALUE) {
+ writer.writeAttribute(HtmlConstants.COLSPAN_ATTRIBUTE, columns, null);
+ }
}
public void end(ResponseWriter writer, FacesContext context, UIComponent component, Object[] params)
@@ -165,10 +173,10 @@
if (processCell != 0) {
writer.endElement(HtmlConstants.TR_ELEMENT);
rowHolder.resetProcessCell();
- rowHolder.nextRow();
}
writer.startElement(HtmlConstants.TR_ELEMENT, dataGrid);
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-r", null);
+ rowHolder.nextRow();
}
writer.startElement(HtmlConstants.TD_ELEM, dataGrid);
@@ -283,10 +291,8 @@
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-c", null);
writer.endElement(HtmlConstants.TD_ELEM);
}
+ writer.endElement(HtmlConstants.TR_ELEMENT);
}
-
- writer.endElement(HtmlConstants.TR_ELEMENT);
-
}
public DataVisitResult process(FacesContext facesContext, Object rowKey, Object argument) {
Modified: branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java
===================================================================
--- branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java 2010-10-27 14:34:46 UTC (rev 19686)
+++ branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java 2010-10-27 14:47:25 UTC (rev 19687)
@@ -217,10 +217,10 @@
if (isCurrentPage) {
out.startElement(HtmlConstants.SPAN_ELEM, component);
- out.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-ds-dtl rf-ds-cur " + styleClass, null);
+ out.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-ds-nmb-btn rf-ds-act " + styleClass, null);
} else {
out.startElement(HtmlConstants.A_ELEMENT, component);
- out.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-ds-dtl " + styleClass, null);
+ out.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-ds-nmb-btn " + styleClass, null);
out.writeAttribute(HtmlConstants.HREF_ATTR, "javascript:void(0);", null);
}
Modified: branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
===================================================================
--- branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-10-27 14:34:46 UTC (rev 19686)
+++ branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-10-27 14:47:25 UTC (rev 19687)
@@ -322,7 +322,7 @@
}
public String getFirstRowSkinClass() {
- return "rf-dt-f-r";
+ return "rf-dt-fst-r";
}
public String getCellSkinClass() {
@@ -330,55 +330,55 @@
}
public String getHeaderSkinClass() {
- return "rf-dt-h";
+ return "rf-dt-hdr";
}
public String getHeaderFirstSkinClass() {
- return "rf-dt-h-f";
+ return "rf-dt-hdr-fst";
}
public String getHeaderCellSkinClass() {
- return "rf-dt-h-c";
+ return "rf-dt-hdr-c";
}
public String getColumnHeaderSkinClass() {
- return "rf-dt-sh";
+ return "rf-dt-shdr";
}
public String getColumnHeaderFirstSkinClass() {
- return "rf-dt-sh-f";
+ return "rf-dt-shdr-fst";
}
public String getColumnHeaderCellSkinClass() {
- return "rf-dt-sh-c";
+ return "rf-dt-shdr-c";
}
public String getColumnFooterSkinClass() {
- return "rf-dt-sf";
+ return "rf-dt-sftr";
}
public String getColumnFooterFirstSkinClass() {
- return "rf-dt-sf-f";
+ return "rf-dt-sftr-fst";
}
public String getColumnFooterCellSkinClass() {
- return "rf-dt-sf-c";
+ return "rf-dt-sftr-c";
}
public String getFooterSkinClass() {
- return "rf-dt-f";
+ return "rf-dt-ftr";
}
public String getFooterFirstSkinClass() {
- return "rf-dt-f-f";
+ return "rf-dt-ftr-fst";
}
public String getFooterCellSkinClass() {
- return "rf-dt-f-c";
+ return "rf-dt-ftr-c";
}
public String getNoDataClass() {
- return "rf-dt-nd-c";
+ return "rf-dt-ndt";
}
protected void setupTableStartElement(FacesContext context, UIComponent component) {
Modified: branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
===================================================================
--- branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-10-27 14:34:46 UTC (rev 19686)
+++ branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-10-27 14:47:25 UTC (rev 19687)
@@ -21,6 +21,8 @@
*/
package org.richfaces.renderkit;
+import static org.richfaces.renderkit.RenderKitUtils.addToScriptHash;
+import static org.richfaces.renderkit.RenderKitUtils.renderAttribute;
import static org.richfaces.renderkit.util.AjaxRendererUtils.AJAX_FUNCTION_NAME;
import static org.richfaces.renderkit.util.AjaxRendererUtils.buildAjaxFunction;
import static org.richfaces.renderkit.util.AjaxRendererUtils.buildEventOptions;
@@ -56,8 +58,7 @@
import org.richfaces.component.util.HtmlUtil;
import org.richfaces.context.OnOffResponseWriter;
import org.richfaces.model.SelectionMode;
-import org.richfaces.renderkit.util.RendererUtils;
-import org.richfaces.renderkit.util.RendererUtils.ScriptHashVariableWrapper;
+import org.richfaces.renderkit.RenderKitUtils.ScriptHashVariableWrapper;
/**
* @author Konstantin Mishin
@@ -221,7 +222,7 @@
if (column.isRendered()) {
writer.startElement(HtmlConstants.TD_ELEM, column);
writer.startElement(HtmlConstants.DIV_ELEM, column);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-efc rf-edt-cw-"
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-ftr-c-emp rf-edt-c-"
+ column.getId(), null);
writer.endElement(HtmlConstants.DIV_ELEM);
writer.endElement(HtmlConstants.TD_ELEM);
@@ -236,20 +237,21 @@
writer.startElement(HtmlConstants.TD_ELEM, column);
if ("header".equals(facetName)) {
writer.startElement(HtmlConstants.DIV_ELEM, column);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-rsh rf-edt-cw-"
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-rsz-cntr rf-edt-c-"
+ column.getId(), null);
writer.startElement(HtmlConstants.DIV_ELEM, column);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-rs", null);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-rsz", null);
writer.endElement(HtmlConstants.DIV_ELEM);
writer.endElement(HtmlConstants.DIV_ELEM);
}
writer.startElement(HtmlConstants.DIV_ELEM, column);
- writer
- .writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, HtmlUtil.concatClasses("rf-edt-" + facetName.charAt(0) + "c",
- "rf-edt-cw-" + column.getId(), (String) column.getAttributes().get(classAttribute)),
- null);
+ writer.writeAttribute(
+ HtmlConstants.CLASS_ATTRIBUTE,
+ HtmlUtil.concatClasses("rf-edt-" + facetName.charAt(0) + facetName.charAt(3) + "r-c", "rf-edt-c-"
+ + column.getId(), (String) column.getAttributes().get(classAttribute)), null);
writer.startElement(HtmlConstants.DIV_ELEM, column);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-" + facetName.charAt(0) + "cc", null);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-" + facetName.charAt(0) + facetName.charAt(3)
+ + "r-c-cnt", null);
UIComponent facet = column.getFacet(facetName);
if (facet != null && facet.isRendered()) {
facet.encodeAll(context);
@@ -267,8 +269,8 @@
boolean columnFacetPresent = table.isColumnFacetPresent(name);
if (columnFacetPresent || "footer".equals(name)) {
writer.startElement(HtmlConstants.DIV_ELEM, table);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, HtmlUtil.concatClasses("rf-edt-" + name.charAt(0),
- (String) table.getAttributes().get(name + "Class")), null);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, HtmlUtil.concatClasses("rf-edt-" + name.charAt(0)
+ + name.charAt(3) + "r", (String) table.getAttributes().get(name + "Class")), null);
writer.startElement(HtmlConstants.TABLE_ELEMENT, table);
writer.writeAttribute(HtmlConstants.CELLPADDING_ATTRIBUTE, "0", null);
writer.writeAttribute(HtmlConstants.CELLSPACING_ATTRIBUTE, "0", null);
@@ -281,7 +283,7 @@
if (columns.hasNext()) {
writer.startElement(HtmlConstants.TD_ELEM, table);
if (PartName.frozen.equals(partName) && "footer".equals(name)) {
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-fa", null);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-ftr-fzn", null);
}
writer.startElement(HtmlConstants.DIV_ELEM, table);
if (PartName.frozen.equals(partName)) {
@@ -291,8 +293,8 @@
}
} else {
writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, table.getClientId(context) + ":" + name, null);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-"
- + ("footer".equals(name) ? "f" : "") + "p rf-edt-pw", null);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-cnt"
+ + ("footer".equals(name) ? " rf-edt-ftr-cnt" : ""), null);
}
String tableId = table.getClientId(context) + ":cf" + name.charAt(0) + partName.name().charAt(0);
@@ -343,7 +345,7 @@
writer.startElement(HtmlConstants.DIV_ELEM, table);
writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, elementId, null);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-th", null);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-tbl-hdr", null);
header.encodeAll(context);
writer.endElement(HtmlConstants.DIV_ELEM);
@@ -377,7 +379,7 @@
table.getAttributes().put("clientFirst", 0);
writer.startElement(HtmlConstants.DIV_ELEM, table);
writer.startElement(HtmlConstants.DIV_ELEM, table);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-s", null);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-spcr", null);
writer.endElement(HtmlConstants.DIV_ELEM);
writer.startElement(HtmlConstants.TABLE_ELEMENT, table);
writer.writeAttribute(HtmlConstants.CELLPADDING_ATTRIBUTE, "0", null);
@@ -390,7 +392,7 @@
PartName partName = state.nextPart().getName();
if (PartName.normal.equals(partName)) {
writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, table.getClientId(context) + ":body", null);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-p rf-edt-pw", null);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-cnt", null);
}
String targetId = table.getClientId(context) + ":tbt" + partName.name().charAt(0);
writer.startElement(HtmlConstants.TABLE_ELEMENT, table);
@@ -432,7 +434,7 @@
writer.startElement(HtmlConstants.DIV_ELEM, table);
writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, elementId, null);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-tf", null);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-tbl-ftr", null);
footer.encodeAll(context);
writer.endElement(HtmlConstants.DIV_ELEM);
@@ -580,7 +582,7 @@
writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, component.getClientId(context), null);
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, HtmlUtil.concatClasses("rf-edt",
(String) attributes.get("styleClass")), null);
- getUtils().writeAttribute(writer, HtmlConstants.STYLE_ATTRIBUTE, attributes.get("style"));
+ renderAttribute(context, HtmlConstants.STYLE_ATTRIBUTE, attributes.get("style"));
}
public RendererState createRowHolder(FacesContext context, UIComponent component, Object[] options) {
@@ -605,13 +607,9 @@
protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component)
throws IOException {
- writer.startElement(HtmlConstants.DIV_ELEM, component);
- writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, component.getClientId(context) + ":d", null);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-d", null);
- writer.endElement(HtmlConstants.DIV_ELEM);
writer.startElement(HtmlConstants.TABLE_ELEMENT, component);
writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, component.getClientId(context) + ":r", null);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-ro", null);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-rord", null);
writer.writeAttribute(HtmlConstants.CELLPADDING_ATTRIBUTE, "0", null);
writer.writeAttribute(HtmlConstants.CELLSPACING_ATTRIBUTE, "0", null);
writer.startElement(HtmlConstants.TR_ELEMENT, component);
@@ -628,8 +626,12 @@
}
writer.endElement(HtmlConstants.TABLE_ELEMENT);
writer.startElement(HtmlConstants.DIV_ELEM, component);
+ writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, component.getClientId(context) + ":d", null);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-rsz-mkr", null);
+ writer.endElement(HtmlConstants.DIV_ELEM);
+ writer.startElement(HtmlConstants.DIV_ELEM, component);
writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, component.getClientId(context) + ":rm", null);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-rom", null);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-rord-mkr", null);
writer.endElement(HtmlConstants.DIV_ELEM);
writer.startElement(HtmlConstants.INPUT_ELEM, component);
writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, component.getClientId(context) + ":wi", null);
@@ -644,14 +646,13 @@
ajaxFunction.addParameter(eventOptions);
Map<String, Object> attributes = component.getAttributes();
Map<String, Object> options = new HashMap<String, Object>();
- RendererUtils utils = getUtils();
- utils.addToScriptHash(options, "parameters", parameters);
- utils.addToScriptHash(options, "selectionMode", attributes.get("selectionMode"),
- SelectionMode.multiple.toString());
- utils.addToScriptHash(options, "onbeforeselectionchange", RenderKitUtils.getAttributeAndBehaviorsValue(context,
- component, EVENT_ATTRIBUTES.get("onbeforeselectionchange")), null, ScriptHashVariableWrapper.EVENT_HANDLER);
- utils.addToScriptHash(options, "onselectionchange", RenderKitUtils.getAttributeAndBehaviorsValue(context,
- component, EVENT_ATTRIBUTES.get("onselectionchange")), null, ScriptHashVariableWrapper.EVENT_HANDLER);
+ addToScriptHash(options, "parameters", parameters);
+ addToScriptHash(options, "selectionMode", attributes.get("selectionMode"),
+ SelectionMode.multiple);
+ addToScriptHash(options, "onbeforeselectionchange", RenderKitUtils.getAttributeAndBehaviorsValue(context,
+ component, EVENT_ATTRIBUTES.get("onbeforeselectionchange")), null, ScriptHashVariableWrapper.eventHandler);
+ addToScriptHash(options, "onselectionchange", RenderKitUtils.getAttributeAndBehaviorsValue(context,
+ component, EVENT_ATTRIBUTES.get("onselectionchange")), null, ScriptHashVariableWrapper.eventHandler);
StringBuilder builder = new StringBuilder("new RichFaces.ExtendedDataTable('");
builder.append(component.getClientId(context)).append("', ").append(getRowCount(component))
.append(", function(event, parameters) {").append(ajaxFunction.toScript()).append(";}");
@@ -659,7 +660,7 @@
builder.append(",").append(ScriptUtils.toScript(options));
}
builder.append(");");
- utils.writeScript(context, component, builder.toString());
+ getUtils().writeScript(context, component, builder.toString());
writer.endElement(HtmlConstants.DIV_ELEM);
}
@@ -682,7 +683,7 @@
UIDataTableBase table = state.getRow();
writer.startElement("style", table);
writer.writeAttribute(HtmlConstants.TYPE_ATTR, "text/css", null);
- writer.writeText(".rf-edt-pw {", null); // TODO getNormalizedId(context, state.getGrid())
+ writer.writeText("div.rf-edt-cnt {", null); // TODO getNormalizedId(context, state.getGrid())
writer.writeText("width: 100%;", "width");
writer.writeText("}", null);
Iterator<UIComponent> columns = table.columns();
@@ -694,7 +695,7 @@
id = column.getId();
}
String width = getColumnWidth(column);
- writer.writeText(".rf-edt-cw-" + id + " {", "width"); // TODO getNormalizedId(context,
+ writer.writeText(".rf-edt-c-" + id + " {", "width"); // TODO getNormalizedId(context,
writer.writeText("width: " + width + ";", "width");
writer.writeText("}", "width");
}
@@ -709,19 +710,19 @@
StringBuilder builder = new StringBuilder();
Collection<Object> selection = table.getSelection();
if (selection != null && selection.contains(table.getRowKey())) {
- builder.append("rf-edt-r-s");
+ builder.append("rf-edt-r-sel");
}
if (table.getRowKey().equals(table.getAttributes().get("activeRowKey"))) {
if (builder.length() > 0) {
builder.append(' ');
}
- builder.append("rf-edt-r-a");
+ builder.append("rf-edt-r-act");
}
if (table.getRowKey().equals(table.getAttributes().get("shiftRowKey"))) {
if (builder.length() > 0) {
builder.append(' ');
}
- builder.append("rf-edt-r-t");
+ builder.append("rf-edt-r-sht");
}
if (builder.length() > 0) {
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, builder.toString(), null);
@@ -736,10 +737,10 @@
if (column.isRendered()) {
writer.startElement(HtmlConstants.TD_ELEM, table);
writer.startElement(HtmlConstants.DIV_ELEM, table);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-c rf-edt-cw-"
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-c rf-edt-c-"
+ column.getId(), null);
writer.startElement(HtmlConstants.DIV_ELEM, column);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-cc", null);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-c-cnt", null);
renderChildren(facesContext, column);
writer.endElement(HtmlConstants.DIV_ELEM);
writer.endElement(HtmlConstants.DIV_ELEM);
Modified: branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ListRendererBase.java
===================================================================
--- branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ListRendererBase.java 2010-10-27 14:34:46 UTC (rev 19686)
+++ branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ListRendererBase.java 2010-10-27 14:47:25 UTC (rev 19687)
@@ -96,11 +96,11 @@
writer.startElement(HtmlConstants.LI_ELEMENT, sequence);
if (rendererUtils.hasExplicitId(sequence)) {
- rendererUtils.writeAttribute(writer, HtmlConstants.ID_ATTRIBUTE, sequence.getClientId(context));
+ writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, sequence.getClientId(context), null);
}
- rendererUtils.writeAttribute(writer, HtmlConstants.CLASS_ATTRIBUTE,
- HtmlUtil.concatClasses(helper.getRowClass(), helper.getColumnClass(), itemClass));
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE,
+ HtmlUtil.concatClasses(helper.getRowClass(), helper.getColumnClass(), itemClass), null);
renderHandlers(context, sequence);
rendererUtils.encodeChildren(context, sequence);
writer.endElement(HtmlConstants.LI_ELEMENT);
@@ -129,11 +129,11 @@
writer.startElement(HtmlConstants.DT_ELEMENT, sequence);
if (rendererUtils.hasExplicitId(sequence)) {
- rendererUtils.writeAttribute(writer, HtmlConstants.ID_ATTRIBUTE, sequence.getClientId(context) + ".dt");
+ writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, sequence.getClientId(context) + ".dt", null);
}
- rendererUtils.writeAttribute(writer, HtmlConstants.CLASS_ATTRIBUTE,
- HtmlUtil.concatClasses(helper.getRowClass(), helper.getColumnClass(), "rf-dlst-t"));
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE,
+ HtmlUtil.concatClasses(helper.getRowClass(), helper.getColumnClass(), "rf-dlst-trm"), null);
termFacet.encodeAll(context);
writer.endElement(HtmlConstants.DT_ELEMENT);
}
@@ -141,11 +141,11 @@
writer.startElement(HtmlConstants.DD_ELEMENT, sequence);
if (rendererUtils.hasExplicitId(sequence)) {
- rendererUtils.writeAttribute(writer, HtmlConstants.ID_ATTRIBUTE, sequence.getClientId(context));
+ writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, sequence.getClientId(context), null);
}
- rendererUtils.writeAttribute(writer, HtmlConstants.CLASS_ATTRIBUTE,
- HtmlUtil.concatClasses(helper.getRowClass(), helper.getColumnClass(), "rf-dlst-d"));
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE,
+ HtmlUtil.concatClasses(helper.getRowClass(), helper.getColumnClass(), "rf-dlst-dfn"), null);
renderHandlers(context, sequence);
rendererUtils.encodeChildren(context, sequence);
writer.endElement(HtmlConstants.DD_ELEMENT);
@@ -191,9 +191,9 @@
}
- private ItemsEncoder unorderedListItemsEncoder = new SimpleItemsEncoder("rf-ulst-i");
+ private ItemsEncoder unorderedListItemsEncoder = new SimpleItemsEncoder("rf-ulst-itm");
- private ItemsEncoder orderedListItemsEncoder = new SimpleItemsEncoder("rf-olst-i");
+ private ItemsEncoder orderedListItemsEncoder = new SimpleItemsEncoder("rf-olst-itm");
private ItemsEncoder definitionItemsEncoder = new DefinitionItemsEncoder();
Modified: branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java
===================================================================
--- branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java 2010-10-27 14:34:46 UTC (rev 19686)
+++ branches/RF-7817/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java 2010-10-27 14:47:25 UTC (rev 19687)
@@ -298,15 +298,15 @@
}
public String getFirstRowSkinClass() {
- return "rf-st-f-r";
+ return "rf-st-fst-r";
}
public String getHeaderRowSkinClass() {
- return "rf-st-h-r";
+ return "rf-st-hdr-r";
}
public String getHeaderFirstRowSkinClass() {
- return "rf-st-h-f-r";
+ return "rf-st-hdr-fst-r";
}
public String getCellSkinClass() {
@@ -314,55 +314,55 @@
}
public String getHeaderCellSkinClass() {
- return "rf-st-h-c";
+ return "rf-st-hdr-c";
}
public String getColumnHeaderCellSkinClass() {
- return "rf-st-sh-c";
+ return "rf-st-shdr-c";
}
public String getColumnHeaderSkinClass() {
- return "rf-st-sh";
+ return "rf-st-shdr";
}
public String getFooterSkinClass() {
- return "rf-st-f";
+ return "rf-st-ftr";
}
public String getFooterCellSkinClass() {
- return "rf-st-f-c";
+ return "rf-st-ftr-c";
}
public String getFooterFirstRowSkinClass() {
- return "rf-st-f-f";
+ return "rf-st-ftr-fst";
}
public String getColumnFooterCellSkinClass() {
- return "rf-st-sf-c";
+ return "rf-st-sftr-c";
}
public String getColumnFooterSkinClass() {
- return "rf-st-sf";
+ return "rf-st-sftr";
}
public String getColumnFooterFirstSkinClass() {
- return "rf-st-sf-f";
+ return "rf-st-sftr-fst";
}
public String getColumnHeaderFirstSkinClass() {
- return "rf-st-sh-f";
+ return "rf-st-shdr-fst";
}
public String getFooterFirstSkinClass() {
- return "rf-st-f-f";
+ return "rf-st-ftr-fst";
}
public String getHeaderFirstSkinClass() {
- return "rf-st-h-f";
+ return "rf-st-hdr-fst";
}
public String getHeaderSkinClass() {
- return "rf-st-h";
+ return "rf-st-hdr";
}
public String getNoDataClass() {
Modified: branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.ecss
===================================================================
--- branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.ecss 2010-10-27 14:34:46 UTC (rev 19686)
+++ branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.ecss 2010-10-27 14:47:25 UTC (rev 19687)
@@ -7,7 +7,7 @@
background:'#{richSkin.tableBackgroundColor}';
}
-a.rf-ds-dtl {
+a.rf-ds-nmb-btn {
color: '#{richSkin.generalTextColor}';
}
@@ -50,15 +50,15 @@
font-weight: normal;
}
-.rf-ds-l {
+.rf-ds-lft {
margin-right: 1px;
}
-.rf-ds-r {
+.rf-ds-rgh {
margin-left: 1px;
}
-.rf-ds-dtl {
+.rf-ds-nmb-btn {
cursor: pointer;
width: 2em;
text-align: center;
@@ -88,7 +88,7 @@
}
-.rf-ds-over {
+.rf-ds-hov {
border-width : 1px;
border-style: solid;
border-color: '#{richSkin.tableBorderColor}';
@@ -105,7 +105,7 @@
background: '#{richSkin.additionalBackgroundColor}';
}
-.rf-ds-cur {
+.rf-ds-act {
cursor: default;
font-weight: bold;
border-width: 1px;
Modified: branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.js
===================================================================
--- branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.js 2010-10-27 14:34:46 UTC (rev 19686)
+++ branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.js 2010-10-27 14:47:25 UTC (rev 19687)
@@ -69,25 +69,25 @@
if(buttons) {
var leftButtons = buttons.left;
- css.mouseover = "rf-ds-btn rf-ds-l";
- css.mouseup = "rf-ds-btn rf-ds-l";
- css.mouseout = "rf-ds-btn rf-ds-l";
- css.mousedown = "rf-ds-btn rf-ds-l rf-ds-over";
+ css.mouseover = "rf-ds-btn rf-ds-lft";
+ css.mouseup = "rf-ds-btn rf-ds-lft";
+ css.mouseout = "rf-ds-btn rf-ds-lft";
+ css.mousedown = "rf-ds-btn rf-ds-lft rf-ds-hov";
initButtons(leftButtons,css, this);
var rightButtons = buttons.right;
- css.mouseover = "rf-ds-btn rf-ds-r";
- css.mouseup = "rf-ds-btn rf-ds-r";
- css.mouseout = "rf-ds-btn rf-ds-r";
- css.mousedown = "rf-ds-btn rf-ds-r rf-ds-over";
+ css.mouseover = "rf-ds-btn rf-ds-rgh";
+ css.mouseup = "rf-ds-btn rf-ds-rgh";
+ css.mouseout = "rf-ds-btn rf-ds-rgh";
+ css.mousedown = "rf-ds-btn rf-ds-rgh rf-ds-hov";
initButtons(rightButtons,css, this);
}
if(digitals) {
- css.mouseover= "rf-ds-dtl rf-ds-over";
- css.mouseup= "rf-ds-dtl rf-ds-over";
- css.mouseout = "rf-ds-dtl";
- css.mousedown="rf-ds-dtl rf-ds-press";
+ css.mouseover= "rf-ds-nmb-btn rf-ds-hov";
+ css.mouseup= "rf-ds-nmb-btn rf-ds-hov";
+ css.mouseout = "rf-ds-nmb-btn";
+ css.mousedown="rf-ds-nmb-btn rf-ds-press";
initButtons(digitals, css,this);
}
};
Modified: branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datatable.ecss
===================================================================
--- branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datatable.ecss 2010-10-27 14:34:46 UTC (rev 19686)
+++ branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datatable.ecss 2010-10-27 14:47:25 UTC (rev 19687)
@@ -16,7 +16,7 @@
.rf-dt-r{
}
-.rf-dt-f-r{
+.rf-dt-fst-r{
}
.rf-dt-c{
@@ -32,7 +32,7 @@
padding:4px;
}
-.rf-dt-nd-c{
+.rf-dt-ndt{
border-bottom-width:'#{richSkin.tableBorderWidth}';
border-bottom-style:solid;
border-bottom-color:'#{richSkin.tableBorderColor}';
@@ -45,13 +45,13 @@
padding:4px;
}
-.rf-dt-h{
+.rf-dt-hdr{
}
-.rf-dt-h-f{
+.rf-dt-hdr-fst{
}
-.rf-dt-h-c{
+.rf-dt-hdr-c{
border-bottom-width:'#{richSkin.tableBorderWidth}';
border-bottom-style:solid;
border-bottom-color:'#{richSkin.tableBorderColor}';
@@ -69,13 +69,13 @@
text-align:center;
}
-.rf-dt-sh {
+.rf-dt-shdr {
}
-.rf-dt-sh-f {
+.rf-dt-shdr-fst {
}
-.rf-dt-sh-c{
+.rf-dt-shdr-c{
border-bottom-width:'#{richSkin.tableBorderWidth}';
border-bottom-style:solid;
border-bottom-color:'#{richSkin.tableBorderColor}';
@@ -93,13 +93,13 @@
text-align:center;
}
-.rf-dt-sf{
+.rf-dt-sftr{
}
-.rf-dt-sf-f{
+.rf-dt-sftr-fst{
}
-.rf-dt-sf-c{
+.rf-dt-sftr-c{
border-bottom-width:'#{richSkin.tableBorderWidth}';
border-bottom-style:solid;
border-bottom-color:'#{richSkin.tableBorderColor}';
@@ -123,14 +123,14 @@
border-bottom-color:'#{richSkin.tableBorderColor}';
}
-.rf-dt-f {
+.rf-dt-ftr {
}
-.rf-dt-f-f{
+.rf-dt-ftr-fst{
}
-.rf-dt-f-c{
+.rf-dt-ftr-c{
border-bottom-width:'#{richSkin.tableBorderWidth}';
border-bottom-style:solid;
border-bottom-color:'#{richSkin.tableBorderColor}';
@@ -152,13 +152,13 @@
.rf-st-r{
}
-.rf-st-f-r{
+.rf-st-fst-r{
}
-.rf-st-h-r{
+.rf-st-hdr-r{
}
-.rf-st-h-f-r{
+.rf-st-hdr-fst-r{
}
.rf-st-c{
@@ -175,7 +175,7 @@
padding:4px;
}
-.rf-st-h-c{
+.rf-st-hdr-c{
border-bottom-width:'#{richSkin.tableBorderWidth}';
border-bottom-style:solid;
border-bottom-color:'#{richSkin.tableBorderColor}';
@@ -191,7 +191,7 @@
text-align:left;
}
-.rf-st-sh-c{
+.rf-st-shdr-c{
border-bottom-width:'#{richSkin.tableBorderWidth}';
border-bottom-style:solid;
border-bottom-color:'#{richSkin.tableBorderColor}';
@@ -206,13 +206,13 @@
padding:4px;
}
-.rf-st-sh{
+.rf-st-shdr{
}
-.rf-st-f {
+.rf-st-ftr {
}
-.rf-st-f-c{
+.rf-st-ftr-c{
border-bottom-width:3px;
border-bottom-style:solid;
border-bottom-color:'#{richSkin.tableBorderColor}';
@@ -228,7 +228,7 @@
text-align:left;
}
-.rf-st-sf-c{
+.rf-st-sftr-c{
border-bottom-width:'#{richSkin.tableBorderWidth}';
border-bottom-style:solid;
border-bottom-color:'#{richSkin.tableBorderColor}';
@@ -242,22 +242,22 @@
padding:4px;
}
-.rf-st-sf{
+.rf-st-sftr{
}
-.rf-st-sf-f{
+.rf-st-sftr-fst{
}
-.rf-st-sh-f{
+.rf-st-shdr-fst{
}
-.rf-st-f-f{
+.rf-st-ftr-fst{
}
-.rf-st-h-f{
+.rf-st-hdr-fst{
}
-.rf-st-h{
+.rf-st-hdr{
}
Modified: branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.ecss
===================================================================
--- branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.ecss 2010-10-27 14:34:46 UTC (rev 19686)
+++ branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.ecss 2010-10-27 14:47:25 UTC (rev 19687)
@@ -25,11 +25,11 @@
border: '#{richSkin.tableBorderWidth} solid #{richSkin.tableBorderColor}';
}
-.rf-edt-h, .rf-edt-th {
+.rf-edt-hdr, .rf-edt-tbl-hdr {
background-image : "url(#{resource['org.richfaces.images:colHdrGrad.png']})";
}
-.rf-edt-th {
+.rf-edt-tbl-hdr {
border-bottom: '#{richSkin.tableBorderWidth} solid #{richSkin.tableBorderColor}';
}
@@ -39,36 +39,36 @@
width: 100%;
}
-.rf-edt-s {
+.rf-edt-spcr {
height: 0px;
font-size: 0px; /*for IE7 only*/
}
-.rf-edt-f, .rf-edt-tf {
+.rf-edt-ftr, .rf-edt-tbl-ftr {
border-top: '#{richSkin.tableBorderWidth} solid #{richSkin.tableBorderColor}';
background-color: '#{richSkin.tableFooterBackgroundColor}';
}
-.rf-edt-fa {
+.rf-edt-ftr-fzn {
vertical-align: top;
}
-.rf-edt-p {
+.rf-edt-cnt {
overflow: hidden;
}
-.rf-edt-fp {
+div.rf-edt-ftr-cnt {
overflow-x: auto;
overflow-y: visible;
}
-.rf-edt-rsh {
+.rf-edt-rsz-cntr {
left : 0px;
position: relative;
height: 0px;
}
-.rf-edt-rs {
+.rf-edt-rsz {
background-image: url("#{resource['spacer.gif']}");
cursor: e-resize;
height: 20px; /*TODO*/
@@ -78,7 +78,7 @@
width: 6px;
}
-.rf-edt-d {
+.rf-edt-rsz-mkr {
cursor: e-resize;
position: absolute;
border-left: '1px dotted #{richSkin.generalTextColor}';
@@ -87,13 +87,13 @@
display: none;
}
-.rf-edt-ro {
+.rf-edt-rord {
position: absolute;
border-collapse: collapse;
display: none;
}
-.rf-edt-ro th {
+.rf-edt-rord th {
width: 20px;
height: 5px;
font-size: 1px;
@@ -101,7 +101,7 @@
border: '#{richSkin.tableBorderWidth} solid #{richSkin.tableBorderColor}';
}
-.rf-edt-ro td {
+.rf-edt-rord td {
width: 20px;
height: 5px;
font-size: 1px;
@@ -109,39 +109,39 @@
border: '#{richSkin.tableBorderWidth} solid #{richSkin.tableBorderColor}';
}
-.rf-edt-c, .rf-edt-hc, .rf-edt-fc {
+.rf-edt-c, .rf-edt-hdr-c, .rf-edt-ftr-c {
height: 20px;
overflow: hidden;
border-bottom: '#{richSkin.tableBorderWidth} solid #{richSkin.tableBorderColor}';
border-right: '#{richSkin.tableBorderWidth} solid #{richSkin.tableBorderColor}';
}
-.rf-edt-efc {
+.rf-edt-ftr-c-emp {
border-right: '#{richSkin.tableBorderWidth} solid #{richSkin.tableBorderColor}';
height: 1px;
}
-.rf-edt-cc, .rf-edt-hcc, .rf-edt-fcc, .rf-edt-th, .rf-edt-tf {
+.rf-edt-c-cnt, .rf-edt-hdr-c-cnt, .rf-edt-ftr-c-cnt, .rf-edt-tbl-hdr, .rf-edt-tbl-ftr {
padding: 3px 7px;
white-space: nowrap;
font-family: '#{richSkin.generalFamilyFont}';
font-size: '#{richSkin.generalSizeFont}';
}
-.rf-edt-hcc, .rf-edt-th, .rf-edt-fcc, .rf-edt-tf {
+.rf-edt-hdr-c-cnt, .rf-edt-tbl-hdr, .rf-edt-ftr-c-cnt, .rf-edt-tbl-ftr {
font-weight: bold;
text-align: center;
}
-.rf-edt-hcc, .rf-edt-th {
+.rf-edt-hdr-c-cnt, .rf-edt-tbl-hdr {
color: '#{richSkin.tableHeaderTextColor}';
}
-.rf-edt-cc, .rf-edt-fcc, .rf-edt-tf {
+.rf-edt-c-cnt, .rf-edt-ftr-c-cnt, .rf-edt-tbl-ftr {
color: '#{richSkin.generalTextColor}';
}
-.rf-edt-rom {
+.rf-edt-rord-mkr {
position: absolute;
height: 9px;
font-size: 9px;
@@ -150,10 +150,10 @@
display: none;
}
-.rf-edt-r-s {
+.rf-edt-r-sel {
background-color: '#{richSkin.additionalBackgroundColor}'; /*TODO Probably use other skin property.*/
}
-.rf-edt-r-a {
+.rf-edt-r-act {
font-weight: bold; /*TODO Probably use other property.*/
}
\ No newline at end of file
Modified: branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.js
===================================================================
--- branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.js 2010-10-27 14:34:46 UTC (rev 19686)
+++ branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.js 2010-10-27 14:47:25 UTC (rev 19687)
@@ -122,22 +122,21 @@
};
richfaces.ExtendedDataTable = function(id, rowCount, ajaxFunction, options) {
- var WIDTH_CLASS_NAME_BASE = "rf-edt-cw-";
+ var WIDTH_CLASS_NAME_BASE = "rf-edt-c-";
var MIN_WIDTH = 20;
options = options || {};
var ranges = new richfaces.utils.Ranges();
var element = document.getElementById(id);
- var bodyElement, contentElement, spacerElement, dataTableElement, rows, rowHeight, parts, tbodies, shiftIndex,
- activeIndex, selectionFlag;
+ var bodyElement, contentElement, spacerElement, dataTableElement, normalPartStyle, rows, rowHeight, parts, tbodies,
+ shiftIndex, activeIndex, selectionFlag;
var dragElement = document.getElementById(id + ":d");
var reorderElement = document.getElementById(id + ":r");
var reorderMarkerElement = document.getElementById(id + ":rm");
var widthInput = document.getElementById(id + ":wi");
var selectionInput = document.getElementById(id + ":si");
- var normalPartStyle = richfaces.utils.getCSSRule(".rf-edt-pw").style;
- var header = jQuery(element).children(".rf-edt-h");
- var resizerHolders = header.find(".rf-edt-rsh");
+ var header = jQuery(element).children(".rf-edt-hdr");
+ var resizerHolders = header.find(".rf-edt-rsz-cntr");
var frozenHeaderPartElement = document.getElementById(id + ":frozenHeader");
var frozenColumnCount = frozenHeaderPartElement ? frozenHeaderPartElement.firstChild.rows[0].cells.length : 0;//TODO Richfaces.firstDescendant;
@@ -168,11 +167,10 @@
normalPartStyle.width = width + "px";
}
normalPartStyle.display = "block";
+ scrollElement.style.overflowX = "";
if (scrollElement.clientWidth < scrollElement.scrollWidth
&& scrollElement.scrollHeight == scrollElement.offsetHeight) {
scrollElement.style.overflowX = "scroll";
- } else {
- scrollElement.style.overflowX = "";
}
var delta = scrollElement.firstChild.offsetHeight - scrollElement.clientHeight;
if (delta) {
@@ -183,7 +181,7 @@
}
var height = element.clientHeight;
var el = element.firstChild;
- while (el) {
+ while (el && (!el.nodeName || el.nodeName.toUpperCase() != "TABLE")) {
if(el.nodeName && el.nodeName.toUpperCase() == "DIV" && el != bodyElement) {
height -= el.offsetHeight;
}
@@ -244,6 +242,7 @@
var initialize = function() {
bodyElement = document.getElementById(id + ":b");
bodyElement.tabIndex = -1; //TODO don't use tabIndex.
+ normalPartStyle = richfaces.utils.getCSSRule("div.rf-edt-cnt").style;
var bodyJQuery = jQuery(bodyElement);
contentElement = bodyJQuery.children("div:first")[0];
if (contentElement) {
@@ -265,7 +264,7 @@
spacerElement = null;
dataTableElement = null;
}
- parts = jQuery(element).find(".rf-edt-p");
+ parts = jQuery(element).find(".rf-edt-cnt, .rf-edt-ftr-cnt");
updateLayout();
updateScrollPosition(); //TODO Restore horizontal scroll position
};
@@ -319,7 +318,7 @@
var beginReorder = function(event) {
idOfReorderingColumn = this.className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1];
jQuery(document).bind("mousemove", reorder);
- header.find(".rf-edt-hc").bind("mouseover", overReorder);
+ header.find(".rf-edt-hdr-c").bind("mouseover", overReorder);
jQuery(document).one("mouseup", cancelReorder);
return false;
};
@@ -345,7 +344,7 @@
jQuery(this).unbind("mouseout", outReorder);
var id = this.className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1];
var colunmsOrder = "";
- header.find(".rf-edt-hc").each(function() {
+ header.find(".rf-edt-hdr-c").each(function() {
var i = this.className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1];
if (i == id) {
colunmsOrder += idOfReorderingColumn + "," + id + ",";
@@ -358,7 +357,7 @@
var cancelReorder = function(event) {
jQuery(document).unbind("mousemove", reorder);
- header.find(".rf-edt-hc").unbind("mouseover", overReorder);
+ header.find(".rf-edt-hdr-c").unbind("mouseover", overReorder);
reorderElement.style.display = "none";
};
@@ -395,34 +394,34 @@
var selectRow = function(index) {
ranges.add(index);
for ( var i = 0; i < tbodies.length; i++) {
- jQuery(tbodies[i].rows[index]).addClass("rf-edt-r-s");
+ jQuery(tbodies[i].rows[index]).addClass("rf-edt-r-sel");
}
}
var deselectRow = function (index) {
ranges.remove(index);
for ( var i = 0; i < tbodies.length; i++) {
- jQuery(tbodies[i].rows[index]).removeClass("rf-edt-r-s");
+ jQuery(tbodies[i].rows[index]).removeClass("rf-edt-r-sel");
}
}
var setActiveRow = function (index) {
if(typeof activeIndex == "number") {
for ( var i = 0; i < tbodies.length; i++) {
- jQuery(tbodies[i].rows[activeIndex]).removeClass("rf-edt-r-a");
+ jQuery(tbodies[i].rows[activeIndex]).removeClass("rf-edt-r-act");
}
}
activeIndex = index;
for ( var i = 0; i < tbodies.length; i++) {
- jQuery(tbodies[i].rows[activeIndex]).addClass("rf-edt-r-a");
+ jQuery(tbodies[i].rows[activeIndex]).addClass("rf-edt-r-act");
}
}
var resetShiftRow = function () {
if(typeof shiftIndex == "number") {
for ( var i = 0; i < tbodies.length; i++) {
- jQuery(tbodies[i].rows[shiftIndex]).removeClass("rf-edt-r-t");
+ jQuery(tbodies[i].rows[shiftIndex]).removeClass("rf-edt-r-sht");
}
}
@@ -434,7 +433,7 @@
shiftIndex = index;
if(typeof index == "number") {
for ( var i = 0; i < tbodies.length; i++) {
- jQuery(tbodies[i].rows[shiftIndex]).addClass("rf-edt-r-t");
+ jQuery(tbodies[i].rows[shiftIndex]).addClass("rf-edt-r-sht");
}
}
}
@@ -448,13 +447,13 @@
var rows = tbodies[0].rows;
for (var i = 0; i < rows.length; i++) {
var row = jQuery(rows[i]);
- if (row.hasClass("rf-edt-r-s")) {
+ if (row.hasClass("rf-edt-r-sel")) {
ranges.add(row[0].rowIndex)
}
- if (row.hasClass("rf-edt-r-a")) {
+ if (row.hasClass("rf-edt-r-act")) {
activeIndex = row[0].rowIndex;
}
- if (row.hasClass("rf-edt-r-t")) {
+ if (row.hasClass("rf-edt-r-sht")) {
shiftIndex = row[0].rowIndex;
}
}
@@ -616,8 +615,8 @@
jQuery(window).bind("resize", updateLayout);
jQuery(scrollElement).bind("scroll", updateScrollPosition);
var bindHeaderHandlers = function () {
- header.find(".rf-edt-rs").bind("mousedown", beginResize);
- header.find(".rf-edt-hc").bind("mousedown", beginReorder);
+ header.find(".rf-edt-rsz").bind("mousedown", beginResize);
+ header.find(".rf-edt-hdr-c").bind("mousedown", beginReorder);
}
bindHeaderHandlers();
jQuery(element).bind("rich:onajaxcomplete", ajaxComplete);
@@ -625,10 +624,14 @@
//JS API
element["richfaces"] = element["richfaces"] || {}; // TODO ExtendedDataTable should extend richfaces.BaseComponent instead of using it.
element.richfaces.component = this;
+ this.destroy = function() {
+ element.richfaces.component = null;
+ jQuery(window).unbind("resize", updateLayout);
+ }
this.getColumnPosition = function(id) {
var position;
- var headers = header.find(".rf-edt-hc");
+ var headers = header.find(".rf-edt-hdr-c");
for (var i = 0; i < headers.length; i++) {
if (id == headers[i].className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1]) {
position = i;
@@ -640,7 +643,7 @@
this.setColumnPosition = function(id, position) {
var colunmsOrder = "";
var before;
- var headers = header.find(".rf-edt-hc");
+ var headers = header.find(".rf-edt-hdr-c");
for (var i = 0; i < headers.length; i++) {
var current = headers[i].className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1];
if (i == position) {
Modified: branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/list.ecss
===================================================================
--- branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/list.ecss 2010-10-27 14:34:46 UTC (rev 19686)
+++ branches/RF-7817/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/list.ecss 2010-10-27 14:47:25 UTC (rev 19687)
@@ -1,4 +1,4 @@
-.rf-ulst-i, .rf-olst-i, .rf-dlst-t, .rf-dlst-d {
+.rf-ulst-itm, .rf-olst-itm, .rf-dlst-trm, .rf-dlst-dfn {
font-size: '#{richSkin.generalSizeFont}';
font-family: '#{richSkin.generalFamilyFont}';
color: '#{richSkin.generalTextColor}';
Modified: branches/RF-7817/ui/iteration/ui/src/main/templates/datascroller.template.xml
===================================================================
--- branches/RF-7817/ui/iteration/ui/src/main/templates/datascroller.template.xml 2010-10-27 14:34:46 UTC (rev 19686)
+++ branches/RF-7817/ui/iteration/ui/src/main/templates/datascroller.template.xml 2010-10-27 14:47:25 UTC (rev 19687)
@@ -44,8 +44,8 @@
<c:if test="#{controlsState.firstRendered}">
<cdk:object type="boolean" name="isEnabled" value="#{controlsState.firstEnabled}"/>
<cdk:object type="UIComponent" name="facet" value="#{component.getFacet('first')}"/>
- <cdk:object type="String" name="enabledStyles" value="rf-ds-btn rf-ds-l"/>
- <cdk:object type="String" name="disabledStyles" value="rf-ds-btn rf-ds-l rf-ds-dis"/>
+ <cdk:object type="String" name="enabledStyles" value="rf-ds-btn rf-ds-lft"/>
+ <cdk:object type="String" name="disabledStyles" value="rf-ds-btn rf-ds-lft rf-ds-dis"/>
<cdk:object type="String" name="id" value="#{clientId}_ds_f"/>
<cdk:object type="String" name="defaultText" value="««««"/>
<xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
@@ -54,8 +54,8 @@
<c:if test="#{controlsState.fastRewindRendered}">
<cdk:object type="boolean" name="isEnabled" value="#{controlsState.fastRewindEnabled}"/>
<cdk:object type="UIComponent" name="facet" value="#{component.getFacet('fastRewind')}"/>
- <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-l"/>
- <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-l rf-ds-dis"/>
+ <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-lft"/>
+ <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-lft rf-ds-dis"/>
<cdk:object type="java.lang.String" name="id" value="#{clientId}_ds_fr"/>
<cdk:object type="java.lang.String" name="defaultText" value="««"/>
<xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
@@ -64,8 +64,8 @@
<c:if test="#{controlsState.previousRendered}">
<cdk:object name="isEnabled" value="#{controlsState.previousEnabled}"/>
<cdk:object name="facet" value="#{component.getFacet('previous')}"/>
- <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-l"/>
- <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-l rf-ds-dis"/>
+ <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-lft"/>
+ <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-lft rf-ds-dis"/>
<cdk:object name="id" value="#{clientId}_ds_prev"/>
<cdk:object name="defaultText" value="«"/>
<xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
@@ -76,8 +76,8 @@
<c:if test="#{controlsState.nextRendered}">
<cdk:object name="isEnabled" value="#{controlsState.nextEnabled}"/>
<cdk:object name="facet" value="#{component.getFacet('next')}"/>
- <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-r"/>
- <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-r rf-ds-dis"/>
+ <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-rgh"/>
+ <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-rgh rf-ds-dis"/>
<cdk:object name="id" value="#{clientId}_ds_next"/>
<cdk:object name="defaultText" value="»"/>
<xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
@@ -86,8 +86,8 @@
<c:if test="#{controlsState.fastForwardRendered}">
<cdk:object name="isEnabled" value="#{controlsState.fastForwardEnabled}"/>
<cdk:object name="facet" value="#{component.getFacet('fastForward')}"/>
- <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-r"/>
- <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-r rf-ds-dis"/>
+ <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-rgh"/>
+ <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-rgh rf-ds-dis"/>
<cdk:object name="id" value="#{clientId}_ds_ff"/>
<cdk:object name="defaultText" value="»»"/>
<xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
@@ -96,8 +96,8 @@
<c:if test="#{controlsState.lastRendered}">
<cdk:object name="isEnabled" value="#{controlsState.lastEnabled}"/>
<cdk:object name="facet" value="#{component.getFacet('last')}"/>
- <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-r"/>
- <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-r rf-ds-dis"/>
+ <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-rgh"/>
+ <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-rgh rf-ds-dis"/>
<cdk:object name="id" value="#{clientId}_ds_l"/>
<cdk:object name="defaultText" value="»»»»"/>
<xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
Modified: branches/RF-7817/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java
===================================================================
--- branches/RF-7817/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java 2010-10-27 14:34:46 UTC (rev 19686)
+++ branches/RF-7817/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java 2010-10-27 14:47:25 UTC (rev 19687)
@@ -49,56 +49,56 @@
// first/fastRewind/previous buttons with arrows
HtmlElement first = getFirstButton(page, scrollerId);
assertEquals("span", first.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l rf-ds-dis", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-lft rf-ds-dis", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
HtmlElement fastRewind = getFastRewindButton(page, scrollerId);
assertEquals("span", fastRewind.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l rf-ds-dis", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-lft rf-ds-dis", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
HtmlElement previous = getPreviousButton(page, scrollerId);
assertEquals("span", previous.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l rf-ds-dis", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-lft rf-ds-dis", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// currently selected digital button
HtmlElement dc1 = getDigitalButton(page, scrollerId, 1);
assertEquals("span", dc1.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", dc1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", dc1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// digital buttons
HtmlElement d2 = getDigitalButton(page, scrollerId, 2);
assertEquals("a", d2.getNodeName());
- assertEquals("rf-ds-dtl", d2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn", d2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("javascript:void(0);", d2.getAttribute(HtmlConstants.HREF_ATTR));
HtmlElement d3 = getDigitalButton(page, scrollerId, 3);
assertEquals("a", d3.getNodeName());
- assertEquals("rf-ds-dtl", d3.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn", d3.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("javascript:void(0);", d3.getAttribute(HtmlConstants.HREF_ATTR));
HtmlElement d4 = getDigitalButton(page, scrollerId, 4);
assertEquals("a", d4.getNodeName());
- assertEquals("rf-ds-dtl", d4.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn", d4.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("javascript:void(0);", d4.getAttribute(HtmlConstants.HREF_ATTR));
HtmlElement d5 = getDigitalButton(page, scrollerId, 5);
assertEquals("a", d5.getNodeName());
- assertEquals("rf-ds-dtl", d5.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn", d5.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("javascript:void(0);", d5.getAttribute(HtmlConstants.HREF_ATTR));
// next/fastForward/last buttons with arrows
HtmlElement next = getNextButton(page, scrollerId);
assertEquals("a", next.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-rgh", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("javascript:void(0);", next.getAttribute(HtmlConstants.HREF_ATTR));
HtmlElement fastForward = getFastForwardButton(page, scrollerId);
assertEquals("a", fastForward.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-rgh", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("javascript:void(0);", fastForward.getAttribute(HtmlConstants.HREF_ATTR));
HtmlElement last = getLastButton(page, scrollerId);
assertEquals("a", last.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-rgh", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("javascript:void(0);", last.getAttribute(HtmlConstants.HREF_ATTR));
}
@@ -151,12 +151,12 @@
HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
assertEquals("span", currentDigital1.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// if scroller inside dataTable has switched
HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
assertEquals("span", currentDigital2.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// check if page has switched
assertEquals(i + " page content", getCurrentPageContent(page, i));
@@ -171,12 +171,12 @@
HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
assertEquals("span", currentDigital1.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// if scroller inside dataTable has switched
HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
assertEquals("span", currentDigital2.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// check if page has switched
assertEquals(i + " page content", getCurrentPageContent(page, i));
@@ -198,12 +198,12 @@
next.click();
HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
assertEquals("span", currentDigital2.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// if scroller outside dataTable has switched
HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
assertEquals("span", currentDigital1.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// check if page has switched
assertEquals(i + " page content", getCurrentPageContent(page, i));
@@ -218,12 +218,12 @@
HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
assertEquals("span", currentDigital2.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// if scroller inside dataTable has switched
HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
assertEquals("span", currentDigital1.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// check if page has switched
assertEquals(i + " page content", getCurrentPageContent(page, i));
@@ -247,12 +247,12 @@
HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
assertEquals("span", currentDigital1.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// if scroller inside dataTable has switched
HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
assertEquals("span", currentDigital2.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// check if page has switched
assertEquals(i + " page content", getCurrentPageContent(page, i));
@@ -267,12 +267,12 @@
HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
assertEquals("span", currentDigital1.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// if scroller inside dataTable has switched
HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
assertEquals("span", currentDigital2.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// check if page has switched
assertEquals(i + " page content", getCurrentPageContent(page, i));
@@ -294,12 +294,12 @@
ff.click();
HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
assertEquals("span", currentDigital2.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// if scroller outside dataTable has switched
HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
assertEquals("span", currentDigital1.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// check if page has switched
assertEquals(i + " page content", getCurrentPageContent(page, i));
@@ -314,12 +314,12 @@
HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
assertEquals("span", currentDigital2.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// if scroller inside dataTable has switched
HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
assertEquals("span", currentDigital1.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// check if page has switched
assertEquals(i + " page content", getCurrentPageContent(page, i));
@@ -342,12 +342,12 @@
currentDigital1 = getDigitalButton(page, firstScrollerId, i);
assertEquals("span", currentDigital1.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// if scroller inside dataTable has switched
HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
assertEquals("span", currentDigital2.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// check if page has switched
assertEquals(i + " page content", getCurrentPageContent(page, i));
@@ -362,12 +362,12 @@
currentDigital1 = getDigitalButton(page, firstScrollerId, i);
assertEquals("span", currentDigital1.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// if scroller inside dataTable has switched
HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
assertEquals("span", currentDigital2.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// check if page has switched
assertEquals(i + " page content", getCurrentPageContent(page, i));
@@ -390,12 +390,12 @@
currentDigital2 = getDigitalButton(page, secondScrollerId, i);
assertEquals("span", currentDigital2.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// if scroller outside dataTable has switched
HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
assertEquals("span", currentDigital1.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// check if page has switched
assertEquals(i + " page content", getCurrentPageContent(page, i));
@@ -410,12 +410,12 @@
currentDigital2 = getDigitalButton(page, secondScrollerId, i);
assertEquals("span", currentDigital2.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// if scroller inside dataTable has switched
HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
assertEquals("span", currentDigital1.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-nmb-btn rf-ds-act", currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// check if page has switched
assertEquals(i + " page content", getCurrentPageContent(page, i));
@@ -437,26 +437,26 @@
//check right buttons
assertEquals("a", fastForward.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-rgh", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", last.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-rgh", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", next.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-rgh", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
fastForward = getFastForwardButton(page, secondScrollerId);
last = getFastForwardButton(page, secondScrollerId);
next = getNextButton(page, secondScrollerId);
assertEquals("a", fastForward.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-rgh", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", last.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-rgh", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", next.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-rgh", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
//check if left buttons is disabled
HtmlElement fastRewind = getFastRewindButton(page, firstScrollerId);
@@ -464,26 +464,26 @@
HtmlElement previous = getPreviousButton(page, firstScrollerId);
assertEquals("span", fastRewind.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l rf-ds-dis", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-lft rf-ds-dis", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", first.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l rf-ds-dis", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-lft rf-ds-dis", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", previous.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l rf-ds-dis", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-lft rf-ds-dis", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
fastRewind = getFastRewindButton(page, secondScrollerId);
first = getFirstButton(page, secondScrollerId);
next = getNextButton(page, secondScrollerId);
assertEquals("span", fastRewind.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l rf-ds-dis", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-lft rf-ds-dis", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", first.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l rf-ds-dis", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-lft rf-ds-dis", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", previous.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l rf-ds-dis", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-lft rf-ds-dis", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
}
private void checkLastPageButtons(HtmlPage page, String firstScrollerId, String secondScrollerId) throws Exception {
@@ -493,13 +493,13 @@
HtmlElement next = getNextButton(page, firstScrollerId);
assertEquals("span", fastForward.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r rf-ds-dis", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-rgh rf-ds-dis", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", last.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r rf-ds-dis", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-rgh rf-ds-dis", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", next.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r rf-ds-dis", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-rgh rf-ds-dis", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
fastForward = getFastForwardButton(page, secondScrollerId);
@@ -507,13 +507,13 @@
next = getNextButton(page, secondScrollerId);
assertEquals("span", fastForward.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r rf-ds-dis", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-rgh rf-ds-dis", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", last.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r rf-ds-dis", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-rgh rf-ds-dis", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", next.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r rf-ds-dis", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-rgh rf-ds-dis", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
//check if left buttons is enabled
HtmlElement fastRewind = getFastRewindButton(page, firstScrollerId);
@@ -521,26 +521,26 @@
HtmlElement previous = getPreviousButton(page, firstScrollerId);
assertEquals("a", fastRewind.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-lft", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", first.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-lft", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", previous.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-lft", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
fastRewind = getFastRewindButton(page, secondScrollerId);
first = getFirstButton(page, secondScrollerId);
previous = getPreviousButton(page, secondScrollerId);
assertEquals("a", fastRewind.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-lft", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", first.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-lft", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", previous.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-lft", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
}
private String getCurrentPageContent(HtmlPage page, int i) throws Exception {
Modified: branches/RF-7817/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ExtendedDataTableRendererTest.java
===================================================================
--- branches/RF-7817/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ExtendedDataTableRendererTest.java 2010-10-27 14:34:46 UTC (rev 19686)
+++ branches/RF-7817/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ExtendedDataTableRendererTest.java 2010-10-27 14:47:25 UTC (rev 19687)
@@ -121,36 +121,36 @@
HtmlPage page = environment.getPage("/extendedDataTableTest.jsf");
HtmlElement table = page.getElementById("table");
String text = table.getElementsByTagName("style").get(0).getTextContent();
- assertTrue(text.contains("rf-edt-pw"));
- assertTrue(text.contains("rf-edt-cw"));
- HtmlElement header = table.getFirstByXPath("div[@class='rf-edt-h']");
+ assertTrue(text.contains(".rf-edt-cnt"));
+ assertTrue(text.contains("rf-edt-c"));
+ HtmlElement header = table.getFirstByXPath("div[@class='rf-edt-hdr']");
HtmlElement frozenHeader = header.getElementById("table:frozenHeader");
HtmlElement normalHeader = header.getElementById("table:header");
- assertTrue(normalHeader.getAttribute("class").contains("rf-edt-pw"));
- assertNotNull(frozenHeader.getFirstByXPath("descendant::*[@class='rf-edt-rs']"));
- assertNotNull(normalHeader.getFirstByXPath("descendant::*[@class='rf-edt-rs']"));
+ assertTrue(normalHeader.getAttribute("class").contains("rf-edt-cnt"));
+ assertNotNull(frozenHeader.getFirstByXPath("descendant::*[@class='rf-edt-rsz']"));
+ assertNotNull(normalHeader.getFirstByXPath("descendant::*[@class='rf-edt-rsz']"));
assertEquals("headerColumnFacet1", ((HtmlElement) frozenHeader
- .getFirstByXPath("//*[@class='rf-edt-hcc']//*[@id='table:headerColumnFacet1']"))
+ .getFirstByXPath("//*[@class='rf-edt-hdr-c-cnt']//*[@id='table:headerColumnFacet1']"))
.getTextContent());
assertEquals("headerColumnFacet2", ((HtmlElement) normalHeader
- .getFirstByXPath("//*[@class='rf-edt-hcc']//*[@id='table:headerColumnFacet2']"))
+ .getFirstByXPath("//*[@class='rf-edt-hdr-c-cnt']//*[@id='table:headerColumnFacet2']"))
.getTextContent());
HtmlElement body = table.getElementById("table:b");
assertEquals("rf-edt-b", body.getAttribute("class"));
- assertNotNull(body.getFirstByXPath("descendant::*[@class='rf-edt-s']"));
+ assertNotNull(body.getFirstByXPath("descendant::*[@class='rf-edt-spcr']"));
assertNotNull(body
- .getFirstByXPath("descendant::*[@class='rf-edt-p rf-edt-pw']//*[@id='table:tbn']"));
+ .getFirstByXPath("descendant::*[@class='rf-edt-cnt']//*[@id='table:tbn']"));
assertEquals("noDataFacet", ((HtmlElement) page
.getFirstByXPath("//*[@id='table2']//*[@id='table2:b']//*[@id='table2:noDataFacet']")).getTextContent());
- HtmlElement footer = table.getFirstByXPath("div[@class='rf-edt-f']");
- HtmlElement frozenFooter = footer.getFirstByXPath("descendant::*[@class='rf-edt-fa']/div");
+ HtmlElement footer = table.getFirstByXPath("div[@class='rf-edt-ftr']");
+ HtmlElement frozenFooter = footer.getFirstByXPath("descendant::*[@class='rf-edt-ftr-fzn']/div");
HtmlElement normalFooter = footer.getElementById("table:footer");
- assertTrue(normalFooter.getAttribute("class").contains("rf-edt-pw"));
+ assertTrue(normalFooter.getAttribute("class").contains("rf-edt-ftr-cnt"));
assertEquals("footerColumnFacet1", ((HtmlElement) frozenFooter
- .getFirstByXPath("descendant::*[@class='rf-edt-fcc']//*[@id='table:footerColumnFacet1']"))
+ .getFirstByXPath("descendant::*[@class='rf-edt-ftr-c-cnt']//*[@id='table:footerColumnFacet1']"))
.getTextContent());
assertEquals("footerColumnFacet2", ((HtmlElement) normalFooter
- .getFirstByXPath("descendant::*[@class='rf-edt-fcc']//*[@id='table:footerColumnFacet2']"))
+ .getFirstByXPath("descendant::*[@class='rf-edt-ftr-c-cnt']//*[@id='table:footerColumnFacet2']"))
.getTextContent());
}
@@ -166,9 +166,9 @@
HtmlPage page = environment.getPage("/extendedDataTableTest.jsf");
HtmlElement table = page.getElementById("table");
assertEquals("footerFacet", table.getElementById("table:footerFacet").getTextContent());
- assertEquals("rf-edt-d", table.getElementById("table:d").getAttribute("class"));
- assertEquals("rf-edt-ro", table.getElementById("table:r").getAttribute("class"));
- assertEquals("rf-edt-rom", table.getElementById("table:rm").getAttribute("class"));
+ assertEquals("rf-edt-rsz-mkr", table.getElementById("table:d").getAttribute("class"));
+ assertEquals("rf-edt-rord", table.getElementById("table:r").getAttribute("class"));
+ assertEquals("rf-edt-rord-mkr", table.getElementById("table:rm").getAttribute("class"));
assertEquals("table:wi", table.getElementById("table:wi").getAttribute("name"));
assertTrue(table.getElementsByTagName("script").get(0).getTextContent()
.contains("RichFaces.ExtendedDataTable"));
@@ -187,7 +187,7 @@
HtmlElement cell = table.getElementById("table:0:f").getElementsByTagName("div").get(0);
assertTrue(cell.getAttribute("class").contains("rf-edt-c"));
HtmlElement cellContent = cell.getElementsByTagName("div").get(0);
- assertEquals("rf-edt-cc", cellContent.getAttribute("class"));
+ assertEquals("rf-edt-c-cnt", cellContent.getAttribute("class"));
assertEquals("value", cellContent.getElementById("table:0:outputText").getTextContent());
}
Modified: branches/RF-7817/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ListRendererTest.java
===================================================================
--- branches/RF-7817/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ListRendererTest.java 2010-10-27 14:34:46 UTC (rev 19686)
+++ branches/RF-7817/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ListRendererTest.java 2010-10-27 14:47:25 UTC (rev 19687)
@@ -73,7 +73,7 @@
HtmlElement list = (HtmlElement) nodes.get(0);
assertEquals("ol", list.getNodeName());
assertEquals("rf-olst", list.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
- verifySimpleListItems(list, "rf-olst-i");
+ verifySimpleListItems(list, "rf-olst-itm");
}
@Test
@@ -86,7 +86,7 @@
assertEquals("ul", list.getNodeName());
assertEquals("rf-ulst", list.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
- verifySimpleListItems((HtmlElement) list, "rf-ulst-i");
+ verifySimpleListItems((HtmlElement) list, "rf-ulst-itm");
}
@Test
@@ -140,7 +140,7 @@
HtmlElement item = (HtmlElement) termItems.get(i);
assertEquals("dt", item.getNodeName());
- assertEquals("rf-dlst-t", item.getAttribute("class"));
+ assertEquals("rf-dlst-trm", item.getAttribute("class"));
assertEquals(data.getTerm(), item.asText());
}
@@ -149,7 +149,7 @@
HtmlElement item = (HtmlElement) definitionItems.get(i);
assertEquals("dd", item.getNodeName());
- assertEquals("rf-dlst-d", item.getAttribute("class"));
+ assertEquals("rf-dlst-dfn", item.getAttribute("class"));
assertEquals(data.getDefinition(), item.asText());
}
}
15 years, 6 months