Author: sergeyhalipov
Date: 2008-03-14 11:50:36 -0400 (Fri, 14 Mar 2008)
New Revision: 6824
Modified:
trunk/ui/inputnumber-slider/src/main/java/org/richfaces/component/UIInputNumberSlider.java
trunk/ui/inputnumber-slider/src/main/java/org/richfaces/renderkit/InputNumberSliderRendererBase.java
Log:
Input number slider: move rendering logic to the renderer class from the component class.
Modified:
trunk/ui/inputnumber-slider/src/main/java/org/richfaces/component/UIInputNumberSlider.java
===================================================================
---
trunk/ui/inputnumber-slider/src/main/java/org/richfaces/component/UIInputNumberSlider.java 2008-03-14
15:40:15 UTC (rev 6823)
+++
trunk/ui/inputnumber-slider/src/main/java/org/richfaces/component/UIInputNumberSlider.java 2008-03-14
15:50:36 UTC (rev 6824)
@@ -41,25 +41,4 @@
public abstract String getStyle();
public abstract void setStyle(String style);
- public String getStyleValue() {
- StringBuffer buf = new StringBuffer();
- String width = getWidth();
- String height = getHeight();
- String style = getStyle();
- if (width != null && width.length() > 0) {
- buf.append("width:" + HtmlUtil.qualifySize(width));
- buf.append(";");
- }
-
- if (height !=null && height.length() > 0) {
- buf.append("height:" + HtmlUtil.qualifySize(height));
- buf.append(";");
- }
- if (style !=null && style.length() > 0) {
- buf.append(style);
- }
-
- return buf.toString();
- }
-
}
Modified:
trunk/ui/inputnumber-slider/src/main/java/org/richfaces/renderkit/InputNumberSliderRendererBase.java
===================================================================
---
trunk/ui/inputnumber-slider/src/main/java/org/richfaces/renderkit/InputNumberSliderRendererBase.java 2008-03-14
15:40:15 UTC (rev 6823)
+++
trunk/ui/inputnumber-slider/src/main/java/org/richfaces/renderkit/InputNumberSliderRendererBase.java 2008-03-14
15:50:36 UTC (rev 6824)
@@ -31,6 +31,7 @@
import org.ajax4jsf.renderkit.ComponentsVariableResolver;
import org.ajax4jsf.renderkit.RendererUtils;
import org.richfaces.component.UIInputNumberSlider;
+import org.richfaces.component.util.HtmlUtil;
/**
* @author Nick - mailto:nbelaevski@exadel.com
@@ -76,7 +77,28 @@
}
variables.setVariable("inputSize",
slider.getAttributes().get("inputSize"));
- variables.setVariable("style", slider.getStyle());
+ variables.setVariable("style", getStyleValue(slider));
}
+
+ public String getStyleValue(UIInputNumberSlider slider) {
+ StringBuffer buf = new StringBuffer();
+ String width = slider.getWidth();
+ String height = slider.getHeight();
+ String style = slider.getStyle();
+ if (width != null && width.length() > 0) {
+ buf.append("width:" + HtmlUtil.qualifySize(width));
+ buf.append(";");
+ }
+ if (height !=null && height.length() > 0) {
+ buf.append("height:" + HtmlUtil.qualifySize(height));
+ buf.append(";");
+ }
+ if (style !=null && style.length() > 0) {
+ buf.append(style);
+ }
+
+ return buf.toString();
+ }
+
}
Show replies by date