JBoss Rich Faces SVN: r6207 - in trunk/sandbox/ui/fileUpload/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-20 09:20:04 -0500 (Wed, 20 Feb 2008)
New Revision: 6207
Modified:
trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
trunk/sandbox/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
Log:
disable buttons refactoring
Modified: trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
===================================================================
--- trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-02-20 14:15:27 UTC (rev 6206)
+++ trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-02-20 14:20:04 UTC (rev 6207)
@@ -304,6 +304,7 @@
this.iframe = $(this.id + "_iframe");
this.items = $(this.id + ":fileItems");
this.classes = classes;
+ this.currentInput = $(this.id + ":file");
this.options = options || {};
this.setupAutoUpload();
@@ -336,20 +337,20 @@
var newUpload = elt.cloneNode(true);
newUpload.id = this.id + ":file" + (this.idCounter++);
+ this.currentInput = newUpload;
$(this.id + ":add1").appendChild(newUpload);
if (this.runUpload) {
this.upload();
}
- this.disableAddButton(this.entries.length > this.maxFileBatchSize);
},
remove: function(entry) {
entry.clear();
this.entries = this.entries.without(entry);
- this.disableAddButton(this.entries.length > this.maxFileBatchSize);
+ //this.disableAddButton(this.entries.length > this.maxFileBatchSize);
},
_selectEntryForUpload: function() {
@@ -405,9 +406,56 @@
if (this.entries.length == 0) {
this.setupAutoUpload();
}
-
+ this.processButtons();
+ },
+
+ processButtons: function () {
this.disableAddButton(this.entries.length > this.maxFileBatchSize);
+ this.disableCleanButton(this.cleanAllDisabled());
+ this.disableUploadButton(this.uploadAllDisabled());
+ this.switchUploadButton();
},
+
+ cleanAllDisabled: function () {
+ var c = 0;
+ for (var i = 0; i < this.entries.length; i++) {
+ if (this.entries[i].state != FileUploadEntry.UPLOAD_IN_PROGRESS) {
+ c++;
+ }
+ }
+ return (c == 0);
+ },
+
+ uploadAllDisabled: function () {
+ if (this.runUpload) {
+ return false;
+ } else {
+ var c = 0;
+ for (var i = 0; i < this.entries.length; i++) {
+ var e = this.entries[i];
+ if (e.state == FileUploadEntry.READY || e.state == FileUploadEntry.INITIALIZED) {
+ c++;
+ }
+ }
+ return (c == 0);
+ }
+ },
+
+ switchUploadButton: function () {
+ if (this.runUpload) {
+ var d = $(this.id + ":upload2");
+ d.innerHTML = "<b>Cancel</b>";
+ d.onclick = function () {
+ this.stop();
+ }.bind(this);
+ }else {
+ var d = $(this.id + ":upload2");
+ d.innerHTML = "<b>Upload</b>";
+ d.onclick = function () {
+ this.upload();
+ }.bind(this);
+ }
+ },
disableCleanButton: function(disabled) {
if(disabled) {
@@ -421,7 +469,7 @@
},
disableAddButton: function(disabled) {
- $(this.id+":file").disabled = disabled;
+ this.currentInput.disabled = disabled;
$(this.id+":add1").className = (disabled? this.classes.ADD.DISABLED : this.classes.ADD.ENABLED);
$(this.id+":add2").className = (disabled? this.classes.ADD_CONTENT.DISABLED : this.classes.ADD_CONTENT.ENABLED);
},
@@ -491,7 +539,7 @@
}
this._updateEntriesState();
- this.disableUploadButton(false);
+ //this.disableUploadButton(false);
} else if (newState == FileUploadEntry.UPLOAD_CANCELED ||
newState == FileUploadEntry.UPLOAD_TRANSFER_ERROR ||
@@ -504,7 +552,7 @@
this._updateEntriesState();
- this.disableUploadButton(false);
+ //this.disableUploadButton(false);
} else if (newState == FileUploadEntry.UPLOAD_IN_PROGRESS) {
@@ -514,8 +562,9 @@
this._updateEntriesState();
- this.disableUploadButton(true);
+ //this.disableUploadButton(true);
}
+ this.processButtons();
},
submitForm: function(entry) {
Modified: trunk/sandbox/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
===================================================================
--- trunk/sandbox/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-02-20 14:15:27 UTC (rev 6206)
+++ trunk/sandbox/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-02-20 14:20:04 UTC (rev 6207)
@@ -37,10 +37,10 @@
<tr>
<td>
<div class="upload_button_border" style=" float:left;">
- <div class="upload_button upload_font" onmouseover="this.className='upload_button_light upload_font'" onmousedown="this.className='upload_button_press upload_font'" onmouseup="this.className='upload_button upload_font'" onmouseout="this.className='upload_button upload_font'"
+ <div class="upload_button upload_font #{component.attributes['addStyle']}" onmouseover="this.className='upload_button_light upload_font'" onmousedown="this.className='upload_button_press upload_font'" onmouseup="this.className='upload_button upload_font'" onmouseout="this.className='upload_button upload_font'"
style="position: relative; overflow: hidden; width:70px"
id="#{clientId}:add1">
- <div class="upload_button_content upload_font upload_ico upload_ico_add"
+ <div class="upload_button_content upload_font upload_ico upload_ico_add #{component.attributes['addStyle']}"
id="#{clientId}:add2" style="direction: rtl;">Add...</div>
<input type="file" style="cursor: pointer; z-index: 3; right: -10px; top: -10px; font-size: 10em; position: absolute"
class="hidden"
@@ -50,14 +50,13 @@
</div>
</div>
<div class="upload_button_border" style=" float:left;">
- <div class="upload_button upload_font" onmouseover="this.className='upload_button_light upload_font'" onmousedown="this.className='upload_button_press upload_font'" onmouseup="this.className='upload_button upload_font'"
+ <div class="upload_button upload_font #{component.attributes['uploadStyleDisabled']}" onmouseover="this.className='upload_button_light upload_font'" onmousedown="this.className='upload_button_press upload_font'" onmouseup="this.className='upload_button upload_font'"
onmouseout="this.className='upload_button upload_font'"
id="#{clientId}:upload1"
onclick="return $('#{clientId}').component.upload();">
<a href="#" class="upload_button_selection">
- <div class="upload_button_content upload_font upload_ico upload_ico_start"
+ <div class="upload_button_content upload_font upload_ico upload_ico_start_dis #{component.attributes['uploadStyleDisabled']}"
id="#{clientId}:upload2">
- <b style="display: none;">Cancel</b>
<b>Upload</b>
</div>
</a>
@@ -66,29 +65,15 @@
<!-- todo review -->
- <div class="upload_button_border" style=" float:left;">
- <div class="upload_button upload_font" onmouseover="this.className='upload_button_light upload_font'" onmousedown="this.className='upload_button_press upload_font'" onmouseup="this.className='upload_button upload_font'"
- onmouseout="this.className='upload_button upload_font'"
- id="#{clientId}:upload3"
- onclick="return $('#{clientId}').component.stop();">
- <a href="#" class="upload_button_selection">
- <div class="upload_button_content upload_font upload_ico upload_ico_stop"
- id="#{clientId}:upload4">
- <b>Stop</b>
- </div>
- </a>
- </div>
- </div>
-
<!-- -->
<div class="upload_button_border" style=" float:right">
- <div class="upload_button upload_font" onmouseover="this.className='upload_button_light upload_font'" onmousedown="this.className='upload_button_press upload_font'" onmouseup="this.className='upload_button upload_font'"
+ <div class="upload_button_dis upload_font #{component.attributes['cleanStyleDisabled']}" onmouseover="this.className='upload_button_light upload_font'" onmousedown="this.className='upload_button_press upload_font'" onmouseup="this.className='upload_button upload_font'"
onmouseout="this.className='upload_button upload_font'"
onclick="return $('#{clientId}').component.clear();"
id="#{clientId}:clean1">
<a href="#" class="upload_button_selection">
- <div class="upload_button_content upload_font upload_ico upload_ico_clear"
+ <div class="upload_button_content upload_font upload_ico upload_ico_clear_dis #{component.attributes['cleanStyleDisabled']}"
id="#{clientId}:clean2">Clean All</div>
</a>
</div>
18 years, 2 months
JBoss Rich Faces SVN: r6206 - trunk/sandbox/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-20 09:15:27 -0500 (Wed, 20 Feb 2008)
New Revision: 6206
Modified:
trunk/sandbox/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss
Log:
rename css classes
Modified: trunk/sandbox/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss
===================================================================
--- trunk/sandbox/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss 2008-02-20 13:53:36 UTC (rev 6205)
+++ trunk/sandbox/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss 2008-02-20 14:15:27 UTC (rev 6206)
@@ -11,158 +11,231 @@
fieldset{padding : 30px; border : 1px solid #c0c0c0;}
legend{font-weight : bold}
-.insel_default_state{white-space : nowrap; background-color : #f1f1f1/*editorBackgroundColor*/; border-bottom : 1px dashed #000000/*generalTextColor*/; padding-left : 3px; padding-right : 3px;}
-.insel_changed_state{background-position : top left; background-repeat : no-repeat;}
+.rich-inplace-select-default-state{
+ white-space : nowrap;
+ background-color : #f1f1f1/*editorBackgroundColor*/;
+ border-bottom : 1px dashed #000000/*generalTextColor*/;
+ padding-left : 3px;
+ padding-right : 3px;
+}
-.insel_edit_state{position : relative; width : 100px;}
-.insel_field{background : #FBFF8E/*editBackgroundColor*/; padding : 0px 0px 0px 0px; border : 0px; margin : 0px; width : 112px; position : absolute; top:0px; left : 0px; background-position : center right; background-repeat : no-repeat;}
-.insel_strut{width : 100px; height : 1px}
-.insel_btn{
+.rich-inplace-select-changed-state{
+ background-position : top left;
+ background-repeat : no-repeat;
+}
+
+.rich-inplace-select-edit-state{
+ position : relative;
+ width : 100px;
+}
+
+.rich-inplace-select-field {
+ background : #FBFF8E/*editBackgroundColor*/;
+ padding : 0px 0px 0px 0px;
+ border : 0px;
+ margin : 0px;
+ width : 112px;
+ position : absolute;
+ top:0px;
+ left : 0px;
+ background-position : center right;
+ background-repeat : no-repeat;
+}
+
+.rich-inplace-select-strut{
+ width : 100px;
+ height : 1px
+}
+
+.rich-inplace-select-btn {
background-position : top;
background-repeat: repeat-x;
background-color: #C7D7EC; /*gradient - from generalBackgroundColor to tabBackgroundColor, background-color - tabBackgroundColor*/
border : 1px outset #BED6F8; /*panelBorderColor*/
padding : 0px;
- margin : 0px;}
-.insel_btn_press{
+ margin : 0px;
+}
+
+.rich-inplace-select-press{
background-position: top;
background-repeat: repeat-x;
background-color: #C7D7EC; /*gradient - from tabBackgroundColor to generalBackgroundColor, background-color - tabBackgroundColor*/
border : 1px inset #BED6F8; /*panelBorderColor*/
padding : 0px;
- margin : 0px;}
+ margin : 0px;
+}
+.rich-inplace-select-set{
+ position : absolute;
+ top:0px;
+ left : 112px;
+ white-space : nowrap
+}
-.insel_btn_set{ position : absolute; top:0px; left : 112px; white-space : nowrap}
-.insel_shadow{ top:0; left:0; position : absolute;}
-.insel_shadow_size{ width : 34px; height : 16px;}
-.cb_list_cord{ position : relative; font-size : 0px;d!isplay : none}/*DDL is hidden!!!!!*/
-.cb_list_scroll{ overflow : auto; height : 100px;}
-.cb_list_position{ position : absolute; top:1px; left:0px;}
-.cb_list_decoration{border : 1px solid #c0c0c0 /*panelBorderColor*/; padding : 0px; background : #FFFFFF; /*tableBackgroundColor*/}
-.cb_width_list{ width : 250px;}
-.cb_option{ padding : 2px; white-space : nowrap;}
-.cb_font{ font-size : 11px/*generalSizeFont*/; font-family : arial/*generalFamilyFont*/; color : #000000/*generalTextColor*/}
-.cb_select{ padding : 1px; background-color: #4a75b5; border : 1px dotted #4a75b5; color: white;/*generalTextColor*/}
+.rich-inplace-select-shadow{
+ top:0;
+ left:0;
+ position : absolute;
+}
-.insel_shadow_tl{
+.rich-inplace-select-size{
+ width : 34px;
+ height : 16px;
+}
+
+.rich-inplace-select-list_cord{
+ position : relative;
+ font-size : 0px;d!isplay : none
+}/*DDL is hidden!!!!!*/
+
+.rich-inplace-select-list_scroll{
+ overflow : auto;
+ height : 100px;
+}
+
+.rich-inplace-select-list-position{
+ position : absolute;
+ top:1px;
+ left:0px;
+}
+
+.rich-inplace-select-list-decoration{
+ border : 1px solid #c0c0c0 /*panelBorderColor*/;
+ padding : 0px; background : #FFFFFF; /*tableBackgroundColor*/
+}
+
+
+.rich-inplace-select-width-list{
+ width : 250px;
+}
+
+.rich-inplace-select-option{
+ padding : 2px;
+ white-space : nowrap;
+}
+
+.rich-inplace-select-font{
+ font-size : 11px/*generalSizeFont*/;
+ font-family : arial/*generalFamilyFont*/;
+ color : #000000/*generalTextColor*/
+}
+.rich-inplace-select-select-item{
+ padding : 1px;
+ background-color: #4a75b5;
+ border : 1px dotted #4a75b5;
+ color: white;/*generalTextColor*/
+}
+
+.rich-inplace-select-shadow-tl{
background-repeat: repeat-x;
background-position : top left;
}
-.insel_shadow_tr{
+.rich-inplace-select-shadow-tr{
background-repeat: repeat-x;
background-position : top right;
}
-.insel_shadow_bl{
+.rich-inplace-select-shadow-bl{
background-repeat: repeat-x;
background-position : bottom left;
}
-.insel_shadow_br{
+.rich-inplace-select-shadow-br{
background-repeat: repeat-x;
background-position : bottom right;
}
-.cb_shadow_tl{
+.rich-inplace-select-shadow-tl{
background-repeat: repeat-x;
background-position: top left;
}
-.cb_shadow_tr{
+..rich-inplace-select-shadow-tr{
background-repeat: repeat-x;
background-position: top right;
}
-.cb_shadow_bl{
+.rich-inplace-select-shadow-bl{
background-repeat : repeat-x
background-position: bottom left;
}
-.cb_shadow_br{
+.rich-inplace-select-shadow-br{
background-repeat : repeat-x;
background-position : bottom right;
}
]]>
</f:verbatim>
- <u:selector name=".insel_changed_state">
+ <u:selector name="..rich-inplace-select-changed-state">
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.images.EditIcon"/>
</u:style>
</u:selector>
- <u:selector name=".insel_field">
+ <u:selector name=".rich-inplace-select-field">
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.images.SpinnerButtonDown"/>
</u:style>
</u:selector>
- <u:selector name=".insel_shadow_tl">
+ <u:selector name=".rich-inplace-select-shadow-tl">
<u:style name="background-image">
<f:resource f:key="/org/richfaces/renderkit/html/images/bg_shadow.png"/>
</u:style>
</u:selector>
- <u:selector name=".cb_shadow_tr">
+ <u:selector name=".rich-inplace-select-shadow-tr">
<u:style name="background-image">
<f:resource f:key="/org/richfaces/renderkit/html/images/bg_shadow.png"/>
</u:style>
</u:selector>
- <u:selector name=".cb_shadow_bl">
+ <u:selector name=".rich-inplace-select-shadow-bl">
<u:style name="background-image">
<f:resource f:key="/org/richfaces/renderkit/html/images/bg_shadow.png"/>
</u:style>
</u:selector>
- <u:selector name=".cb_shadow_br">
+ <u:selector name=".rich-inplace-select-shadow-br">
<u:style name="background-image">
<f:resource f:key="/org/richfaces/renderkit/html/images/bg_shadow.png"/>
</u:style>
</u:selector>
- <u:selector name=".insel_shadow_tl">
+ <u:selector name=".rich-inplace-select-shadow-tl">
<u:style name="background-image">
<f:resource f:key="/org/richfaces/renderkit/html/images/bg_shadow.png"/>
</u:style>
</u:selector>
- <u:selector name=".insel_shadow_tr">
+ <u:selector name=".rich-inplace-select-shadow-tr">
<u:style name="background-image">
<f:resource f:key="/org/richfaces/renderkit/html/images/bg_shadow.png"/>
</u:style>
</u:selector>
- <u:selector name=".insel_shadow_bl">
+ <u:selector name=".rich-inplace-select-shadow-bl">
<u:style name="background-image">
<f:resource f:key="/org/richfaces/renderkit/html/images/bg_shadow.png"/>
</u:style>
</u:selector>
- <u:selector name=".insel_shadow_br">
+ <u:selector name=".rich-inplace-select-shadow-br">
<u:style name="background-image">
<f:resource f:key="/org/richfaces/renderkit/html/images/bg_shadow.png"/>
</u:style>
</u:selector>
- <u:selector name=".insel_btn">
+ <u:selector name=".rich-inplace-select-btn">
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.images.SpinnerButtonGradient"/>
</u:style>
</u:selector>
- <u:selector name=".insel_btn_press">
+ <u:selector name=".rich-inplace-select-btn-press">
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.images.ComboBoxButtonPressGradient"/>
</u:style>
</u:selector>
-
-
-
-
-
-
-
-
</f:template>
\ No newline at end of file
18 years, 2 months
JBoss Rich Faces SVN: r6205 - trunk/framework/impl/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-20 08:53:36 -0500 (Wed, 20 Feb 2008)
New Revision: 6205
Added:
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/GradientA.java
Log:
Added: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java (rev 0)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2008-02-20 13:53:36 UTC (rev 6205)
@@ -0,0 +1,245 @@
+/**
+ * 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;
+
+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.Zipper2;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 02.02.2007
+ *
+ */
+public class BaseGradient extends Java2Dresource {
+
+ private int width;
+ private int height;
+ private int gradientHeight;
+ private String baseColor;
+ private String gradientColor;
+ private boolean horizontal = false;
+
+ public BaseGradient(int width, int height, int gradientHeight) {
+ super();
+ this.width = width;
+ this.height = height;
+ this.gradientHeight = gradientHeight;
+
+ setRenderer(new GifRenderer());
+ setLastModified(new Date(InternetResourceBuilder.getInstance().getStartTime()));
+ }
+
+ public BaseGradient(int width, int height, int gradientHeight, String baseColor, String gradientColor) {
+ this(width, height, gradientHeight);
+ this.baseColor = baseColor;
+ this.gradientColor = gradientColor;
+ }
+
+ public BaseGradient(int width, int height) {
+ this(width, height, height);
+ }
+
+ public BaseGradient(int width, int height, String baseColor, String gradientColor) {
+ this(width, height, height);
+ this.baseColor = baseColor;
+ this.gradientColor = gradientColor;
+ }
+
+ public BaseGradient() {
+ this(30, 50, 20);
+ }
+
+ public BaseGradient(String baseColor, String gradientColor) {
+ this(30, 50, 20);
+ this.baseColor = baseColor;
+ this.gradientColor = gradientColor;
+ }
+
+ public BaseGradient(int width, int height, int gradientHeight, boolean horizontal) {
+ this(width, height, gradientHeight);
+ this.horizontal = horizontal;
+ }
+
+ public BaseGradient(int width, int height, int gradientHeight, String baseColor, String gradientColor, boolean horizontal) {
+ this(width, height, gradientHeight);
+ this.baseColor = baseColor;
+ this.gradientColor = gradientColor;
+ this.horizontal = horizontal;
+ }
+
+ public BaseGradient(int width, int height, boolean horizontal) {
+ this(width, height, horizontal?width:height);
+ this.horizontal = horizontal;
+ }
+
+ public BaseGradient(int width, int height, String baseColor, String gradientColor, boolean horizontal) {
+ this(width, height, horizontal?width:height);
+ this.baseColor = baseColor;
+ this.gradientColor = gradientColor;
+ this.horizontal = horizontal;
+ }
+
+ public BaseGradient(boolean horizontal) {
+ this(30, 50, 20);
+ this.horizontal = horizontal;
+ }
+
+ public BaseGradient(String baseColor, String gradientColor, boolean horizontal) {
+ this(30, 50, 20);
+ this.baseColor = baseColor;
+ this.gradientColor = gradientColor;
+ this.horizontal = horizontal;
+ }
+
+ public Dimension getDimensions(FacesContext facesContext, Object data) {
+ return new Dimension(width, height);
+ }
+
+ 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);
+ int gradStart = 0;
+ int gradEnd = gradientHeight;
+ Color alternateColor = new Color(dataToStore.headerGradientColor.intValue());
+ GradientPaint gragient;
+ if (horizontal) {
+ gragient = new GradientPaint(gradStart, 0, baseColor, gradEnd, 0, alternateColor);
+ } else {
+ gragient = new GradientPaint(0, gradStart, baseColor, 0, gradEnd, 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());
+ }
+
+ 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);
+
+ 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 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;
+ public byte[] toByteArray() {
+ if (headerBackgroundColor != null && headerGradientColor != null) {
+ byte[] ret = new byte[6];
+ new Zipper2(ret).addColor(headerBackgroundColor.intValue()).addColor(headerGradientColor.intValue());
+ return ret;
+ } else {
+ return null;
+ }
+ }
+ }
+
+}
Added: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/GradientA.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/GradientA.java (rev 0)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/GradientA.java 2008-02-20 13:53:36 UTC (rev 6205)
@@ -0,0 +1,28 @@
+/**
+ * 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;
+
+public class GradientA extends BaseGradient {
+ public GradientA() {
+ super(30, 50, 20, "headerGradientColor", "headerBackgroundColor");
+ }
+}
\ No newline at end of file
18 years, 2 months
JBoss Rich Faces SVN: r6204 - trunk/docs/userguide.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-02-20 08:53:17 -0500 (Wed, 20 Feb 2008)
New Revision: 6204
Modified:
trunk/docs/userguide/pom.xml
Log:
Progress bar added.
http://jira.jboss.com/jira/browse/RF-1690
Modified: trunk/docs/userguide/pom.xml
===================================================================
--- trunk/docs/userguide/pom.xml 2008-02-20 13:51:17 UTC (rev 6203)
+++ trunk/docs/userguide/pom.xml 2008-02-20 13:53:17 UTC (rev 6204)
@@ -82,7 +82,7 @@
org.richfaces.ui
</groupId>
<artifactId>
- progressBar
+ progressBar
</artifactId>
<version>
${project.version}
18 years, 2 months
JBoss Rich Faces SVN: r6203 - trunk/docs/userguide/en/src/main/docbook.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-02-20 08:51:17 -0500 (Wed, 20 Feb 2008)
New Revision: 6203
Modified:
trunk/docs/userguide/en/src/main/docbook/master.xml
Log:
Progress bar added.
http://jira.jboss.com/jira/browse/RF-1690
Modified: trunk/docs/userguide/en/src/main/docbook/master.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/master.xml 2008-02-20 13:49:29 UTC (rev 6202)
+++ trunk/docs/userguide/en/src/main/docbook/master.xml 2008-02-20 13:51:17 UTC (rev 6203)
@@ -54,7 +54,7 @@
<!ENTITY columns_table SYSTEM "../../../target/generated/columns.xml">
<!ENTITY comboBox_table SYSTEM "../../../target/generated/combobox.xml">
<!ENTITY pickList_table SYSTEM "../../../target/generated/pickList.xml">
-
+<!ENTITY progressBar_table SYSTEM "../../../target/generated/progressBar.xml">
<!ENTITY coreComponents_table SYSTEM "../../../target/generated/a4j.xml">
]>
@@ -113,6 +113,7 @@
&panelBar_table;
&panelMenu_table;
&pickList_table;
+&progressBar_table;
&scrollableDataTable_table;
&separator_table;
&simpleTogglePanel_table;
18 years, 2 months
JBoss Rich Faces SVN: r6202 - trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-20 08:49:29 -0500 (Wed, 20 Feb 2008)
New Revision: 6202
Added:
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/ComboBoxArrowImageDisable.java
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/EditIcon.java
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonImage.java
Log:
Added: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/ComboBoxArrowImageDisable.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/ComboBoxArrowImageDisable.java (rev 0)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/ComboBoxArrowImageDisable.java 2008-02-20 13:49:29 UTC (rev 6202)
@@ -0,0 +1,19 @@
+/**
+ *
+ */
+package org.richfaces.renderkit.html.images;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Anton Belevich
+ * @since 3.2.0
+ * ComboBox disable arrow image renderer
+ *
+ */
+public class ComboBoxArrowImageDisable extends ComboBoxArrowImage{
+
+ protected Object storeData(FacesContext context, String colorSkinParam, String backgroundSkinParam, String borderSkinParam) {
+ return super.storeData(context, DISABLED_ICON_COLOR, BACKGROUND_COLOR, DISABLED_BORDER_COLOR);
+ }
+}
Added: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/EditIcon.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/EditIcon.java (rev 0)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/EditIcon.java 2008-02-20 13:49:29 UTC (rev 6202)
@@ -0,0 +1,76 @@
+/**
+ *
+ */
+package org.richfaces.renderkit.html.images;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+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.Zipper2;
+
+/**
+ * implementation of the EDIT icon renderer
+ * @author Anton Belevich
+ * @since 3.2.0
+ *
+ */
+public class EditIcon extends Java2Dresource {
+
+ protected static final String ICON_COLOR = "#FF0000";
+
+ private static final Dimension dimensions = new Dimension(4, 4);
+
+ public EditIcon() {
+ setRenderer(new GifRenderer());
+ setLastModified(new Date(InternetResourceBuilder.getInstance().getStartTime()));
+ }
+
+ public Dimension getDimensions(FacesContext facesContext, Object data) {
+ return dimensions;
+ }
+
+ protected Dimension getDimensions(ResourceContext resourceContext) {
+ return dimensions;
+ }
+
+ protected Object deserializeData(byte[] objectArray) {
+ if (objectArray == null) {
+ return null;
+ }
+ Zipper2 zipper = new Zipper2(objectArray);
+ return new Color[] {zipper.nextColor()};
+ }
+
+ protected Object getDataToStore(FacesContext context, Object data){
+
+ byte [] ret = new byte[3];
+
+ Color color = null;
+ Zipper2 zipper = new Zipper2(ret);
+
+ color = HtmlColor.decode(ICON_COLOR);
+ zipper.addColor(color);
+
+ return ret;
+ }
+
+ protected void paint(ResourceContext context, Graphics2D g2d) {
+ Color [] data = (Color[]) restoreData(context);
+ Color iconColor = data[0];
+
+ g2d.setColor(iconColor);
+ g2d.drawLine(0, 0, 0, 4);
+ g2d.drawLine(0, 0, 4, 0);
+ g2d.drawLine(1, 0, 1, 2);
+ g2d.drawLine(2, 0, 2, 1);
+ }
+}
Added: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonImage.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonImage.java (rev 0)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonImage.java 2008-02-20 13:49:29 UTC (rev 6202)
@@ -0,0 +1,82 @@
+/**
+ * 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.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.util.HtmlColor;
+import org.ajax4jsf.util.Zipper2;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
+
+public abstract class SpinnerButtonImage extends Java2Dresource {
+
+ public SpinnerButtonImage() {
+ setRenderer(new GifRenderer());
+ setLastModified(new Date(InternetResourceBuilder.getInstance().getStartTime()));
+ }
+
+ protected Object deserializeData(byte[] objectArray) {
+ if (objectArray == null) {
+ return null;
+ }
+ Zipper2 zipper = new Zipper2(objectArray);
+ return new Color[] {zipper.nextColor(), zipper.nextColor()};
+ }
+
+ protected Object getDataToStore(FacesContext context, Object data) {
+ Skin skin = SkinFactory.getInstance().getSkin(context);
+ byte[] ret = new byte[6];
+ Zipper2 zipper = new Zipper2(ret);
+
+ String skinParameterTextColor = "generalTextColor";
+ String generalTextColor = (String) skin.getParameter(context, skinParameterTextColor);
+ if (null == generalTextColor || "".equals(generalTextColor)) {
+ Skin defaultSkin = SkinFactory.getInstance().getDefaultSkin(context);
+ generalTextColor = (String) defaultSkin.getParameter(context, skinParameterTextColor);
+ }
+
+ Integer color = HtmlColor.decode( generalTextColor == null ? "#000000":generalTextColor ).getRGB();
+
+ zipper.addColor(color);
+
+ String skinParameterBackgroundColor = "controlBackgroundColor";
+ String generalBackgroundColor = (String) skin.getParameter(context, skinParameterBackgroundColor);
+
+ if (null == generalBackgroundColor || "".equals(generalBackgroundColor)) {
+ Skin defaultSkin = SkinFactory.getInstance().getDefaultSkin(context);
+ generalBackgroundColor = (String) defaultSkin.getParameter(context, skinParameterBackgroundColor);
+ }
+
+ color = HtmlColor.decode( generalTextColor == null ? "#FFFFFF":generalBackgroundColor ).getRGB();
+ zipper.addColor(color);
+
+ return ret;
+ }
+
+}
18 years, 2 months
JBoss Rich Faces SVN: r6201 - in trunk/sandbox/ui/inplaceSelect/src/main/config: resources and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-20 08:40:49 -0500 (Wed, 20 Feb 2008)
New Revision: 6201
Added:
trunk/sandbox/ui/inplaceSelect/src/main/config/resources/
trunk/sandbox/ui/inplaceSelect/src/main/config/resources/resource-config.xml
Log:
Added: trunk/sandbox/ui/inplaceSelect/src/main/config/resources/resource-config.xml
===================================================================
--- trunk/sandbox/ui/inplaceSelect/src/main/config/resources/resource-config.xml (rev 0)
+++ trunk/sandbox/ui/inplaceSelect/src/main/config/resources/resource-config.xml 2008-02-20 13:40:49 UTC (rev 6201)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resource-config>
+ <resource class="org.richfaces.renderkit.html.images.saveControlIcon">
+ <name>org.richfaces.renderkit.html.images.SaveControlIcon</name>
+ </resource>
+ <resource class="org.richfaces.renderkit.html.images.EditIcon">
+ <name>org.richfaces.renderkit.html.images.EditIcon</name>
+ </resource>
+ <resource class="org.richfaces.renderkit.html.images.CancelControlIcon">
+ <name>org.richfaces.renderkit.html.images.CancelControlIcon</name>
+ </resource>
+ <resource class="org.richfaces.renderkit.html.images.SpinnerButtonGradient">
+ <name>org.richfaces.renderkit.html.images.SpinnerButtonGradient</name>
+ </resource>
+ <resource class="org.richfaces.renderkit.html.images.ComboBoxButtonPressGradient">
+ <name>org.richfaces.renderkit.html.images.ComboBoxButtonPressGradient</name>
+ </resource>
+</resource-config>
\ No newline at end of file
18 years, 2 months
JBoss Rich Faces SVN: r6200 - trunk/sandbox/ui/inplaceSelect/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-20 08:40:30 -0500 (Wed, 20 Feb 2008)
New Revision: 6200
Modified:
trunk/sandbox/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
Modified: trunk/sandbox/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/sandbox/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-02-20 13:38:40 UTC (rev 6199)
+++ trunk/sandbox/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-02-20 13:40:30 UTC (rev 6200)
@@ -22,7 +22,7 @@
</h:scripts>
<f:clientid var="clientId" />
-<f:resource var="saveIcon" name="org.richfaces.renderkit.html.images.saveControlIcon"/>
+<f:resource var="saveIcon" name="org.richfaces.renderkit.html.images.SaveControlIcon"/>
<f:resource var="cancelIcon" name="org.richfaces.renderkit.html.images.CancelControlIcon"/>
<jsp:scriptlet>
<![CDATA[
18 years, 2 months
JBoss Rich Faces SVN: r6199 - in trunk/sandbox/ui/inplaceInput/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-20 08:38:40 -0500 (Wed, 20 Feb 2008)
New Revision: 6199
Modified:
trunk/sandbox/ui/inplaceInput/src/main/config/resources/resource-config.xml
trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
fix case
Modified: trunk/sandbox/ui/inplaceInput/src/main/config/resources/resource-config.xml
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/config/resources/resource-config.xml 2008-02-20 13:37:30 UTC (rev 6198)
+++ trunk/sandbox/ui/inplaceInput/src/main/config/resources/resource-config.xml 2008-02-20 13:38:40 UTC (rev 6199)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<resource-config>
<resource class="org.richfaces.renderkit.html.images.saveControlIcon">
- <name>org.richfaces.renderkit.html.images.saveControlIcon</name>
+ <name>org.richfaces.renderkit.html.images.SaveControlIcon</name>
</resource>
<resource class="org.richfaces.renderkit.html.images.EditIcon">
<name>org.richfaces.renderkit.html.images.EditIcon</name>
Modified: trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-02-20 13:37:30 UTC (rev 6198)
+++ trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-02-20 13:38:40 UTC (rev 6199)
@@ -16,7 +16,7 @@
new org.ajax4jsf.javascript.PrototypeScript(),
scripts/inplaceinput.js
</h:scripts>
- <f:resource var="saveIcon" name="org.richfaces.renderkit.html.images.saveControlIcon"/>
+ <f:resource var="saveIcon" name="org.richfaces.renderkit.html.images.SaveControlIcon"/>
<f:resource var="cancelIcon" name="org.richfaces.renderkit.html.images.CancelControlIcon"/>
<f:resource var="spacer" name="images/spacer.gif"/>
18 years, 2 months
JBoss Rich Faces SVN: r6198 - trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-20 08:37:30 -0500 (Wed, 20 Feb 2008)
New Revision: 6198
Modified:
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SaveControlIcon.java
Log:
Modified: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SaveControlIcon.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SaveControlIcon.java 2008-02-20 13:36:23 UTC (rev 6197)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SaveControlIcon.java 2008-02-20 13:37:30 UTC (rev 6198)
@@ -24,7 +24,7 @@
* @since 3.2.0
*
*/
-public class saveControlIcon extends Java2Dresource {
+public class SaveControlIcon extends Java2Dresource {
protected static final String ICON_COLOR = "#5BC248";
protected static final String ICON_SHADOW = "#006406";
@@ -40,7 +40,7 @@
protected Dimension getDimensions(ResourceContext resourceContext) {
return dimensions;
}
- public saveControlIcon() {
+ public SaveControlIcon() {
setRenderer(new GifRenderer());
setLastModified(new Date(InternetResourceBuilder.getInstance().getStartTime()));
}
18 years, 2 months