Author: nbelaevski
Date: 2010-07-12 09:59:28 -0400 (Mon, 12 Jul 2010)
New Revision: 17954
Added:
root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/html/
root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/html/images/
root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/html/images/ComboBoxBaseGradient.java
root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/html/images/ComboBoxButtonGradient.java
root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/html/images/ComboBoxFieldGradient.java
Removed:
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/combo_list_button.png
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/combo_list_field.png
Modified:
root/ui-sandbox/inputs/trunk/combobox/pom.xml
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/ComboBox.ecss
Log:
ComboBox skinning
Modified: root/ui-sandbox/inputs/trunk/combobox/pom.xml
===================================================================
--- root/ui-sandbox/inputs/trunk/combobox/pom.xml 2010-07-12 13:44:49 UTC (rev 17953)
+++ root/ui-sandbox/inputs/trunk/combobox/pom.xml 2010-07-12 13:59:28 UTC (rev 17954)
@@ -66,7 +66,6 @@
<dependency>
<groupId>${jsf2.api.groupid}</groupId>
<artifactId>${jsf2.api.artifactid}</artifactId>
- <version>2.0.2</version>
<!--
TODO: remove this dependency it should inherited from perent poms
-->
Added:
root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/html/images/ComboBoxBaseGradient.java
===================================================================
---
root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/html/images/ComboBoxBaseGradient.java
(rev 0)
+++
root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/html/images/ComboBoxBaseGradient.java 2010-07-12
13:59:28 UTC (rev 17954)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.richfaces.renderkit.html.images;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+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.CacheableResource;
+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 Nick Belaevski
+ *
+ */
+@DynamicResource
+public abstract class ComboBoxBaseGradient implements Java2DUserResource,
CacheableResource, StateHolderResource {
+
+ private static final Dimension DIMENSION = new Dimension(18, 8);
+
+ private String topColorSkinParameter;
+
+ private String bottomColorSkinParameter;
+
+ private Color topColor;
+
+ private Color bottomColor;
+
+ public Map<String, String> getResponseHeaders() {
+ return null;
+ }
+
+ public Date getLastModified() {
+ return null;
+ }
+
+ public ImageType getImageType() {
+ return ImageType.PNG;
+ }
+
+ public Dimension getDimension() {
+ return DIMENSION;
+ }
+
+ public void paint(Graphics2D graphics2d, Dimension dimension) {
+ GradientPaint paint = new GradientPaint(0, 0, topColor, 0, dimension.height,
bottomColor);
+ graphics2d.setPaint(paint);
+ graphics2d.fill(new Rectangle(dimension));
+ }
+
+ public boolean isCacheable(FacesContext context) {
+ return true;
+ }
+
+ public Date getExpires(FacesContext context) {
+ return null;
+ }
+
+ public int getTimeToLive(FacesContext context) {
+ return 0;
+ }
+
+ public String getEntityTag(FacesContext context) {
+ return null;
+ }
+
+ public void writeState(FacesContext context, DataOutput dataOutput) throws
IOException {
+ Skin skin = SkinFactory.getInstance().getSkin(context);
+
+ Integer topColor = skin.getColorParameter(context, topColorSkinParameter);
+ Integer bottomColor = skin.getColorParameter(context, bottomColorSkinParameter);
+
+ dataOutput.writeInt(topColor);
+ dataOutput.writeInt(bottomColor);
+ }
+
+ public void readState(FacesContext context, DataInput dataInput) throws IOException
{
+ topColor = new Color(dataInput.readInt());
+ bottomColor = new Color(dataInput.readInt());
+ }
+
+ public boolean isTransient() {
+ return false;
+ }
+
+ protected void setTopColorSkinParameter(String topColorSkinParameter) {
+ this.topColorSkinParameter = topColorSkinParameter;
+ }
+
+ protected void setBottomColorSkinParameter(String bottomColorSkinParameter) {
+ this.bottomColorSkinParameter = bottomColorSkinParameter;
+ }
+}
Added:
root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/html/images/ComboBoxButtonGradient.java
===================================================================
---
root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/html/images/ComboBoxButtonGradient.java
(rev 0)
+++
root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/html/images/ComboBoxButtonGradient.java 2010-07-12
13:59:28 UTC (rev 17954)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.richfaces.renderkit.html.images;
+
+import org.richfaces.resource.DynamicResource;
+import org.richfaces.skin.Skin;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@DynamicResource
+public class ComboBoxButtonGradient extends ComboBoxBaseGradient {
+
+ public ComboBoxButtonGradient() {
+ setTopColorSkinParameter(Skin.HEADER_GRADIENT_COLOR);
+ setBottomColorSkinParameter(Skin.HEADER_BACKGROUND_COLOR);
+ }
+
+}
Added:
root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/html/images/ComboBoxFieldGradient.java
===================================================================
---
root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/html/images/ComboBoxFieldGradient.java
(rev 0)
+++
root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/html/images/ComboBoxFieldGradient.java 2010-07-12
13:59:28 UTC (rev 17954)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.richfaces.renderkit.html.images;
+
+import org.richfaces.resource.DynamicResource;
+import org.richfaces.skin.Skin;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@DynamicResource
+public class ComboBoxFieldGradient extends ComboBoxBaseGradient {
+
+ public ComboBoxFieldGradient() {
+ setTopColorSkinParameter(Skin.ADDITIONAL_BACKGROUND_COLOR);
+ setBottomColorSkinParameter(Skin.CONTROL_BACKGROUND_COLOR);
+ }
+}
Modified:
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/ComboBox.ecss
===================================================================
---
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/ComboBox.ecss 2010-07-12
13:44:49 UTC (rev 17953)
+++
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/ComboBox.ecss 2010-07-12
13:59:28 UTC (rev 17954)
@@ -18,33 +18,33 @@
}
input.cb_font {
- color: #000000 /*generalTextColor*/
+ color: '#{richSkin.generalTextColor}';
}
input.cb_input {
- border: 0px;
+ border-width: 0px;
background: none;
width: 100%;
}
.cb_field {
position: inline-block;
- border: 1px solid #A6A6A6 /*panelBorderColor*/;
+ border-color: '#{richSkin.panelBorderColor}';
display: inline-block;
- background-image:
"url(#{resource['org.richfaces:combo_list_field.png']})";
+ background-image:
"url(#{resource['org.richfaces.renderkit.html.images.ComboBoxFieldGradient']})";
background-repeat: repeat-x;
background-position: top left;
- /*gradient - from additionalBackgroundColor to controlBackgroundColor, background-color
- controlBackgroundColor*/;
}
.cb_button {
- background-image:
"url(#{resource['org.richfaces:combo_list_button.png']})";
+ background-image:
"url(#{resource['org.richfaces.renderkit.html.images.ComboBoxButtonGradient']})";
background-repeat: repeat-x;
background-position: top left;
background-color: #C0D1E7;
- /*gradient - from headerGradientColor to headerBackgroundColor, background-color -
headerBackgroundColor*/;
text-align: center;
- border-left: 1px solid #A6A6A6 /*panelBorderColor*/;
+ border-left-style: solid;
+ border-left-width: 1px;
+ border-left-color: '#{richSkin.panelBorderColor}';
width: 15px;
position: absolute;
top: 0px;
@@ -69,9 +69,11 @@
} /*DDL is hidden!!!!!*/
.cb_list_decoration {
- border: 1px solid #A6A6A6 /*panelBorderColor*/;
+ border-width: 1px;
+ border-style: solid;
+ border-color: '#{richSkin.panelBorderColor}';
padding: 0px;
- background: #FFFFFF; /*tableBackgroundColor*/
+ background-color: '#{richSkin.tableBackgroundColor}';
}
.cb_list_scroll {
@@ -90,7 +92,9 @@
padding: 1px;
width: 100%;
background-color: #DFE8F6;
- border: 1px dotted #a3bae9; /*generalTextColor*/
+ border-width: 1px;
+ border-style: dotted;
+ border-color: '#{richSkin.generalTextColor}';
}
.cb_shadow {
Deleted:
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/combo_list_button.png
===================================================================
(Binary files differ)
Deleted:
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/combo_list_field.png
===================================================================
(Binary files differ)