[richfaces-svn-commits] JBoss Rich Faces SVN: r18642 - in trunk/ui/input: ui/src/main and 5 other directories.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Sun Aug 15 15:31:56 EDT 2010
Author: nbelaevski
Date: 2010-08-15 15:31:56 -0400 (Sun, 15 Aug 2010)
New Revision: 18642
Added:
trunk/ui/input/api/src/main/java/org/richfaces/component/InputNumberSliderInputPosition.java
trunk/ui/input/ui/src/main/config/
trunk/ui/input/ui/src/main/config/faces-config.xml
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InputNumberSliderRendererBase.java
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/SliderArrowBottom.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowLeft.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowRight.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderDisabledArrowBottom.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderDisabledArrowLeft.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderDisabledArrowRight.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderSelectedArrowBottom.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderSelectedArrowLeft.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderSelectedArrowRight.java
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/bg.gif
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.ecss
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js
trunk/ui/input/ui/src/main/templates/input.template.inc
trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml
Log:
InputNumberSlider: moving to main area
Copied: trunk/ui/input/api/src/main/java/org/richfaces/component/InputNumberSliderInputPosition.java (from rev 18639, sandbox/trunk/ui/inputs/inputnumberslider/src/main/java/org/richfaces/component/InputNumberSliderInputPosition.java)
===================================================================
--- trunk/ui/input/api/src/main/java/org/richfaces/component/InputNumberSliderInputPosition.java (rev 0)
+++ trunk/ui/input/api/src/main/java/org/richfaces/component/InputNumberSliderInputPosition.java 2010-08-15 19:31:56 UTC (rev 18642)
@@ -0,0 +1,28 @@
+/*
+ * 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;
+
+public enum InputNumberSliderInputPosition {
+ top, right, bottom, left;
+
+ public static final InputNumberSliderInputPosition DEFAULT = right;
+}
Copied: trunk/ui/input/ui/src/main/config/faces-config.xml (from rev 18639, sandbox/trunk/ui/inputs/inputnumberslider/src/main/config/faces-config.xml)
===================================================================
--- trunk/ui/input/ui/src/main/config/faces-config.xml (rev 0)
+++ trunk/ui/input/ui/src/main/config/faces-config.xml 2010-08-15 19:31:56 UTC (rev 18642)
@@ -0,0 +1,246 @@
+<?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.
+-->
+<faces-config version="2.0"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+ xmlns="http://java.sun.com/xml/ns/javaee" xmlns:cdk="http://richfaces.org/cdk/extensions"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <component>
+ <component-type>org.richfaces.InputNumberSlider</component-type>
+ <component-class>org.richfaces.component.html.HtmlInputNumberSlider</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>decreaseClass</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>decreaseSelectedClass</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>delay</property-name>
+ <property-class>int</property-class>
+ <default-value>200</default-value>
+ <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>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>handleClass</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>handleSelectedClass</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>increaseClass</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>increaseSelectedClass</property-name>
+ <property-class>java.lang.String</property-class>
+ <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>inputPosition</property-name>
+ <property-class>org.richfaces.component.InputNumberSliderInputPosition</property-class>
+ <default-value>InputNumberSliderInputPosition.DEFAULT</default-value>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>inputSize</property-name>
+ <property-class>int</property-class>
+ <default-value>3</default-value>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>maxValue</property-name>
+ <property-class>java.lang.Number</property-class>
+ <default-value>100</default-value>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>maxlength</property-name>
+ <property-class>int</property-class>
+ <default-value>Integer.MIN_VALUE</default-value>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>minValue</property-name>
+ <property-class>java.lang.Number</property-class>
+ <default-value>0</default-value>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>showArrows</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>showBoundaryValues</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>showInput</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>showToolTip</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>step</property-name>
+ <property-class>java.lang.Number</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>
+ <property>
+ <property-name>toolTipClass</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>trackClass</property-name>
+ <property-class>java.lang.String</property-class>
+ <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.InputNumberSliderRenderer</cdk:renderer-type>
+ <cdk:tag>
+ <cdk:tag-name>inputNumberSlider</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>
+ <cdk:uri>http://richfaces.org/input</cdk:uri>
+ </cdk:taglib>
+ </faces-config-extension>
+</faces-config>
Copied: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InputNumberSliderRendererBase.java (from rev 18639, sandbox/trunk/ui/inputs/inputnumberslider/src/main/java/org/richfaces/renderkit/InputNumberSliderRendererBase.java)
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InputNumberSliderRendererBase.java (rev 0)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InputNumberSliderRendererBase.java 2010-08-15 19:31:56 UTC (rev 18642)
@@ -0,0 +1,43 @@
+/*
+ * 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 javax.faces.component.UIComponent;
+
+import org.richfaces.component.InputNumberSliderInputPosition;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public abstract class InputNumberSliderRendererBase extends InputRendererBase {
+
+ protected boolean isInputPosition(UIComponent component, String name) {
+ InputNumberSliderInputPosition type = (InputNumberSliderInputPosition) component.getAttributes().get("inputPosition");
+ if (type == null) {
+ type = InputNumberSliderInputPosition.DEFAULT;
+ }
+
+ return type == InputNumberSliderInputPosition.valueOf(name);
+ }
+
+}
Copied: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowBase.java (from rev 18636, sandbox/trunk/ui/inputs/inputnumberslider/src/main/java/org/richfaces/renderkit/html/images/SliderArrowBase.java)
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowBase.java (rev 0)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowBase.java 2010-08-15 19:31:56 UTC (rev 18642)
@@ -0,0 +1,98 @@
+/*
+ * 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
+ *
+ */
+ at DynamicResource
+public abstract class SliderArrowBase implements Java2DUserResource, StateHolderResource {
+
+ 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;
+ }
+
+ 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/SliderArrowBottom.java (from rev 18636, sandbox/trunk/ui/inputs/inputnumberslider/src/main/java/org/richfaces/renderkit/html/images/SliderArrowBottom.java)
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowBottom.java (rev 0)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowBottom.java 2010-08-15 19:31:56 UTC (rev 18642)
@@ -0,0 +1,42 @@
+/*
+ * 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 SliderArrowBottom extends SliderArrowBase {
+
+ @Override
+ public void paint(Graphics2D graphics2d, Dimension dimension) {
+ super.paint(graphics2d, dimension);
+ graphics2d.drawLine(0, 1, 6, 1);
+ graphics2d.drawLine(1, 2, 5, 2);
+ graphics2d.drawLine(2, 3, 4, 3);
+ graphics2d.drawLine(3, 4, 3, 4);
+ }
+}
Copied: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowLeft.java (from rev 18636, sandbox/trunk/ui/inputs/inputnumberslider/src/main/java/org/richfaces/renderkit/html/images/SliderArrowLeft.java)
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowLeft.java (rev 0)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowLeft.java 2010-08-15 19:31:56 UTC (rev 18642)
@@ -0,0 +1,42 @@
+/*
+ * 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 SliderArrowLeft extends SliderArrowBase {
+
+ @Override
+ public void paint(Graphics2D graphics2d, Dimension dimension) {
+ super.paint(graphics2d, dimension);
+ graphics2d.drawLine(4, 0, 4, 6);
+ graphics2d.drawLine(3, 1, 3, 5);
+ graphics2d.drawLine(2, 2, 2, 4);
+ graphics2d.drawLine(1, 3, 1, 3);
+ }
+}
Copied: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowRight.java (from rev 18636, sandbox/trunk/ui/inputs/inputnumberslider/src/main/java/org/richfaces/renderkit/html/images/SliderArrowRight.java)
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowRight.java (rev 0)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderArrowRight.java 2010-08-15 19:31:56 UTC (rev 18642)
@@ -0,0 +1,42 @@
+/*
+ * 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 SliderArrowRight extends SliderArrowBase {
+
+ @Override
+ public void paint(Graphics2D graphics2d, Dimension dimension) {
+ super.paint(graphics2d, dimension);
+ graphics2d.drawLine(2, 0, 2, 6);
+ graphics2d.drawLine(3, 1, 3, 5);
+ graphics2d.drawLine(4, 2, 4, 4);
+ graphics2d.drawLine(5, 3, 5, 3);
+ }
+}
Copied: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderDisabledArrowBottom.java (from rev 18636, sandbox/trunk/ui/inputs/inputnumberslider/src/main/java/org/richfaces/renderkit/html/images/SliderDisabledArrowBottom.java)
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderDisabledArrowBottom.java (rev 0)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderDisabledArrowBottom.java 2010-08-15 19:31:56 UTC (rev 18642)
@@ -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 SliderDisabledArrowBottom extends SliderArrowBottom {
+
+ public SliderDisabledArrowBottom() {
+ setColorName("tabDisabledTextColor");
+ }
+}
Copied: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderDisabledArrowLeft.java (from rev 18636, sandbox/trunk/ui/inputs/inputnumberslider/src/main/java/org/richfaces/renderkit/html/images/SliderDisabledArrowLeft.java)
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderDisabledArrowLeft.java (rev 0)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderDisabledArrowLeft.java 2010-08-15 19:31:56 UTC (rev 18642)
@@ -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 SliderDisabledArrowLeft extends SliderArrowLeft {
+
+ public SliderDisabledArrowLeft() {
+ setColorName("tabDisabledTextColor");
+ }
+}
Copied: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderDisabledArrowRight.java (from rev 18636, sandbox/trunk/ui/inputs/inputnumberslider/src/main/java/org/richfaces/renderkit/html/images/SliderDisabledArrowRight.java)
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderDisabledArrowRight.java (rev 0)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderDisabledArrowRight.java 2010-08-15 19:31:56 UTC (rev 18642)
@@ -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 SliderDisabledArrowRight extends SliderArrowRight {
+
+ public SliderDisabledArrowRight() {
+ setColorName("tabDisabledTextColor");
+ }
+}
Copied: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderSelectedArrowBottom.java (from rev 18636, sandbox/trunk/ui/inputs/inputnumberslider/src/main/java/org/richfaces/renderkit/html/images/SliderSelectedArrowBottom.java)
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderSelectedArrowBottom.java (rev 0)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderSelectedArrowBottom.java 2010-08-15 19:31:56 UTC (rev 18642)
@@ -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 SliderSelectedArrowBottom extends SliderArrowBottom {
+
+ public SliderSelectedArrowBottom() {
+ setColorName("tipBorderColor");
+ }
+}
Copied: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderSelectedArrowLeft.java (from rev 18636, sandbox/trunk/ui/inputs/inputnumberslider/src/main/java/org/richfaces/renderkit/html/images/SliderSelectedArrowLeft.java)
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderSelectedArrowLeft.java (rev 0)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderSelectedArrowLeft.java 2010-08-15 19:31:56 UTC (rev 18642)
@@ -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 SliderSelectedArrowLeft extends SliderArrowLeft {
+
+ public SliderSelectedArrowLeft() {
+ setColorName("tipBorderColor");
+ }
+}
Copied: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderSelectedArrowRight.java (from rev 18636, sandbox/trunk/ui/inputs/inputnumberslider/src/main/java/org/richfaces/renderkit/html/images/SliderSelectedArrowRight.java)
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderSelectedArrowRight.java (rev 0)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/SliderSelectedArrowRight.java 2010-08-15 19:31:56 UTC (rev 18642)
@@ -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 SliderSelectedArrowRight extends SliderArrowRight {
+
+ public SliderSelectedArrowRight() {
+ setColorName("tipBorderColor");
+ }
+}
Copied: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/bg.gif (from rev 18636, sandbox/trunk/ui/inputs/inputnumberslider/src/main/resources/META-INF/resources/bg.gif)
===================================================================
(Binary files differ)
Copied: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.ecss (from rev 18636, sandbox/trunk/ui/inputs/inputnumberslider/src/main/resources/META-INF/resources/inputNumberSlider.ecss)
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.ecss (rev 0)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.ecss 2010-08-15 19:31:56 UTC (rev 18642)
@@ -0,0 +1,128 @@
+/*
+ * 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-ins, .rf-ins-ta {
+ display: inline-block;
+}
+
+.rf-ins {
+ white-space: nowrap;
+}
+
+.rf-ins-ta {
+ width: 200px; /*TODO remove it*/
+ vertical-align: top;
+}
+
+.rf-ins-mn, .rf-ins-mx, input.rf-ins-i, .rf-ins-tt {
+ font-size: 11px;
+ font-family: arial;
+ color: #000000;
+}
+
+.rf-ins-mn, .rf-ins-mx {
+ display: block;
+ margin-bottom: 3px;
+}
+
+.rf-ins-mn {
+ border-left: 1px solid #c0c0c0;
+ padding-left: 3px;
+ float: left;
+}
+
+.rf-ins-mx {
+ border-right: 1px solid #c0c0c0;
+ padding-right: 3px;
+ float: right;
+ text-align: right;
+}
+
+.rf-ins-ci {
+ margin: 0px;
+ vertical-align: bottom;
+}
+
+input.rf-ins-i {
+ background: url("#{resource['org.richfaces.renderkit.html.images.InputBackgroundImage']}") top repeat-x #fff;
+ border: 1px inset #C0C0C0;
+ margin: 0px 10px 0px 10px;
+}
+
+.rf-ins-tt {
+ position: absolute;
+ display: none;
+ /* TODO padding: 2px;
+ border: 1px solid '#{richSkin.tipBorderColor}';
+ background-color: '#{richSkin.tipBackgroundColor}';*/
+}
+
+.rf-ins-t {
+ background: url("#{resource['org.richfaces:bg.gif']}") 1px 1px repeat-x #FFFFFF;
+ border: 1px solid #C0C0C0;
+ display: block;
+ height: 6px;
+ clear: both;
+ vertical-align: top;
+}
+
+.rf-ins-h, .rf-ins-db, .rf-ins-ib, .rf-ins-h-d, .rf-ins-db-d, .rf-ins-ib-d {
+ display: inline-block;
+ width: 7px;
+ height: 7px;
+ vertical-align: top;
+}
+
+.rf-ins-h {
+ background-image: url("#{resource['org.richfaces.renderkit.html.images.SliderArrowBottom']}");
+}
+
+.rf-ins-h-s {
+ background-image: url("#{resource['org.richfaces.renderkit.html.images.SliderSelectedArrowBottom']}");
+}
+
+.rf-ins-h-d {
+ background-image: url("#{resource['org.richfaces.renderkit.html.images.SliderDisabledArrowBottom']}");
+}
+
+.rf-ins-db {
+ background-image: url("#{resource['org.richfaces.renderkit.html.images.SliderArrowLeft']}");
+}
+
+.rf-ins-db-s {
+ background-image: url("#{resource['org.richfaces.renderkit.html.images.SliderSelectedArrowLeft']}");
+}
+
+.rf-ins-db-d {
+ background-image: url("#{resource['org.richfaces.renderkit.html.images.SliderDisabledArrowLeft']}");
+}
+
+.rf-ins-ib {
+ background-image: url("#{resource['org.richfaces.renderkit.html.images.SliderArrowRight']}");
+}
+
+.rf-ins-ib-s {
+ background-image: url("#{resource['org.richfaces.renderkit.html.images.SliderSelectedArrowRight']}");
+}
+
+.rf-ins-ib-d {
+ background-image: url("#{resource['org.richfaces.renderkit.html.images.SliderDisabledArrowRight']}");
+}
\ No newline at end of file
Copied: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js (from rev 18636, sandbox/trunk/ui/inputs/inputnumberslider/src/main/resources/META-INF/resources/inputNumberSlider.js)
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js (rev 0)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js 2010-08-15 19:31:56 UTC (rev 18642)
@@ -0,0 +1,176 @@
+/*
+ * 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.InputNumberSlider = richfaces.BaseComponent.extendClass({
+
+ name: "InputNumberSlider",
+
+ delay: 200,
+ maxValue: 100,
+ minValue: 0,
+ step: 1,
+ tabIndex: 0,
+
+ decreaseSelectedClass: "rf-ins-db-s",
+ handleSelectedClass: "rf-ins-h-s",
+ increaseSelectedClass: "rf-ins-ib-s",
+
+ 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-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.__inputHandler();
+
+ if (!this.disabled) {
+ this.decreaseButton = this.element.children(".rf-ins-db");
+ this.increaseButton = this.element.children(".rf-ins-ib");
+
+ 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));
+ this.decreaseButton.mousedown(jQuery.proxy(this.__decreaseHandler, this));
+ this.increaseButton.mousedown(jQuery.proxy(this.__increaseHandler, this));
+ this.track.mousedown(jQuery.proxy(this.__mousedownHandler, this));
+ }
+ },
+
+ decrease: function (event) {
+ this.setValue(this.value - this.step);
+ },
+
+ increase: function (event) {
+ this.setValue(this.value + this.step);
+ },
+
+ setValue: function (value) {
+ if (!this.disabled) {
+ this.__setValue(value);
+ }
+ },
+
+ __setValue: function (value) {
+ 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);
+ var left = (value - this.minValue) * (this.track.width() - this.handle.width()) / this.range;
+ this.handle.css("margin-left", left + "px");
+ this.tooltip.text(value);
+ this.tooltip.setPosition(this.handle,{from: 'LT', offset: [0, -3]}); //TODO Seems offset doesn't work now.
+ this.value = value;
+ }
+ }
+ },
+
+ __inputHandler: function () {
+ var value = Number(this.input.val());
+ if (isNaN(value)) {
+ this.input.val(this.value);
+ } else {
+ this.__setValue(value);
+ }
+ },
+
+ __keydownHandler: function (event) {
+ if (event.keyCode == 37) { //LEFT
+ this.__setValue(Number(this.input.val()) - this.step);
+ event.preventDefault();
+ } else if (event.keyCode == 39) { //RIGHT
+ this.__setValue(Number(this.input.val()) + this.step);
+ event.preventDefault();
+ }
+ },
+
+ __decreaseHandler: function (event) {
+ var component = this;
+ component.decrease();
+ this.intervalId = window.setInterval(function() {
+ component.decrease();
+ }, this.delay);
+ jQuery(document).one("mouseup", true, jQuery.proxy(this.__clearInterval, this));
+ this.decreaseButton.addClass(this.decreaseSelectedClass);
+ event.preventDefault();
+ },
+
+ __increaseHandler: function (event) {
+ var component = this;
+ component.increase();
+ this.intervalId = window.setInterval(function() {
+ component.increase();
+ }, this.delay);
+ jQuery(document).one("mouseup",jQuery.proxy(this.__clearInterval, this));
+ this.increaseButton.addClass(this.increaseSelectedClass);
+ event.preventDefault();
+ },
+
+ __clearInterval: function (event) {
+ window.clearInterval(this.intervalId);
+ if (event.data) { // decreaseButton
+ this.decreaseButton.removeClass(this.decreaseSelectedClass);
+ } else {
+ this.increaseButton.removeClass(this.increaseSelectedClass);
+ }
+ },
+
+ __mousedownHandler: function (event) {
+ this.__mousemoveHandler(event);
+ this.track.focus();
+ var jQueryDocument = jQuery(document);
+ jQueryDocument.mousemove(jQuery.proxy(this.__mousemoveHandler, this));
+ jQueryDocument.one("mouseup", jQuery.proxy(this.__mouseupHandler, this));
+ this.handle.addClass(this.handleSelectedClass);
+ this.tooltip.show();
+ },
+
+ __mousemoveHandler: function (event) {
+ var value = this.range * (event.pageX - this.track.position().left) / (this.track.width()
+ - this.handle.width()) + this.minValue;
+ this.__setValue(value);
+ event.preventDefault();
+ },
+
+ __mouseupHandler: function () {
+ this.handle.removeClass(this.handleSelectedClass);
+ this.tooltip.hide();
+ jQuery(document).unbind("mousemove", this.__mousemoveHandler);
+ }
+ });
+}(window.RichFaces, jQuery));
\ No newline at end of file
Copied: trunk/ui/input/ui/src/main/templates/input.template.inc (from rev 18636, sandbox/trunk/ui/inputs/inputnumberslider/src/main/templates/input.template.inc)
===================================================================
--- trunk/ui/input/ui/src/main/templates/input.template.inc (rev 0)
+++ trunk/ui/input/ui/src/main/templates/input.template.inc 2010-08-15 19:31:56 UTC (rev 18642)
@@ -0,0 +1,30 @@
+<!--
+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.
+-->
+<span class="rf-ins-ci">
+ <input xmlns:cdk="http://richfaces.org/cdk/core" name="#{clientId}" type="text"
+ class="rf-ins-i #{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
Copied: trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml (from rev 18638, sandbox/trunk/ui/inputs/inputnumberslider/src/main/templates/inputnumberslider.template.xml)
===================================================================
--- trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml (rev 0)
+++ trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml 2010-08-15 19:31:56 UTC (rev 18642)
@@ -0,0 +1,88 @@
+<?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://richfaces.org/cdk/xhtml-el" xmlns:cdk="http://richfaces.org/cdk/core"
+ xmlns:cc="http://richfaces.org/cdk/jsf/composite" xmlns:c="http://richfaces.org/cdk/jstl/core"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.InputNumberSliderRenderer</cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.InputNumberSliderRendererBase</cdk:superclass>
+ <cdk:component-family>javax.faces.Input</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.InputNumberSliderRenderer</cdk:renderer-type>
+ <cdk:resource-dependency library="org.richfaces" name="inputNumberSlider.ecss" />
+ <cdk:resource-dependency library="javax.faces" name="jsf.js" />
+ <cdk:resource-dependency name="jquery.js" />
+ <cdk:resource-dependency name="jquery.position.js" />
+ <cdk:resource-dependency name="richfaces.js" />
+ <cdk:resource-dependency name="richfaces-base-component.js" />
+ <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">
+ <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']}">
+ <br />
+ </c:if>
+ </c:if>
+ <c:if test="#{component.attributes['showArrows']}">
+ <span class="rf-ins-db#{component.attributes['disabled'] ? '-d' : ''} #{component.attributes['decreaseClass']}" />
+ </c:if>
+ <span class="rf-ins-ta">
+ <c:if test="#{component.attributes['showBoundaryValues']}">
+ <span class="rf-ins-mn">#{component.attributes['minValue']}</span>
+ <span class="rf-ins-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>
+ </span>
+ <c:if test="#{component.attributes['showArrows']}">
+ <span class="rf-ins-ib#{component.attributes['disabled'] ? '-d' : ''} #{component.attributes['increaseClass']}" />
+ </c:if>
+ <c:if test="#{isInputPosition(component, 'right') || isInputPosition(component, 'bottom')}">
+ <c:if test="#{isInputPosition(component, 'bottom') and component.attributes['showInput']}">
+ <br />
+ </c:if>
+ <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>
+ </c:if>
+ <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']},
+ step: #{component.attributes['step']},
+ tabIndex: #{RenderKitUtils.shouldRenderAttribute(component.attributes['tabindex']) ? component.attributes['tabindex'] : 'null'}
+ }, {
+ decreaseSelectedClass: '#{component.attributes['decreaseSelectedClass']}',
+ handleSelectedClass: '#{component.attributes['handleSelectedClass']}',
+ increaseSelectedClass: '#{component.attributes['increaseSelectedClass']}'
+ });</script>
+ </span>
+ </cc:implementation>
+</cdk:root>
More information about the richfaces-svn-commits
mailing list