You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by gr...@apache.org on 2005/05/11 18:45:12 UTC
svn commit: r169655 [8/8] - in /myfaces/trunk:
src/cactus/org/apache/myfaces/renderkit/html/
src/cactus/org/apache/myfaces/taglib/core/
src/cactus/org/apache/myfaces/taglib/html/
src/components/org/apache/myfaces/renderkit/html/ext/
src/components/org/apache/myfaces/taglib/html/ext/
src/junit/org/apache/myfaces/renderkit/
src/junit/org/apache/myfaces/renderkit/html/
src/junit/org/apache/myfaces/renderkit/html/util/
src/junit/org/apache/myfaces/util/ src/junit/org/apache/myfaces/webapp/
src/myfaces/org/apache/myfaces/lifecycle/
src/myfaces/org/apache/myfaces/portlet/
src/myfaces/org/apache/myfaces/renderkit/
src/myfaces/org/apache/myfaces/renderkit/html/
src/myfaces/org/apache/myfaces/taglib/core/
src/myfaces/org/apache/myfaces/taglib/html/
src/myfaces/org/apache/myfaces/util/ src/myfaces/org/apache/myfaces/webapp/
src/myfaces/org/apache/myfaces/webapp/filter/
src/share/org/apache/myfaces/renderkit/
src/share/org/apache/myfaces/renderkit/html/
src/share/org/apache/myfaces/renderkit/html/util/
src/share/org/apache/myfaces/taglib/
src/share/org/apache/myfaces/taglib/core/
src/share/org/apache/myfaces/taglib/html/ src/share/org/apache/myfaces/util/
src/share/org/apache/myfaces/webapp/webxml/
src/wml/org/apache/myfaces/wap/base/ src/wml/org/apache/myfaces/wap/def/
src/wml/org/apache/myfaces/wap/renderkit/
src/wml/org/apache/myfaces/wap/renderkit/wml/
src/xdoclet/org/apache/myfaces/xdoclet/
webapps/src/example/org/apache/myfaces/examples/validate/
Modified: myfaces/trunk/src/wml/org/apache/myfaces/wap/renderkit/wml/TableRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/wml/org/apache/myfaces/wap/renderkit/wml/TableRenderer.java?rev=169655&r1=169654&r2=169655&view=diff
==============================================================================
--- myfaces/trunk/src/wml/org/apache/myfaces/wap/renderkit/wml/TableRenderer.java (original)
+++ myfaces/trunk/src/wml/org/apache/myfaces/wap/renderkit/wml/TableRenderer.java Wed May 11 09:45:06 2005
@@ -1,12 +1,12 @@
/*
* Copyright 2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,94 +34,90 @@
/**
* @author <a href="mailto:Jiri.Zaloudek@ivancice.cz">Jiri Zaloudek</a> (latest modification by $Author$)
- * @version $Revision$ $Date$
- * $Log$
- * Revision 1.1 2004/12/30 09:37:26 matzew
- * added a new RenderKit for WML. Thanks to Jirí aloudek
- *
+ * @version $Revision$ $Date$
*/
public class TableRenderer extends WmlRenderer {
private static Log log = LogFactory.getLog(TableRenderer.class);
-
+
/** Creates a new instance of TableRenderer */
public TableRenderer() {
super();
log.debug("created object " + this.getClass().getName());
}
-
+
public boolean getRendersChildren(){
return(true);
}
-
+
public void encodeBegin(FacesContext context, UIComponent component) throws java.io.IOException {
log.debug("encodeBegin(" + component.getId() + ")");
-
+
if (context == null || component == null) {
throw new NullPointerException();
}
if (!component.isRendered()) return;
// rendered in method encodeEnd
}
-
+
public void encodeChildren(FacesContext context, UIComponent component) throws java.io.IOException {
log.debug("encodeChildren(" + component.getId() + ")");
if (context == null || component == null) {
throw new NullPointerException();
}
if (!component.isRendered()) return;
-
+
// rendered in method encodeEnd
}
-
+
public void encodeEnd(FacesContext context, UIComponent component) throws java.io.IOException {
log.debug("encodeEnd(" + component.getId() + ")");
if (context == null || component == null) {
throw new NullPointerException();
}
if (!component.isRendered()) return;
-
+
ResponseWriter writer = context.getResponseWriter();
DataTable comp = (DataTable)component;
-
+
// number of columns equals count of childern (UIColumn elements)
int columns = component.getChildCount();
-
+
// If no columns was found, the table element will not be rendered.
if (columns == 0) return;
-
+
writer.startElement(Attributes.TABLE, component);
RendererUtils.writeAttribute(Attributes.ID, comp.getClientId(context), writer);
RendererUtils.writeAttribute(Attributes.CLASS, comp.getStyleClass(), writer);
RendererUtils.writeAttribute(Attributes.XML_LANG, comp.getXmllang(), writer);
-
+
RendererUtils.writeAttribute(Attributes.ALIGN, comp.getAlign(), writer);
-
+
RendererUtils.writeAttribute(Attributes.COLUMNS, new Integer(columns), writer);
RendererUtils.writeAttribute(Attributes.TITLE, comp.getTitle(), writer);
-
+
if (hasHeaderOrFooter(context, component, true))
renderHeaderOrFooter(context, component, true);
-
+
renderChildren(context, component);
-
+
if (hasHeaderOrFooter(context, component, false))
renderHeaderOrFooter(context, component, false);
-
+
writer.endElement(Attributes.TABLE);
}
-
+
public void decode(FacesContext context, UIComponent component) {
if (component == null ) throw new NullPointerException();
}
-
+
private void renderChildren(FacesContext context, UIComponent component) throws IOException {
ResponseWriter writer = context.getResponseWriter();
-
-
+
+
log.debug("Childern: " + component.getChildCount() + " of Component " + component.getFamily());
-
+
UIData comp = (UIData)component;
-
+
int first = comp.getFirst();
int rows = comp.getRows();
int rowCount = comp.getRowCount();
@@ -130,16 +126,16 @@
}
int last = first + rows;
if (last > rowCount) last = rowCount;
-
+
for (int i = first; i < last; i++){
writer.startElement(Attributes.TR, component);
comp.setRowIndex(i);
-
+
if (!comp.isRowAvailable()){
log.error("Row: " + i + " is not available.");
continue;
}
-
+
Iterator columns = component.getChildren().iterator();
while (columns.hasNext()){
UIComponent column = (UIComponent)columns.next();
@@ -147,7 +143,7 @@
log.error("Only column elements can be nested in dataTable.");
break;
}
-
+
writer.startElement(Attributes.TD, component);
RendererUtils.renderChild(context, column);
writer.endElement(Attributes.TD);
@@ -155,30 +151,30 @@
writer.endElement(Attributes.TR);
}
}
-
+
/** renders header or footer of the table */
private void renderHeaderOrFooter(FacesContext context, UIComponent component, boolean header) throws IOException {
ResponseWriter writer = context.getResponseWriter();
-
+
writer.startElement(Attributes.TR, component);
-
- Iterator columns = component.getChildren().iterator();
+
+ Iterator columns = component.getChildren().iterator();
while (columns.hasNext()){
UIComponent column = (UIComponent)columns.next();
if (!(column instanceof UIColumn)) {
log.error("Only column elements can be nested in dataTable.");
break;
}
-
+
UIComponent facet = header ? ((UIColumn)column).getHeader() : ((UIColumn)column).getFooter();
-
+
writer.startElement(Attributes.TD, component);
RendererUtils.renderChild(context, facet);
writer.endElement(Attributes.TD);
}
writer.endElement(Attributes.TR);
}
-
+
/** Checks if the table has any header or footer. */
private boolean hasHeaderOrFooter(FacesContext context, UIComponent component, boolean header){
Iterator childn = component.getChildren().iterator();
Modified: myfaces/trunk/src/xdoclet/org/apache/myfaces/xdoclet/FacesConfigSubTask.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/xdoclet/org/apache/myfaces/xdoclet/FacesConfigSubTask.java?rev=169655&r1=169654&r2=169655&view=diff
==============================================================================
--- myfaces/trunk/src/xdoclet/org/apache/myfaces/xdoclet/FacesConfigSubTask.java (original)
+++ myfaces/trunk/src/xdoclet/org/apache/myfaces/xdoclet/FacesConfigSubTask.java Wed May 11 09:45:06 2005
@@ -1,12 +1,12 @@
/*
* Copyright 2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -24,25 +24,21 @@
* parent="xdoclet.DocletTask"
*
* @author <a href="mailto:Jiri.Zaloudek@ivancice.cz">Jiri Zaloudek</a> (latest modification by $Author$)
- * @version $Revision$ $Date$
- * $Log$
- * Revision 1.1 2004/12/30 09:37:27 matzew
- * added a new RenderKit for WML. Thanks to Jirí aloudek
- *
+ * @version $Revision$ $Date$
*/
-public class FacesConfigSubTask extends TemplateSubTask {
-
+public class FacesConfigSubTask extends TemplateSubTask {
+
/** Creates a new instance of TagSubTask */
public FacesConfigSubTask() {
setDestinationFile("{0}Tag.java");
setTemplateURL(getClass().getResource("/org/apache/myfaces/xdoclet/resources/faces-config.xdt"));
}
-
+
public void validateOptions() throws XDocletException {
super.validateOptions();
if (getDestinationFile() == null) {
- throw new XDocletException("Ant Doclet Subtaksk FacesConfigSubTaks: You have to set attribute 'destinationFile'.");
+ throw new XDocletException("Ant Doclet Subtaksk FacesConfigSubTaks: You have to set attribute 'destinationFile'.");
}
}
-
+
}
Modified: myfaces/trunk/webapps/src/example/org/apache/myfaces/examples/validate/ValidateForm.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/webapps/src/example/org/apache/myfaces/examples/validate/ValidateForm.java?rev=169655&r1=169654&r2=169655&view=diff
==============================================================================
--- myfaces/trunk/webapps/src/example/org/apache/myfaces/examples/validate/ValidateForm.java (original)
+++ myfaces/trunk/webapps/src/example/org/apache/myfaces/examples/validate/ValidateForm.java Wed May 11 09:45:06 2005
@@ -1,12 +1,12 @@
/*
* Copyright 2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -18,16 +18,6 @@
/**
* @author mwessendorf
* @version $Revision$ $Date$
- * $Log$
- * Revision 1.1 2005/03/24 16:47:10 matzew
- * changed (again) example webapp stuff
- *
- * Revision 1.1 2005/03/12 11:40:08 matzew
- * refactoring sample web apps (one website and one simple app)
- *
- * Revision 1.3 2004/11/21 12:39:09 mmarinschek
- * better Error handling
- *
*/
public class ValidateForm {
@@ -35,12 +25,12 @@
private String email2 = null;
private String creditCardNumber = null;
private String regExpr = null;
-
+
private String equal = null;
private String equal2 = null;
-
+
private String isbn =null;
-
+
public String getEmail() {
return email;
@@ -49,7 +39,7 @@
public void setEmail(String string) {
email = string;
}
-
+
public String submit(){
System.out.println("Action was called.");
return ("valid");