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 2012/02/01 10:55:24 UTC
svn commit: r1239032 - in
/myfaces/tobago/branches/tobago-tree-table/tobago-core: ./
src/main/java-jsf-1.1-todo/
src/main/java-jsf-1.1-todo/org/apache/myfaces/tobago/internal/taglib/component/
src/main/java-jsf-1.2-todo/ src/main/java-jsf-1.2-todo/org/...
Author: lofwyr
Date: Wed Feb 1 09:55:23 2012
New Revision: 1239032
URL: http://svn.apache.org/viewvc?rev=1239032&view=rev
Log:
merged against the trunk
Modified:
myfaces/tobago/branches/tobago-tree-table/tobago-core/pom.xml
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java-jsf-1.1-todo/ (props changed)
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java-jsf-1.1-todo/org/apache/myfaces/tobago/internal/taglib/component/WizardFinishTag.java (props changed)
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java-jsf-1.1-todo/org/apache/myfaces/tobago/internal/taglib/component/WizardNextTag.java (props changed)
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java-jsf-1.2-todo/ (props changed)
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java-jsf-1.2-todo/org/apache/myfaces/tobago/internal/taglib/component/WizardFinishTag.java (props changed)
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java-jsf-1.2-todo/org/apache/myfaces/tobago/internal/taglib/component/WizardNextTag.java (props changed)
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java (props changed)
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/component/ComponentTypes.java (props changed)
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Facets.java (props changed)
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/component/RendererTypes.java (props changed)
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Tags.java (props changed)
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Capability.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceUtils.java (props changed)
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/UserAgent.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/package-info.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/HtmlResponseWriter.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterBase.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/XmlResponseWriter.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/model/TreePath.java (props changed)
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/model/Wizard.java (props changed)
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/test/java/org/apache/myfaces/tobago/context/UserAgentUnitTest.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/test/java/org/apache/myfaces/tobago/model/NodeUnitTest.java (props changed)
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/test/java/org/apache/myfaces/tobago/util/Parameterized.java (props changed)
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/pom.xml?rev=1239032&r1=1239031&r2=1239032&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/pom.xml (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/pom.xml Wed Feb 1 09:55:23 2012
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.myfaces.tobago</groupId>
<artifactId>tobago</artifactId>
- <version>1.5.2-SNAPSHOT</version>
+ <version>1.5.3-SNAPSHOT</version>
</parent>
<artifactId>tobago-core</artifactId>
<packaging>jar</packaging>
Propchange: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java-jsf-1.1-todo/
('svn:mergeinfo' removed)
Propchange: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java-jsf-1.1-todo/org/apache/myfaces/tobago/internal/taglib/component/WizardFinishTag.java
('svn:mergeinfo' removed)
Propchange: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java-jsf-1.1-todo/org/apache/myfaces/tobago/internal/taglib/component/WizardNextTag.java
('svn:mergeinfo' removed)
Propchange: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java-jsf-1.2-todo/
('svn:mergeinfo' removed)
Propchange: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java-jsf-1.2-todo/org/apache/myfaces/tobago/internal/taglib/component/WizardFinishTag.java
('svn:mergeinfo' removed)
Propchange: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java-jsf-1.2-todo/org/apache/myfaces/tobago/internal/taglib/component/WizardNextTag.java
('svn:mergeinfo' removed)
Propchange: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java
('svn:mergeinfo' removed)
Propchange: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/component/ComponentTypes.java
('svn:mergeinfo' removed)
Propchange: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Facets.java
('svn:mergeinfo' removed)
Propchange: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/component/RendererTypes.java
('svn:mergeinfo' removed)
Propchange: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Tags.java
('svn:mergeinfo' removed)
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java?rev=1239032&r1=1239031&r2=1239032&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java Wed Feb 1 09:55:23 2012
@@ -68,6 +68,7 @@ public class UIViewRoot extends javax.fa
super.setLocale(locale);
ClientProperties clientProperties = VariableResolverUtils.resolveClientProperties(getFacesContext());
clientProperties.setLocale(locale);
+ clientProperties.updateUserAgent(getFacesContext());
}
/*
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Capability.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Capability.java?rev=1239032&r1=1239031&r2=1239032&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Capability.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Capability.java Wed Feb 1 09:55:23 2012
@@ -27,5 +27,12 @@ public enum Capability {
/**
* Does the user agent support "application/xhtml+xml" as content type?
*/
- CONTENT_TYPE_XHTML
+ CONTENT_TYPE_XHTML,
+
+ /**
+ * In IE 8 and later, a compatibility mode can be activated in the user agent.
+ * For Tobago pages this should not be activated. So this property can be used to
+ * decide, if a warning should be rendered.
+ */
+ IE_COMPATIBILITY_MODE
}
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java?rev=1239032&r1=1239031&r2=1239032&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java Wed Feb 1 09:55:23 2012
@@ -17,12 +17,13 @@ package org.apache.myfaces.tobago.contex
* limitations under the License.
*/
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.commons.lang.ObjectUtils;
import org.apache.myfaces.tobago.config.TobagoConfig;
import org.apache.myfaces.tobago.internal.context.ClientPropertiesKey;
import org.apache.myfaces.tobago.layout.Measure;
import org.apache.myfaces.tobago.util.VariableResolverUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIViewRoot;
import javax.faces.context.ExternalContext;
@@ -89,15 +90,15 @@ public class ClientProperties implements
contentType = "wml";
}
}
- if (LOG.isInfoEnabled()) {
- LOG.info("contentType='" + contentType + "' from header " + "Accept='" + accept + "'");
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("contentType='" + contentType + "' from header " + "Accept='" + accept + "'");
}
// user agent
String requestUserAgent = (String) externalContext.getRequestHeaderMap().get("User-Agent");
this.userAgent = UserAgent.getInstance(requestUserAgent);
- if (LOG.isInfoEnabled()) {
- LOG.info("userAgent='" + this.userAgent + "' from header " + "'User-Agent: " + requestUserAgent + "'");
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("userAgent='" + this.userAgent + "' from header " + "'User-Agent: " + requestUserAgent + "'");
}
// theme
@@ -105,8 +106,8 @@ public class ClientProperties implements
TobagoConfig config = TobagoConfig.getInstance(facesContext);
// TODO log error if tobago config is not initialized
this.theme = config.getTheme(requestTheme);
- if (LOG.isInfoEnabled()) {
- LOG.info("theme='" + theme.getName() + "' from requestParameter " + "tobago.theme='" + requestTheme + "'");
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("theme='" + theme.getName() + "' from requestParameter " + "tobago.theme='" + requestTheme + "'");
}
reset();
@@ -211,7 +212,7 @@ public class ClientProperties implements
*/
public void setLocale(Locale locale) {
// set locale will be called "too often" from the JSF
- if (this.locale == null && locale != null || this.locale != null && locale == null || !this.locale.equals(locale)) {
+ if (! ObjectUtils.equals(this.locale, locale)) {
this.locale = locale;
reset();
}
@@ -232,4 +233,14 @@ public class ClientProperties implements
public void setHorizontalScrollbarWeight(Measure horizontalScrollbarWeight) {
this.horizontalScrollbarWeight = horizontalScrollbarWeight;
}
+
+ public void updateUserAgent(FacesContext facesContext) {
+ ExternalContext externalContext = facesContext.getExternalContext();
+ String requestUserAgent = (String) externalContext.getRequestHeaderMap().get("User-Agent");
+ final UserAgent newUserAgent = UserAgent.getInstance(requestUserAgent);
+ if (newUserAgent != userAgent) {
+ userAgent = newUserAgent;
+ reset();
+ }
+ }
}
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java?rev=1239032&r1=1239031&r2=1239032&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java Wed Feb 1 09:55:23 2012
@@ -56,6 +56,7 @@ public final class Markup implements Ser
public static final Markup ERROR = valueOf("error");
public static final Markup EVEN = valueOf("even");
public static final Markup EXPANDED = valueOf("expanded");
+ public static final Markup FILLER = valueOf("filler");
public static final Markup FATAL = valueOf("fatal");
public static final Markup FIRST = valueOf("first");
public static final Markup FOLDER = valueOf("folder");
@@ -71,6 +72,7 @@ public final class Markup implements Ser
public static final Markup REQUIRED = valueOf("required");
public static final Markup RESIZABLE = valueOf("resizable");
public static final Markup RIGHT = valueOf("right");
+ public static final Markup SECONDS = valueOf("seconds");
public static final Markup SELECTED = valueOf("selected");
public static final Markup SORTABLE = valueOf("sortable");
public static final Markup STRONG = valueOf("strong");
Propchange: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceUtils.java
('svn:mergeinfo' removed)
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/UserAgent.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/UserAgent.java?rev=1239032&r1=1239031&r2=1239032&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/UserAgent.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/UserAgent.java Wed Feb 1 09:55:23 2012
@@ -52,6 +52,9 @@ public class UserAgent implements Serial
public static final UserAgent MSIE_7_0 = new UserAgent("msie", "7_0");
+ public static final UserAgent MSIE_7_0_COMPAT
+ = new UserAgent("msie", "7_0", EnumSet.of(Capability.IE_COMPATIBILITY_MODE));
+
/**
* @deprecated no longer supported, since Tobago 1.5. Misspelled. Use {@link #MSIE_7_0}
*/
@@ -224,7 +227,11 @@ public class UserAgent implements Serial
if (header.contains("MSIE 6.0")) {
return MSIE_6_0;
} else if (header.contains("MSIE 7.0")) {
- return MSIE_7_0;
+ if (header.contains("Trident")) {
+ return MSIE_7_0_COMPAT;
+ } else {
+ return MSIE_7_0;
+ }
} else if (header.contains("MSIE 8.0")) {
return MSIE_8_0;
} else if (header.contains("MSIE 9.0")) {
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java?rev=1239032&r1=1239031&r2=1239032&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java Wed Feb 1 09:55:23 2012
@@ -91,6 +91,8 @@ public abstract class AbstractUISheet ex
private transient List<LayoutComponent> layoutComponents;
+ private transient Boolean needVerticalScrollbar;
+
public LayoutComponentRenderer getLayoutComponentRenderer(FacesContext context) {
return (LayoutComponentRenderer) getRenderer(context);
}
@@ -576,4 +578,14 @@ public abstract class AbstractUISheet ex
public boolean isRendersRowContainer() {
return true;
}
+
+ public abstract boolean isShowHeader();
+
+ public Boolean getNeedVerticalScrollbar() {
+ return needVerticalScrollbar;
+ }
+
+ public void setNeedVerticalScrollbar(Boolean needVerticalScrollbar) {
+ this.needVerticalScrollbar = needVerticalScrollbar;
+ }
}
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.java?rev=1239032&r1=1239031&r2=1239032&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.java Wed Feb 1 09:55:23 2012
@@ -269,36 +269,47 @@ public abstract class AbstractUISheetLay
// estimate need of height-scrollbar on client, if yes we have to consider
// this when calculating column width's
+ if (sheet.getNeedVerticalScrollbar() != null) {
+ return sheet.getNeedVerticalScrollbar();
+ }
+
+ Boolean result = null;
+
final Object forceScrollbar = sheet.getAttributes().get(Attributes.FORCE_VERTICAL_SCROLLBAR);
if (forceScrollbar != null) {
if ("true".equals(forceScrollbar)) {
- return true;
+ result = true;
} else if ("false".equals(forceScrollbar)) {
- return false;
+ result = false;
} else if (!"auto".equals(forceScrollbar)) {
LOG.warn("Illegal value for attribute 'forceVerticalScrollbar': '" + forceScrollbar + "'");
}
}
- if (!sheet.hasRowCount()) {
- return true;
+ if (result == null && !sheet.hasRowCount()) {
+ result = true;
}
- if (sheet.getCurrentHeight() != null) {
- int first = sheet.getFirst();
- int rows = sheet.hasRows()
- ? Math.min(sheet.getRowCount(), first + sheet.getRows()) - first
- : sheet.getRowCount();
- final LayoutComponentRenderer renderer = sheet.getLayoutComponentRenderer(facesContext);
- final Measure rowPadding = renderer.getCustomMeasure(facesContext, sheet, "rowPadding");
- LOG.error("20; // FIXME: make dynamic (was removed by changing the layout");
- Measure heightNeeded = getFooterHeight(facesContext, sheet)
- .add(rowPadding.add(20/*fixme*/).multiply(rows))
- .add(20); // FIXME: make dynamic (was removed by changing the layouting
- return heightNeeded.greaterThan(sheet.getCurrentHeight());
- } else {
- return false;
+ if (result == null) {
+ if (sheet.getCurrentHeight() != null) {
+ int first = sheet.getFirst();
+ int rows = sheet.hasRows()
+ ? Math.min(sheet.getRowCount(), first + sheet.getRows()) - first
+ : sheet.getRowCount();
+ Measure heightNeeded = getRowHeight(facesContext, sheet).multiply(rows);
+ if (sheet.isShowHeader()) {
+ heightNeeded = heightNeeded.add(getHeaderHeight(facesContext, sheet));
+ }
+ if (sheet.isPagingVisible()) {
+ heightNeeded = heightNeeded.add(getFooterHeight(facesContext, sheet));
+ }
+ result = heightNeeded.greaterThan(sheet.getCurrentHeight());
+ } else {
+ result = false;
+ }
}
+ sheet.setNeedVerticalScrollbar(result);
+ return result;
}
private void parseFixedWidth(LayoutInfo layoutInfo, List<UIColumn> rendereredColumns) {
@@ -335,6 +346,16 @@ public abstract class AbstractUISheetLay
}
}
+ private Measure getHeaderHeight(FacesContext facesContext, AbstractUISheet sheet) {
+ return sheet.isShowHeader()
+ ? sheet.getLayoutComponentRenderer(facesContext).getCustomMeasure(facesContext, sheet, "headerHeight")
+ : Measure.ZERO;
+ }
+
+ private Measure getRowHeight(FacesContext facesContext, AbstractUISheet sheet) {
+ return sheet.getLayoutComponentRenderer(facesContext).getCustomMeasure(facesContext, sheet, "rowHeight");
+ }
+
private Measure getFooterHeight(FacesContext facesContext, AbstractUISheet sheet) {
return sheet.isPagingVisible()
? sheet.getLayoutComponentRenderer(facesContext).getCustomMeasure(facesContext, sheet, "footerHeight")
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/package-info.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/package-info.java?rev=1239032&r1=1239031&r2=1239032&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/package-info.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/package-info.java Wed Feb 1 09:55:23 2012
@@ -1,6 +1,6 @@
/**
* <b>Tobago Framework Component Tag Library 1.5.x -
- * (C) Copyright 2005-2011 The Apache Software Foundation</b>
+ * (C) Copyright 2005-2012 The Apache Software Foundation</b>
*/
@org.apache.myfaces.tobago.apt.annotation.Taglib(
shortName = "tc",
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/HtmlResponseWriter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/HtmlResponseWriter.java?rev=1239032&r1=1239031&r2=1239032&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/HtmlResponseWriter.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/HtmlResponseWriter.java Wed Feb 1 09:55:23 2012
@@ -21,11 +21,13 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.internal.util.HtmlWriterUtils;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
+import org.apache.myfaces.tobago.util.FacesVersion;
import javax.faces.component.UIComponent;
import javax.faces.context.ResponseWriter;
import java.io.IOException;
import java.io.Writer;
+import java.util.Arrays;
import java.util.Map;
public class HtmlResponseWriter extends TobagoResponseWriterBase {
@@ -59,6 +61,16 @@ public class HtmlResponseWriter extends
}
@Override
+ public void write(final char[] cbuf, final int off, final int len) throws IOException {
+ // XXX Related to http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-696
+ if (! FacesVersion.supports21() && Arrays.equals(cbuf, XML_VERSION_1_0_ENCODING_UTF_8_CHARS)) {
+ // drop
+ } else {
+ super.write(cbuf, off, len);
+ }
+ }
+
+ @Override
protected final void closeEmptyTag() throws IOException {
getWriter().write("\n>");
}
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterBase.java?rev=1239032&r1=1239031&r2=1239032&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterBase.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterBase.java Wed Feb 1 09:55:23 2012
@@ -17,14 +17,14 @@ package org.apache.myfaces.tobago.intern
* limitations under the License.
*/
-import org.apache.myfaces.tobago.internal.util.Deprecation;
-import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.myfaces.tobago.component.Attributes;
+import org.apache.myfaces.tobago.internal.util.Deprecation;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
+import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import java.io.IOException;
@@ -49,6 +49,16 @@ public abstract class TobagoResponseWrit
HtmlElements.BASE,
HtmlElements.META));
+ /** @deprecated Since Tobago 1.5.3 */
+ @Deprecated
+ public static final String XML_VERSION_1_0_ENCODING_UTF_8 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+
+ /** @deprecated Since Tobago 1.5.3 */
+ @Deprecated
+ public static final int XML_VERSION_1_0_ENCODING_UTF_8_LENGTH = XML_VERSION_1_0_ENCODING_UTF_8.length();
+
+ protected static final char[] XML_VERSION_1_0_ENCODING_UTF_8_CHARS = XML_VERSION_1_0_ENCODING_UTF_8.toCharArray();
+
private UIComponent component;
private boolean startStillOpen;
@@ -69,8 +79,6 @@ public abstract class TobagoResponseWrit
return writer;
}
-
-
protected final UIComponent getComponent() {
return component;
}
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/XmlResponseWriter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/XmlResponseWriter.java?rev=1239032&r1=1239031&r2=1239032&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/XmlResponseWriter.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/XmlResponseWriter.java Wed Feb 1 09:55:23 2012
@@ -18,9 +18,8 @@ package org.apache.myfaces.tobago.intern
*/
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
+import org.apache.myfaces.tobago.util.FacesVersion;
import org.apache.myfaces.tobago.util.XmlUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import javax.faces.context.ResponseWriter;
import java.io.IOException;
@@ -29,15 +28,10 @@ import java.util.Arrays;
public final class XmlResponseWriter extends TobagoResponseWriterBase {
- private static final Logger LOG = LoggerFactory.getLogger(XmlResponseWriter.class);
-
private static final String XHTML_DOCTYPE =
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
+ " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
- public static final String XML_VERSION_1_0_ENCODING_UTF_8 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
- public static final int XML_VERSION_1_0_ENCODING_UTF_8_LENGTH = XML_VERSION_1_0_ENCODING_UTF_8.length();
-
public XmlResponseWriter(
Writer writer, String contentType, String characterEncoding) {
super(writer, contentType, characterEncoding);
@@ -57,14 +51,10 @@ public final class XmlResponseWriter ext
}
@Override
- public void write(char[] cbuf, int off, int len) throws IOException {
-
- // XXX Seems to be related to http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-696
- if (cbuf.length == XML_VERSION_1_0_ENCODING_UTF_8_LENGTH
- && Arrays.equals(cbuf, XML_VERSION_1_0_ENCODING_UTF_8.toCharArray())) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Filtering XML header: " + new String(cbuf));
- }
+ public void write(final char[] cbuf, final int off, final int len) throws IOException {
+ // XXX Related to http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-696
+ if (! FacesVersion.supports21() && Arrays.equals(cbuf, XML_VERSION_1_0_ENCODING_UTF_8_CHARS)) {
+ // drop
} else {
super.write(cbuf, off, len);
}
Propchange: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/model/TreePath.java
('svn:mergeinfo' removed)
Propchange: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/model/Wizard.java
('svn:mergeinfo' removed)
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/test/java/org/apache/myfaces/tobago/context/UserAgentUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/test/java/org/apache/myfaces/tobago/context/UserAgentUnitTest.java?rev=1239032&r1=1239031&r2=1239032&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/test/java/org/apache/myfaces/tobago/context/UserAgentUnitTest.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/test/java/org/apache/myfaces/tobago/context/UserAgentUnitTest.java Wed Feb 1 09:55:23 2012
@@ -63,10 +63,23 @@ public class UserAgentUnitTest {
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727;"
+ " .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"},
+ {"Internet Explorer 8 - Compatibility Mode - Windows XP",
+ UserAgent.MSIE_7_0_COMPAT,
+ "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0)"},
+
{"Internet Explorer 9 preview - Windows 7",
UserAgent.MSIE_9_0,
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"},
+ {"Internet Explorer 9 - Windows 7",
+ UserAgent.MSIE_9_0,
+ "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)"},
+
+ {"Internet Explorer 9 - Compatibility Mode - Windows 7",
+ UserAgent.MSIE_7_0_COMPAT,
+ "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Win64; x64; Trident/5.0; "
+ + ".NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)"},
+
{"Firefox 3.6 - Ubuntu 10.4",
UserAgent.GECKO_1_9,
"Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2) Gecko/20100308 Ubuntu/10.04 (lucid) Firefox/3.6"},
Propchange: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/test/java/org/apache/myfaces/tobago/model/NodeUnitTest.java
('svn:mergeinfo' removed)
Propchange: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/test/java/org/apache/myfaces/tobago/util/Parameterized.java
('svn:mergeinfo' removed)