Author: konstantin.mishin
Date: 2010-09-21 11:23:14 -0400 (Tue, 21 Sep 2010)
New Revision: 19280
Added:
trunk/examples/input-demo/src/main/webapp/inputNumberSpinner.xhtml
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/ArrowBase.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBase.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBottom.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowTop.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowBottom.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowTop.java
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.ecss
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.js
trunk/ui/input/ui/src/main/templates/inputnumberspinner.template.xml
Modified:
trunk/
trunk/examples/input-demo/src/main/java/org/richfaces/demo/InputNumberSliderBean.java
trunk/examples/input-demo/src/main/webapp/index.xhtml
trunk/ui/input/ui/src/main/config/faces-config.xml
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowBase.java
Log:
Merged revisions 19224-19225,19244-19247,19271-19273,19278 via svnmerge from
https://svn.jboss.org/repos/richfaces/branches/RF-9151
.......
r19224 | konstantin.mishin | 2010-09-16 21:06:09 +0300 (Thu, 16 Sep 2010) | 1 line
RF-9193
.......
r19225 | konstantin.mishin | 2010-09-16 21:08:24 +0300 (Thu, 16 Sep 2010) | 1 line
RF-9200
.......
r19244 | konstantin.mishin | 2010-09-17 20:50:16 +0300 (Fri, 17 Sep 2010) | 1 line
RF-9194
.......
r19245 | konstantin.mishin | 2010-09-17 20:52:10 +0300 (Fri, 17 Sep 2010) | 1 line
RF-9194
.......
r19246 | konstantin.mishin | 2010-09-17 20:53:39 +0300 (Fri, 17 Sep 2010) | 1 line
RF-9195
.......
r19247 | konstantin.mishin | 2010-09-17 21:10:07 +0300 (Fri, 17 Sep 2010) | 1 line
RF-9200
.......
r19271 | konstantin.mishin | 2010-09-21 14:20:51 +0300 (Tue, 21 Sep 2010) | 1 line
RF-9194
.......
r19272 | konstantin.mishin | 2010-09-21 14:26:44 +0300 (Tue, 21 Sep 2010) | 1 line
RF-9195
.......
r19273 | konstantin.mishin | 2010-09-21 14:28:55 +0300 (Tue, 21 Sep 2010) | 1 line
RF-9200
.......
r19278 | konstantin.mishin | 2010-09-21 17:44:03 +0300 (Tue, 21 Sep 2010) | 1 line
RF-9195
.......
Property changes on: trunk
___________________________________________________________________
Name: svnmerge-integrated
- /branches/RF-9151:1-19212
+ /branches/RF-9151:1-19279
Modified:
trunk/examples/input-demo/src/main/java/org/richfaces/demo/InputNumberSliderBean.java
===================================================================
---
trunk/examples/input-demo/src/main/java/org/richfaces/demo/InputNumberSliderBean.java 2010-09-21
14:57:06 UTC (rev 19279)
+++
trunk/examples/input-demo/src/main/java/org/richfaces/demo/InputNumberSliderBean.java 2010-09-21
15:23:14 UTC (rev 19280)
@@ -21,6 +21,8 @@
*/
package org.richfaces.demo;
+import java.util.Date;
+
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
@@ -160,4 +162,8 @@
public int getInputSize() {
return inputSize;
}
+
+ public Date getDate() {
+ return new Date();
+ }
}
Modified: trunk/examples/input-demo/src/main/webapp/index.xhtml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/index.xhtml 2010-09-21 14:57:06 UTC (rev
19279)
+++ trunk/examples/input-demo/src/main/webapp/index.xhtml 2010-09-21 15:23:14 UTC (rev
19280)
@@ -10,6 +10,7 @@
<ul>
<li><h:link
outcome="inplaceInput">rich:inplaceInput</h:link></li>
<li><h:link
outcome="inputNumberSlider">rich:inputNumberSlider</h:link></li>
+ <li><h:link
outcome="inputNumberSpinner">rich:inputNumberSpinner</h:link></li>
<li><h:link
outcome="autocomplete">rich:autocomplete</h:link></li>
</ul>
Copied: trunk/examples/input-demo/src/main/webapp/inputNumberSpinner.xhtml (from rev
19273, branches/RF-9151/examples/input-demo/src/main/webapp/inputNumberSpinner.xhtml)
===================================================================
--- trunk/examples/input-demo/src/main/webapp/inputNumberSpinner.xhtml
(rev 0)
+++ trunk/examples/input-demo/src/main/webapp/inputNumberSpinner.xhtml 2010-09-21 15:23:14
UTC (rev 19280)
@@ -0,0 +1,98 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:ins="http://richfaces.org/input">
+<!--
+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.
+-->
+ <h:head>
+ <title>Richfaces InputNumberSlider Demo</title>
+ </h:head>
+ <h:body>
+ <h:form id="form">
+ <h:outputText value="Skin: "/>
+ <h:selectOneMenu value="#{skinBean.skin}"
onchange="submit();">
+ <f:selectItems value="#{skinBean.skins}"/>
+ </h:selectOneMenu>
+ <br />
+ <h:outputText value="Date: "/>
+ <h:outputText id="date" value="#{inputNumberSliderBean.date}"
/>
+ <br />
+ <ins:inputNumberSpinner id="ins"
value="#{inputNumberSliderBean.value}"
accesskey="#{inputNumberSliderBean.accesskey}"
cycled="#{inputNumberSliderBean.showInput}"
+ disableBrowserAutoComplete="#{inputNumberSliderBean.showArrows}"
disabled="#{inputNumberSliderBean.disabled}"
enableManualInput="#{inputNumberSliderBean.enableManualInput}"
+ inputSize="#{inputNumberSliderBean.inputSize}"
maxValue="#{inputNumberSliderBean.maxValue}"
minValue="#{inputNumberSliderBean.minValue}"
+ step="#{inputNumberSliderBean.step}">
+ <f:ajax render="date" />
+ </ins:inputNumberSpinner>
+ <br />
+ <h:outputText value="Accesskey: " />
+ <h:inputText value="#{inputNumberSliderBean.accesskey}">
+ <f:ajax render="ins"/>
+ </h:inputText>
+ <br />
+ <h:outputText value="Cycled: "/>
+ <h:selectBooleanCheckbox value="#{inputNumberSliderBean.showInput}">
+ <f:ajax render="ins"/>
+ </h:selectBooleanCheckbox>
+ <br />
+ <h:outputText value="DisableBrowserAutoComplete: "/>
+ <h:selectBooleanCheckbox value="#{inputNumberSliderBean.showArrows}">
+ <f:ajax render="ins"/>
+ </h:selectBooleanCheckbox>
+ <br />
+ <h:outputText value="Disabled: "/>
+ <h:selectBooleanCheckbox value="#{inputNumberSliderBean.disabled}">
+ <f:ajax render="ins"/>
+ </h:selectBooleanCheckbox>
+ <br />
+ <h:outputText value="EnableManualInput: "/>
+ <h:selectBooleanCheckbox
value="#{inputNumberSliderBean.enableManualInput}">
+ <f:ajax render="ins"/>
+ </h:selectBooleanCheckbox>
+ <br />
+ <h:outputText value="InputSize: "/>
+ <h:inputText value="#{inputNumberSliderBean.inputSize}">
+ <f:ajax render="ins"/>
+ </h:inputText>
+ <br />
+ <h:outputText value="MaxValue: "/>
+ <h:inputText value="#{inputNumberSliderBean.maxValue}">
+ <f:ajax render="ins"/>
+ </h:inputText>
+ <br />
+ <h:outputText value="MinValue: "/>
+ <h:inputText value="#{inputNumberSliderBean.minValue}">
+ <f:ajax render="ins"/>
+ </h:inputText>
+ <br />
+ <h:outputText value="Step: "/>
+ <h:inputText value="#{inputNumberSliderBean.step}">
+ <f:ajax render="ins"/>
+ </h:inputText>
+ </h:form>
+ </h:body>
+</html>
Modified: trunk/ui/input/ui/src/main/config/faces-config.xml
===================================================================
--- trunk/ui/input/ui/src/main/config/faces-config.xml 2010-09-21 14:57:06 UTC (rev
19279)
+++ trunk/ui/input/ui/src/main/config/faces-config.xml 2010-09-21 15:23:14 UTC (rev
19280)
@@ -237,6 +237,296 @@
</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>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>
Copied: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/ArrowBase.java
(from rev 19273,
branches/RF-9151/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/ArrowBase.java)
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/ArrowBase.java
(rev 0)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/ArrowBase.java 2010-09-21
15:23:14 UTC (rev 19280)
@@ -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:
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowBase.java
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowBase.java 2010-09-21
14:57:06 UTC (rev 19279)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowBase.java 2010-09-21
15:23:14 UTC (rev 19280)
@@ -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:
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBase.java
(from rev 19273,
branches/RF-9151/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBase.java)
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBase.java
(rev 0)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBase.java 2010-09-21
15:23:14 UTC (rev 19280)
@@ -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:
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBottom.java
(from rev 19273,
branches/RF-9151/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBottom.java)
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBottom.java
(rev 0)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowBottom.java 2010-09-21
15:23:14 UTC (rev 19280)
@@ -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:
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowTop.java
(from rev 19273,
branches/RF-9151/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowTop.java)
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowTop.java
(rev 0)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerArrowTop.java 2010-09-21
15:23:14 UTC (rev 19280)
@@ -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:
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowBottom.java
(from rev 19273,
branches/RF-9151/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowBottom.java)
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowBottom.java
(rev 0)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowBottom.java 2010-09-21
15:23:14 UTC (rev 19280)
@@ -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:
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowTop.java
(from rev 19273,
branches/RF-9151/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowTop.java)
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowTop.java
(rev 0)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SpinnerDisabledArrowTop.java 2010-09-21
15:23:14 UTC (rev 19280)
@@ -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");
+ }
+}
Copied:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.ecss
(from rev 19273,
branches/RF-9151/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.ecss)
===================================================================
---
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.ecss
(rev 0)
+++
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.ecss 2010-09-21
15:23:14 UTC (rev 19280)
@@ -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:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.js
(from rev 19273,
branches/RF-9151/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.js)
===================================================================
---
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.js
(rev 0)
+++
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.js 2010-09-21
15:23:14 UTC (rev 19280)
@@ -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: trunk/ui/input/ui/src/main/templates/inputnumberspinner.template.xml (from rev
19273, branches/RF-9151/ui/input/ui/src/main/templates/inputnumberspinner.template.xml)
===================================================================
--- trunk/ui/input/ui/src/main/templates/inputnumberspinner.template.xml
(rev 0)
+++ trunk/ui/input/ui/src/main/templates/inputnumberspinner.template.xml 2010-09-21
15:23:14 UTC (rev 19280)
@@ -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>