You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2016/03/10 11:41:57 UTC
svn commit: r1734382 - in
/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag:
InputRendererBase.java OutRenderer.java TextareaRenderer.java
Author: lofwyr
Date: Thu Mar 10 10:41:57 2016
New Revision: 1734382
URL: http://svn.apache.org/viewvc?rev=1734382&view=rev
Log:
TOBAGO-1501: Refactoring: using further enums
* fix with equals
Modified:
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/InputRendererBase.java
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/OutRenderer.java
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TextareaRenderer.java
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/InputRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/InputRendererBase.java?rev=1734382&r1=1734381&r2=1734382&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/InputRendererBase.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/InputRendererBase.java Thu Mar 10 10:41:57 2016
@@ -23,6 +23,7 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.component.UITextarea;
import org.apache.myfaces.tobago.config.TobagoConfig;
import org.apache.myfaces.tobago.internal.util.StringUtils;
+import org.apache.myfaces.tobago.sanitizer.SanitizeMode;
import org.apache.myfaces.tobago.sanitizer.Sanitizer;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.slf4j.Logger;
@@ -63,7 +64,7 @@ public abstract class InputRendererBase
if (input instanceof UITextarea) {
UITextarea textarea = (UITextarea) input;
if (ComponentUtils.getDataAttribute(input, "html-editor") != null
- && "auto".equals(textarea.getSanitize())) {
+ && SanitizeMode.auto == textarea.getSanitize()) {
final Sanitizer sanitizer = TobagoConfig.getInstance(facesContext).getSanitizer();
newValue = sanitizer.sanitize(newValue);
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/OutRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/OutRenderer.java?rev=1734382&r1=1734381&r2=1734382&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/OutRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/OutRenderer.java Thu Mar 10 10:41:57 2016
@@ -27,6 +27,7 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
+import org.apache.myfaces.tobago.sanitizer.SanitizeMode;
import org.apache.myfaces.tobago.sanitizer.Sanitizer;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -76,7 +77,7 @@ public class OutRenderer extends LabelLa
}
} else { // escape="false"
writer.writeText("", null); // to ensure the closing > of the <span> start tag.
- if ("auto".equals(out.getSanitize())) {
+ if (SanitizeMode.auto == out.getSanitize()) {
final Sanitizer sanitizer = TobagoConfig.getInstance(facesContext).getSanitizer();
text = sanitizer.sanitize(text);
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TextareaRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TextareaRenderer.java?rev=1734382&r1=1734381&r2=1734382&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TextareaRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TextareaRenderer.java Thu Mar 10 10:41:57 2016
@@ -28,6 +28,7 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
+import org.apache.myfaces.tobago.sanitizer.SanitizeMode;
import org.apache.myfaces.tobago.sanitizer.Sanitizer;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -112,7 +113,7 @@ public class TextareaRenderer extends In
String currentValue = RenderUtils.currentValue(input);
if (currentValue != null) {
if (ComponentUtils.getDataAttribute(input, "html-editor") != null
- && "auto".equals(input.getSanitize())) {
+ && SanitizeMode.auto == input.getSanitize()) {
final Sanitizer sanitizer = TobagoConfig.getInstance(facesContext).getSanitizer();
currentValue = sanitizer.sanitize(currentValue);
}