You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2007/02/11 19:49:54 UTC
svn commit: r506091 - in /myfaces/tobago/trunk:
core/src/main/java/org/apache/myfaces/tobago/webapp/
sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/wml/standard/standard/tag/
theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderki...
Author: bommel
Date: Sun Feb 11 10:49:53 2007
New Revision: 506091
URL: http://svn.apache.org/viewvc?view=rev&rev=506091
Log:
(TOBAGO-278) Adjust TobagoResponseWriter methods to javax.faces.ResponseWriter
Modified:
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java
myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/wml/standard/standard/tag/PageRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/mozilla_4_7/tag/ProgressRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/OutRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java?view=diff&rev=506091&r1=506090&r2=506091
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java Sun Feb 11 10:49:53 2007
@@ -123,29 +123,30 @@
throws IOException {
writer.write(cbuf, off, len);
}
-
+ // TODO Remove this
public void write(final String str) throws IOException {
- if (startStillOpen) {
- writer.write("\n>");
- startStillOpen = false;
- }
+ closeOpenTag();
super.write(str);
}
public void close() throws IOException {
+ closeOpenTag();
writer.close();
}
public void flush() throws IOException {
- writer.flush();
+ /*
+ From the api:
+ Flush any ouput buffered by the output method to the underlying Writer or OutputStream.
+ This method will not flush the underlying Writer or OutputStream;
+ it simply clears any values buffered by this ResponseWriter.
+ */
+ closeOpenTag();
}
public void writeText(final Object text, final String property)
throws IOException {
- if (startStillOpen) {
- writer.write("\n>");
- startStillOpen = false;
- }
+ closeOpenTag();
final String value = findValue(text, property);
if (insideScriptOrStyle) {
write(value);
@@ -158,12 +159,16 @@
}
}
- public void writeText(final char[] text, final int offset, final int length)
- throws IOException {
+ private void closeOpenTag() throws IOException {
if (startStillOpen) {
writer.write("\n>");
startStillOpen = false;
}
+ }
+
+ public void writeText(final char[] text, final int offset, final int length)
+ throws IOException {
+ closeOpenTag();
if (insideScriptOrStyle) {
writer.write(text, offset, length);
} else {
@@ -279,10 +284,7 @@
}
public void writeComment(final Object obj) throws IOException {
- if (startStillOpen) {
- writer.write("\n>");
- startStillOpen = false;
- }
+ closeOpenTag();
String comment = obj.toString();
write("<!--");
if (comment.indexOf("--") < 0) {
Modified: myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/wml/standard/standard/tag/PageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/wml/standard/standard/tag/PageRenderer.java?view=diff&rev=506091&r1=506090&r2=506091
==============================================================================
--- myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/wml/standard/standard/tag/PageRenderer.java (original)
+++ myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/wml/standard/standard/tag/PageRenderer.java Sun Feb 11 10:49:53 2007
@@ -65,6 +65,7 @@
writer.startElement("wml", page);
writer.startElement("card", page);
+ writer.writeText("", null);
writer.write(content.toString());
writer.endElement("card");
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/mozilla_4_7/tag/ProgressRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/mozilla_4_7/tag/ProgressRenderer.java?view=diff&rev=506091&r1=506090&r2=506091
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/mozilla_4_7/tag/ProgressRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/mozilla_4_7/tag/ProgressRenderer.java Sun Feb 11 10:49:53 2007
@@ -65,6 +65,7 @@
writer.startElement(HtmlConstants.TD, null);
writer.writeAttribute(HtmlAttributes.STYLE, "background-color: #aabbcc;", null);
writer.writeAttribute(HtmlAttributes.WIDTH, Integer.toString(model.getValue()), null);
+ writer.writeText("", null);
writer.write(" ");
writer.endElement(HtmlConstants.TD);
@@ -72,6 +73,7 @@
writer.writeAttribute(HtmlAttributes.STYLE, "background-color: #ddeeff;", null);
writer.writeAttribute(HtmlAttributes.WIDTH,
Integer.toString(model.getMaximum() - model.getValue()), null);
+ writer.writeText("", null);
writer.write(" ");
writer.endElement(HtmlConstants.TD);
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/OutRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/OutRenderer.java?view=diff&rev=506091&r1=506090&r2=506091
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/OutRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/OutRenderer.java Sun Feb 11 10:49:53 2007
@@ -69,6 +69,7 @@
}
}
} else {
+ writer.writeText("", null);
writer.write(text);
}
if (createSpan) {
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java?view=diff&rev=506091&r1=506090&r2=506091
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java Sun Feb 11 10:49:53 2007
@@ -205,6 +205,7 @@
if (styleBlocks.size() > 0) {
writer.startElement(HtmlConstants.STYLE, null);
for (String cssBlock : styleBlocks) {
+ writer.flush();
writer.write(cssBlock);
}
writer.endElement(HtmlConstants.STYLE);
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java?view=diff&rev=506091&r1=506090&r2=506091
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java Sun Feb 11 10:49:53 2007
@@ -144,7 +144,7 @@
writer.writeIdAttribute(clientId);
writer.writeAttribute(HtmlAttributes.STYLE, null, ATTR_STYLE_BODY);
-
+ writer.writeText("", null);
writer.write(RichTextEditorRenderer.contentToHtml(content));
writer.endElement(HtmlConstants.DIV);
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java?view=diff&rev=506091&r1=506090&r2=506091
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java Sun Feb 11 10:49:53 2007
@@ -273,6 +273,7 @@
writer.startElement(HtmlConstants.DIV, null);
writer.writeClassAttribute("tobago-sheet-header");
+ writer.writeText("", null);
writer.write(" ");
writer.endElement(HtmlConstants.DIV);
@@ -418,7 +419,7 @@
sheetId + "_data_row_" + visibleIndex + "_column_filler");
writer.writeClassAttribute("tobago-sheet-cell-outer");
writer.writeAttribute(HtmlAttributes.STYLE, "width: 0px;", null);
-
+ writer.writeText("", null);
writer.write(" ");
writer.endElement(HtmlConstants.DIV);
@@ -480,6 +481,7 @@
writer.writeClassAttribute(className);
writer.writeAttribute(HtmlAttributes.TITLE, ResourceManagerUtil.getPropertyNotNull(
facesContext, "tobago", "sheetPagingInfoRowPagingTip"), null);
+ writer.writeText("", null);
writer.write(createSheetPagingInfo(data, facesContext,
pagerCommandId, true));
writer.endElement(HtmlConstants.SPAN);
@@ -528,6 +530,7 @@
+ pagerCommandId + "', '" + pagingOnClick + "')", null);
writer.writeAttribute(HtmlAttributes.TITLE, ResourceManagerUtil.getPropertyNotNull(
facesContext, "tobago", "sheetPagingInfoPagePagingTip"), null);
+ writer.writeText("", null);
writer.write(createSheetPagingInfo(
data, facesContext, pagerCommandId, false));
writer.endElement(HtmlConstants.SPAN);
@@ -1075,6 +1078,7 @@
writer.writeAttribute(HtmlAttributes.HREF, "javascript: tobagoSheetSetPagerPage('"
+ id + "', '" + skip + hrefPostfix, null);
}
+ writer.writeText("", null);
writer.write(str);
writer.endElement(type);
}
@@ -1091,7 +1095,8 @@
.getRequestParameterMap().get(AjaxPhaseListener.AJAX_COMPONENT_ID);
if (ajaxId.equals(component.getClientId(facesContext))) {
if (component.getFacet(FACET_RELOAD) != null && component.getFacet(FACET_RELOAD) instanceof UIReload
- && component.getFacet(FACET_RELOAD).isRendered()) {
+ && component.getFacet(FACET_RELOAD).isRendered()
+ && ajaxId.equals(ComponentUtil.findPage(component).getActionId())) {
UIReload reload = (UIReload) component.getFacet(FACET_RELOAD);
update = reload.getUpdate();
}