Author: nbelaevski
Date: 2008-02-29 14:14:12 -0500 (Fri, 29 Feb 2008)
New Revision: 6467
Added:
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/ImportResourceElement.java
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/BaseControlBackgroundImage.java
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/ButtonBackgroundImage.java
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/InputBackgroundImage.java
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java
trunk/framework/api/src/main/java/org/richfaces/skin/Skin.java
trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/HtmlCompiler.java
trunk/framework/impl/src/main/java/org/ajax4jsf/util/Zipper2.java
Log:
http://jira.jboss.com/jira/browse/RF-2138
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java
===================================================================
---
trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java 2008-02-29
18:58:50 UTC (rev 6466)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java 2008-02-29
19:14:12 UTC (rev 6467)
@@ -43,11 +43,23 @@
public static final String LOAD_ALL = "ALL";
public static final String COMMON_FRAMEWORK_SCRIPT =
"/org/ajax4jsf/framework.pack.js";
public static final String COMMON_UI_SCRIPT = "/org/richfaces/ui.pack.js";
- public static final String COMMON_STYLE = "/org/richfaces/skin.xcss";
+ public static final String COMMON_STYLE_PREFIX = "/org/richfaces/skin";
+ public static final String COMMON_STYLE_EXTENSION = ".xcss";
+ public static final String COMMON_STYLE = COMMON_STYLE_PREFIX + COMMON_STYLE_EXTENSION;
public static final String LOAD_STYLE_STRATEGY_PARAM =
"org.richfaces.LoadStyleStrategy";
public static final String LOAD_SCRIPT_STRATEGY_PARAM =
"org.richfaces.LoadScriptStrategy";
- /**
+ public static final String STD_CONTROLS_SKINNING_PARAM =
"org.richfaces.CONTROL_SKINNING";
+ public static final String STD_CONTROLS_SKINNING_CLASSES_PARAM =
"org.richfaces.CONTROL_SKINNING_CLASSES";
+ public static final String ENABLE = "enable";
+
+ public static final String STD_CONTROLS_BASIC_STYLE =
"/org/richfaces/renderkit/html/css/basic.xcss";
+ public static final String STD_CONTROLS_BASIC_CLASSES_STYLE =
"/org/richfaces/renderkit/html/css/basic_classes.xcss";
+
+ public static final String STD_CONTROLS_EXTENDED_STYLE =
"/org/richfaces/renderkit/html/css/extended.xcss";
+ public static final String STD_CONTROLS_EXTENDED_CLASSES_STYLE =
"/org/richfaces/renderkit/html/css/extended_classes.xcss";
+
+ /**
* Get application start time for check resources modification time.
*
* @return application start time in msec's
Modified: trunk/framework/api/src/main/java/org/richfaces/skin/Skin.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/skin/Skin.java 2008-02-29 18:58:50 UTC
(rev 6466)
+++ trunk/framework/api/src/main/java/org/richfaces/skin/Skin.java 2008-02-29 19:14:12 UTC
(rev 6467)
@@ -241,6 +241,14 @@
public static final String panelTextColor = "panelTextColor";
+ public static final String headerGradientColor = "headerGradientColor";
+
+ public static final String additionalBackgroundColor =
"additionalBackgroundColor";
+
+ public static final String controlBackgroundColor = "controlBackgroundColor";
+
+ public static final String generalSizeFont = "generalSizeFont";
+
public static final String loadStyleSheets = "loadStyleSheets";
// Preferable parameters
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2008-02-29
18:58:50 UTC (rev 6466)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2008-02-29
19:14:12 UTC (rev 6467)
@@ -32,6 +32,7 @@
import java.util.Locale;
import java.util.Map;
import java.util.Set;
+import java.util.regex.Pattern;
import javax.faces.FacesException;
import javax.faces.FactoryFinder;
@@ -77,8 +78,13 @@
*
*/
public class AjaxContextImpl extends AjaxContext {
+
public static final String RESOURCES_PROCESSED =
"org.ajax4jsf.framework.HEADER_PROCESSED";
+ //we do not apply extended CSS styling for control for Opera & Safari
+ //as they have their own advanced styling
+ private static final Pattern USER_AGENTS = Pattern.compile(" AppleWebKit/|^Opera/|
Opera ");
+
private static final Log log = LogFactory.getLog(AjaxContext.class);
private static ComponentInvoker invoker;
@@ -409,29 +415,95 @@
}
}
}
+
+ boolean useStdControlsSkinning = false;
+
+ String stdControlsSkinning =
externalContext.getInitParameter(InternetResourceBuilder.STD_CONTROLS_SKINNING_PARAM);
+ if (stdControlsSkinning != null && stdControlsSkinning.length() != 0) {
+ useStdControlsSkinning =
InternetResourceBuilder.ENABLE.equals(stdControlsSkinning);
+ }
+
+ boolean useStdControlsSkinningClasses = true;
+
+ String stdControlsSkinningClasses =
externalContext.getInitParameter(InternetResourceBuilder.STD_CONTROLS_SKINNING_CLASSES_PARAM);
+ if (stdControlsSkinningClasses != null && stdControlsSkinningClasses.length()
!= 0) {
+ useStdControlsSkinningClasses =
InternetResourceBuilder.ENABLE.equals(stdControlsSkinningClasses);
+ }
+
+ boolean useExtendedSkinning = isExtendedSkinningEnabled(externalContext);
+
String styleStrategy = externalContext
.getInitParameter(InternetResourceBuilder.LOAD_STYLE_STRATEGY_PARAM);
- if (null != styleStrategy) {
- if (InternetResourceBuilder.LOAD_NONE.equals(styleStrategy)) {
- viewResources.setProcessStyles(false);
- } else if (InternetResourceBuilder.LOAD_ALL
- .equals(styleStrategy)) {
- viewResources.setProcessStyles(false);
- try {
- viewResources
- .addStyle(internetResourceBuilder
- .createResource(
- this,
- InternetResourceBuilder.COMMON_STYLE)
- .getUri(context, null));
+
+ if (InternetResourceBuilder.LOAD_NONE.equals(styleStrategy)) {
+ viewResources.setProcessStyles(false);
+ } else if (InternetResourceBuilder.LOAD_ALL
+ .equals(styleStrategy)) {
+ viewResources.setProcessStyles(false);
+
+ String commonStyle = InternetResourceBuilder.COMMON_STYLE_PREFIX;
+
+ if (useStdControlsSkinning || useStdControlsSkinningClasses) {
+ if (useExtendedSkinning) {
+ commonStyle += "-ext";
+ } else {
+ commonStyle += "-bas";
+ }
- } catch (ResourceNotFoundException e) {
- if(log.isWarnEnabled()){
- log.warn("No aggregated stylesheet found "+e.getMessage());
- }
+ if (useStdControlsSkinning && useStdControlsSkinningClasses) {
+ commonStyle += "-both";
+ } else if (useStdControlsSkinning) {
+ commonStyle += "-styles";
+ } else if (useStdControlsSkinningClasses) {
+ commonStyle += "-classes";
}
}
+
+ commonStyle += InternetResourceBuilder.COMMON_STYLE_EXTENSION;
+
+ try {
+ viewResources
+ .addStyle(internetResourceBuilder
+ .createResource(
+ this,
+ commonStyle)
+ .getUri(context, null));
+
+ } catch (ResourceNotFoundException e) {
+ if(log.isWarnEnabled()){
+ log.warn("No aggregated stylesheet found "+e.getMessage());
+ }
+ }
+ } else {
+ if (useStdControlsSkinning) {
+ viewResources.addStyle(
+ internetResourceBuilder.createResource(
+ this, InternetResourceBuilder.STD_CONTROLS_BASIC_STYLE)
+ .getUri(context, null));
+
+ if (useExtendedSkinning) {
+ viewResources.addStyle(
+ internetResourceBuilder.createResource(
+ this, InternetResourceBuilder.STD_CONTROLS_EXTENDED_STYLE)
+ .getUri(context, null));
+ }
+ }
+
+ if (useStdControlsSkinningClasses) {
+ viewResources.addStyle(
+ internetResourceBuilder.createResource(
+ this, InternetResourceBuilder.STD_CONTROLS_BASIC_CLASSES_STYLE)
+ .getUri(context, null));
+
+ if (useExtendedSkinning) {
+ viewResources.addStyle(
+ internetResourceBuilder.createResource(
+ this, InternetResourceBuilder.STD_CONTROLS_EXTENDED_CLASSES_STYLE)
+ .getUri(context, null));
+ }
+ }
}
+
viewResources.collect(context);
Set scripts = viewResources.getScripts();
if (scripts.size() > 0) {
@@ -799,4 +871,23 @@
this.oncomplete = oncomplete;
}
+ private boolean isExtendedSkinningEnabled(ExternalContext context) {
+ String userAgent = context.getRequestHeaderMap().get("User-Agent");
+ if (userAgent != null) {
+ boolean apply = !USER_AGENTS.matcher(userAgent).find();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Got User-Agent: " + userAgent);
+ log.debug("Applying extended CSS controls styling = " + apply);
+ }
+
+ return apply;
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("User-Agent is null, applying extended CSS controls styling");
+ }
+
+ return true;
+ }
+ }
}
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/HtmlCompiler.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/HtmlCompiler.java 2008-02-29
18:58:50 UTC (rev 6466)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/HtmlCompiler.java 2008-02-29
19:14:12 UTC (rev 6467)
@@ -37,6 +37,7 @@
import org.ajax4jsf.Messages;
import org.ajax4jsf.renderkit.RendererBase;
import org.ajax4jsf.resource.util.URLToStreamHelper;
+import org.apache.commons.digester.AbstractObjectCreationFactory;
import org.apache.commons.digester.Digester;
import org.apache.commons.digester.Rule;
import org.apache.commons.digester.RulesBase;
@@ -44,6 +45,7 @@
import org.apache.commons.digester.SetPropertiesRule;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.LocatorImpl;
@@ -77,6 +79,7 @@
public static final String CHILD_PARAM_METHOD = "addParameter";
public static final String ANY_PARENT = "*/";
public static final String SELECTOR_TAG = "selector";
+ public static final String IMPORT_RESOURCE_TAG = "importResource";
private static final Log log = LogFactory.getLog(HtmlCompiler.class);
@@ -181,6 +184,30 @@
digestr.addObjectCreate(pattern,IfElement.class);
digestr.addSetProperties(pattern);
digestr.addSetNext(pattern,CHILD_METHOD);
+ // resources import <f:resourceImport src="...">
+ pattern = ANY_PARENT+NS_PREFIX+IMPORT_RESOURCE_TAG;
+ digestr.addFactoryCreate(pattern, new AbstractObjectCreationFactory() {
+
+ public Object createObject(Attributes attributes) throws Exception {
+
+ if (attributes == null) {
+ throw new IllegalArgumentException("Attributes set is null for " +
+ IMPORT_RESOURCE_TAG +
+ " element. Can not obtain required 'src' attribute!");
+ }
+
+ String value = attributes.getValue("src");
+ if (value == null || value.length() == 0) {
+ throw new IllegalArgumentException("Missing required 'src' attribute
for " +
+ IMPORT_RESOURCE_TAG +
+ " element!");
+ }
+
+ return new ImportResourceElement(value);
+ }
+
+ });
+ digestr.addSetNext(pattern,CHILD_METHOD);
// facet <u:insertFacet name="name">
pattern = ANY_PARENT+NS_UTIL_PREFIX+FACET_TAG;
digestr.addObjectCreate(pattern,FacetElement.class);
Added:
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/ImportResourceElement.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/ImportResourceElement.java
(rev 0)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/ImportResourceElement.java 2008-02-29
19:14:12 UTC (rev 6467)
@@ -0,0 +1,71 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.renderkit.compiler;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.renderkit.RendererBase;
+
+
+/**
+ * Created 27.02.2008
+ * @author Nick Belaevski
+ * @since 3.2
+ */
+
+public class ImportResourceElement extends ElementBase {
+
+ private PreparedTemplate template;
+
+ public ImportResourceElement(String source) {
+ template = HtmlCompiler.compileResource(source);
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.renderkit.compiler.PreparedTemplate#getTag()
+ */
+ public String getTag() {
+ return HtmlCompiler.NS_PREFIX+HtmlCompiler.IMPORT_RESOURCE_TAG;
+ }
+
+ public void encode(RendererBase renderer, FacesContext context,
+ UIComponent component) throws IOException {
+ template.encode(renderer, context, component);
+ }
+
+ public void encode(TemplateContext context, String breakPoint)
+ throws IOException {
+ template.encode(context, breakPoint);
+ }
+
+ public void encode(TemplateContext context) throws IOException {
+ template.encode(context);
+ }
+
+ public Object getValue(TemplateContext context) {
+ return template.getValue(context);
+ }
+
+}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/util/Zipper2.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/util/Zipper2.java 2008-02-29 18:58:50
UTC (rev 6466)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/util/Zipper2.java 2008-02-29 19:14:12
UTC (rev 6467)
@@ -101,4 +101,8 @@
offset += 4;
return i;
}
+
+ public boolean hasMore() {
+ return offset < buffer.length;
+ }
}
Added:
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/BaseControlBackgroundImage.java
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/BaseControlBackgroundImage.java
(rev 0)
+++
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/BaseControlBackgroundImage.java 2008-02-29
19:14:12 UTC (rev 6467)
@@ -0,0 +1,206 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.images;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.Rectangle2D;
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.resource.GifRenderer;
+import org.ajax4jsf.resource.InternetResourceBuilder;
+import org.ajax4jsf.resource.Java2Dresource;
+import org.ajax4jsf.resource.ResourceContext;
+import org.ajax4jsf.util.HtmlColor;
+import org.ajax4jsf.util.HtmlDimensions;
+import org.ajax4jsf.util.Zipper2;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
+
+/**
+ * Created 23.02.2008
+ * @author Nick Belaevski
+ * @since 3.2
+ */
+
+public class BaseControlBackgroundImage extends Java2Dresource {
+
+ private static final Dimension DIMENSION = new Dimension(1, 1);
+
+ private String baseColor;
+ private String gradientColor;
+ private int width;
+
+ public BaseControlBackgroundImage(String baseColor, String gradientColor, int width) {
+ super();
+
+ this.baseColor = baseColor;
+ this.gradientColor = gradientColor;
+ this.width = width;
+
+ setRenderer(new GifRenderer());
+ setLastModified(new Date(InternetResourceBuilder.getInstance().getStartTime()));
+ }
+
+ public Dimension getDimensions(FacesContext facesContext, Object data) {
+ Data d = (Data) data;
+ if (d != null) {
+ return new Dimension(width, d.height.intValue());
+ } else {
+ return DIMENSION;
+ }
+ }
+
+ protected Dimension getDimensions(ResourceContext resourceContext) {
+ return getDimensions(null, restoreData(resourceContext));
+ }
+
+ protected void paint(ResourceContext resourceContext, Graphics2D g2d) {
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
+ g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_ENABLE);
+ g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+ Data dataToStore = (Data) restoreData(resourceContext);
+ if (dataToStore != null && dataToStore.headerBackgroundColor!=null &&
dataToStore.headerGradientColor!=null) {
+ Color baseColor = new Color(dataToStore.headerBackgroundColor.intValue());
+ Dimension dim = getDimensions(resourceContext);
+ Rectangle2D rect =
+ new Rectangle2D.Float(
+ 0,
+ 0,
+ dim.width,
+ dim.height);
+ Color alternateColor = new Color(dataToStore.headerGradientColor.intValue());
+ GradientPaint gragient = new GradientPaint(0, 0, baseColor, 0, dim.height,
alternateColor);
+ g2d.setPaint(gragient);
+ g2d.fill(rect);
+ }
+ }
+
+ protected Object deserializeData(byte[] objectArray) {
+ Data data = new Data();
+ if (objectArray != null) {
+ Zipper2 zipper2 = new Zipper2(objectArray);
+ data.headerBackgroundColor = new Integer(zipper2.nextIntColor());
+ data.headerGradientColor = new Integer(zipper2.nextIntColor());
+ data.height = new Integer(zipper2.nextInt());
+ }
+
+ return data;
+ }
+
+ protected Object getDataToStore(FacesContext context, Object data) {
+ if (baseColor == null) {
+ return new Data(context).toByteArray();
+ } else {
+ return new Data(context, baseColor, gradientColor).toByteArray();
+ }
+ }
+
+ public boolean isCacheable() {
+ return true;
+ }
+
+ protected static class Data implements Serializable {
+ public Data() {
+ }
+
+ protected Data(FacesContext context) {
+ this(context, Skin.headerBackgroundColor, "headerGradientColor");
+ }
+
+ protected Data(FacesContext context, String baseColor, String gradientColor) {
+ this.headerBackgroundColor = getColorValueParameter(context, baseColor, false);
+ this.headerGradientColor = getColorValueParameter(context, gradientColor, false);
+ this.height = getHeight(context);
+
+ if (!(this.headerBackgroundColor == null && this.headerGradientColor == null))
{
+ if (this.headerBackgroundColor == null) {
+ this.headerBackgroundColor = getColorValueParameter(context, baseColor, true);
+ }
+
+ if (this.headerGradientColor == null) {
+ this.headerGradientColor = getColorValueParameter(context, gradientColor, true);
+ }
+ }
+ }
+
+ private Integer getHeight(FacesContext context) {
+ SkinFactory skinFactory = SkinFactory.getInstance();
+ Skin skin = skinFactory.getSkin(context);
+
+ String height = (String) skin.getParameter(context, Skin.generalSizeFont);
+ if (height == null || height.length() == 0) {
+ skin = skinFactory.getDefaultSkin(context);
+ height = (String) skin.getParameter(context, Skin.generalSizeFont);
+ }
+
+ if (height != null && height.length() != 0) {
+ return Integer.valueOf(HtmlDimensions.decode(height).intValue());
+ } else {
+ return Integer.valueOf(16);
+ }
+ }
+
+ private Integer getColorValueParameter(FacesContext context, String name, boolean
useDefault) {
+ Skin skin;
+ if (useDefault) {
+ skin = SkinFactory.getInstance().getDefaultSkin(context);
+ } else {
+ skin = SkinFactory.getInstance().getSkin(context);
+ }
+
+ String tmp = (String) skin.getParameter(context,name);
+ if (tmp!=null && tmp.length() != 0) {
+ return new Integer(HtmlColor.decode(tmp).getRGB());
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1732700513743861250L;
+ protected Integer headerBackgroundColor;
+ protected Integer headerGradientColor;
+ protected Integer height;
+ public byte[] toByteArray() {
+ if (headerBackgroundColor != null && headerGradientColor != null) {
+ byte[] ret = new byte[10];
+ new Zipper2(ret).
+ addColor(headerBackgroundColor.intValue()).
+ addColor(headerGradientColor.intValue()).
+ addInt(height);
+ return ret;
+ } else {
+ return null;
+ }
+ }
+ }
+
+}
Added:
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/ButtonBackgroundImage.java
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/ButtonBackgroundImage.java
(rev 0)
+++
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/ButtonBackgroundImage.java 2008-02-29
19:14:12 UTC (rev 6467)
@@ -0,0 +1,36 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.images;
+
+import org.richfaces.skin.Skin;
+
+/**
+ * Created 23.02.2008
+ * @author Nick Belaevski
+ * @since 3.2
+ */
+
+public class ButtonBackgroundImage extends BaseControlBackgroundImage {
+ public ButtonBackgroundImage() {
+ super(Skin.headerGradientColor, Skin.headerBackgroundColor, 1);
+ }
+}
Added:
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/InputBackgroundImage.java
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/InputBackgroundImage.java
(rev 0)
+++
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/InputBackgroundImage.java 2008-02-29
19:14:12 UTC (rev 6467)
@@ -0,0 +1,38 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.images;
+
+import org.richfaces.skin.Skin;
+
+/**
+ * Created 23.02.2008
+ * @author Nick Belaevski
+ * @since 3.2
+ */
+
+public class InputBackgroundImage extends BaseControlBackgroundImage {
+
+ public InputBackgroundImage() {
+ super(Skin.additionalBackgroundColor, Skin.controlBackgroundColor, 2000);
+ }
+
+}