myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r427657 [34/42] - in /myfaces: core/trunk/api/src/main/java/javax/faces/component/ core/trunk/api/src/test/java/javax/faces/ core/trunk/api/src/test/java/javax/faces/application/ core/trunk/api/src/test/java/javax/faces/component/ core/trun...
Date Tue, 01 Aug 2006 17:44:01 GMT
Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/inputsuggestajax/InputSuggestAjaxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/inputsuggestajax/InputSuggestAjaxRenderer.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/inputsuggestajax/InputSuggestAjaxRenderer.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/inputsuggestajax/InputSuggestAjaxRenderer.java Tue Aug  1 10:43:28 2006
@@ -1,179 +1,179 @@
-/*
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.myfaces.custom.suggestajax.inputsuggestajax;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.custom.ajax.api.AjaxRenderer;
-import org.apache.myfaces.custom.dojo.DojoConfig;
-import org.apache.myfaces.custom.dojo.DojoUtils;
-import org.apache.myfaces.custom.suggestajax.SuggestAjaxRenderer;
-import org.apache.myfaces.renderkit.html.util.AddResource;
-import org.apache.myfaces.renderkit.html.util.AddResourceFactory;
-import org.apache.myfaces.shared_tomahawk.renderkit.JSFAttr;
-import org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils;
-import org.apache.myfaces.shared_tomahawk.renderkit.html.HTML;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * @author Gerald Müllan
- * @author Martin Marinschek
- * @version $Revision: 177984 $ $Date: 2005-05-23 19:39:37 +0200 (Mon, 23 May 2005) $
- */
-public class InputSuggestAjaxRenderer extends SuggestAjaxRenderer implements AjaxRenderer
-{
-    private static final Log log = LogFactory.getLog(InputSuggestAjaxRenderer.class);
-
-   /**
-     * Encodes any stand-alone javascript functions that are needed.
-     * Uses either the extension filter, or a
-     * user-supplied location for the javascript files.
-     *
-     * @param context FacesContext
-     * @param component UIComponent
-     * @throws java.io.IOException
-     */
-    private void encodeJavascript(FacesContext context, UIComponent component)
-                                                                        throws IOException
-    {
-        String javascriptLocation = (String)component.getAttributes().get(JSFAttr.JAVASCRIPT_LOCATION);
-        String styleLocation = (String)component.getAttributes().get(JSFAttr.STYLE_LOCATION);
-
-        DojoUtils.addMainInclude(context, component, javascriptLocation, new DojoConfig());
-        DojoUtils.addRequire(context, component, "extensions.FacesIO");
-        DojoUtils.addRequire(context, component, "dojo.widget.ComboBox");
-        DojoUtils.addRequire(context, component, "extensions.ComboBox");
-        DojoUtils.addRequire(context, component, "dojo.widget.Wizard");
-        DojoUtils.addRequire(context, component, "dojo.event.*");
-
-        AddResource addResource = AddResourceFactory.getInstance(context);
-
-        InputSuggestAjax inputSuggestAjax = (InputSuggestAjax) component;
-
-        if (inputSuggestAjax.getPopupStyleClass() == null)
-        {
-            if( styleLocation != null)
-            {
-                addResource.addStyleSheet(context, AddResource.HEADER_BEGIN, styleLocation + "/input_suggest.css");
-            }
-            else
-            {
-                String theme = ((InputSuggestAjax)component).getLayout();
-                if(theme == null)
-                    theme = "default";
-                addResource.addStyleSheet(context, AddResource.HEADER_BEGIN, InputSuggestAjaxRenderer.class, theme + "/input_suggest.css");
-            }
-        }
-    }
-
-    public void encodeEnd(FacesContext context, UIComponent component) throws IOException
-    {
-        RendererUtils.checkParamValidity(context, component, InputSuggestAjax.class);
-
-        InputSuggestAjax inputSuggestAjax = (InputSuggestAjax) component;
-
-        encodeJavascript(context,component);
-
-        inputSuggestAjax.getAttributes().put("autocomplete","off");
-
-    /*     String oldStyleClass = inputSuggestAjax.getStyleClass();
-    inputSuggestAjax.setStyleClass(
-            (oldStyleClass!=null && oldStyleClass.length()>=0 ? oldStyleClass : "")+" myFacesInputSuggestAjax");
-
-    inputSuggestAjax.setStyleClass(oldStyleClass);*/
-
-        String clientId = component.getClientId(context);
-        String actionURL = getActionUrl(context);
-
-        String charset = (inputSuggestAjax.getCharset() != null ? inputSuggestAjax.getCharset() : "");
-
-        String ajaxUrl = context.getExternalContext().encodeActionURL(actionURL+"?affectedAjaxComponent=" + clientId +
-                "&charset=" + charset + "&" + clientId + "=%{searchString}");
-
-        ResponseWriter out = context.getResponseWriter();
-
-        String value = RendererUtils.getStringValue(context, component);
-
-        out.startElement(HTML.INPUT_ELEM, component);
-        renderId(context, component);
-        out.writeAttribute(HTML.NAME_ATTR, clientId, null);
-        out.writeAttribute(HTML.SIZE_ATTR, "100px", null);
-        out.writeAttribute("dojoType", "combobox", null);
-        out.writeAttribute("dataUrl", ajaxUrl, null);
-        out.writeAttribute("mode", "remote", null);
-        if (value != null && value.length()>0)
-        {
-            out.writeAttribute(HTML.VALUE_ATTR, value, null);
-        }
-
-        if (isDisabled(context, component))
-        {
-            out.writeAttribute(HTML.DISABLED_ATTR, Boolean.TRUE, null);
-        }
-
-        out.endElement(HTML.INPUT_ELEM);
-
-        out.startElement(HTML.SCRIPT_ELEM, null);
-        out.writeAttribute(HTML.TYPE_ATTR, HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT, null);
-        out.write("dojo.event.connect(window, \"onload\", function(evt) {\n"
-                    + "var comboWidget = dojo.widget.byId(\""+ clientId +"\");\n"
-                    + "comboWidget.textInputNode.value = \""+ value +"\";\n"
-                    + "comboWidget.comboBoxValue.value = \""+ value +"\";\n");
-        out.write("});\n");
-        out.endElement(HTML.SCRIPT_ELEM);
-    }
-
-    public void encodeAjax(FacesContext context, UIComponent uiComponent)
-                                                                    throws IOException
-    {
-        Collection suggesteds = getSuggestedItems(context, uiComponent);
-
-        StringBuffer buf = new StringBuffer();
-
-        buf.append("[");
-
-        int suggestedCount=0;
-
-        //writing the suggested list
-        for (Iterator suggestedItem = suggesteds.iterator() ; suggestedItem.hasNext() ; suggestedCount++)
-        {
-            if( suggestedCount > DEFAULT_MAX_SUGGESTED_ITEMS)
-                break;
-
-            Object item = suggestedItem.next();
-
-            buf.append("[\"").append(item.toString()).append("\",\"")
-                .append(item.toString().substring(0, 1).toUpperCase()).append("\"],");
-        }
-
-        buf.append("];");
-
-        context.getResponseWriter().write(buf.toString());
-    }
-
-    public void decode(FacesContext facesContext, UIComponent component)
-    {
-        super.decode(facesContext, component);
-    }
-
-}
+/*
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.myfaces.custom.suggestajax.inputsuggestajax;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.custom.ajax.api.AjaxRenderer;
+import org.apache.myfaces.custom.dojo.DojoConfig;
+import org.apache.myfaces.custom.dojo.DojoUtils;
+import org.apache.myfaces.custom.suggestajax.SuggestAjaxRenderer;
+import org.apache.myfaces.renderkit.html.util.AddResource;
+import org.apache.myfaces.renderkit.html.util.AddResourceFactory;
+import org.apache.myfaces.shared_tomahawk.renderkit.JSFAttr;
+import org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils;
+import org.apache.myfaces.shared_tomahawk.renderkit.html.HTML;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Iterator;
+
+/**
+ * @author Gerald Müllan
+ * @author Martin Marinschek
+ * @version $Revision: 177984 $ $Date: 2005-05-23 19:39:37 +0200 (Mon, 23 May 2005) $
+ */
+public class InputSuggestAjaxRenderer extends SuggestAjaxRenderer implements AjaxRenderer
+{
+    private static final Log log = LogFactory.getLog(InputSuggestAjaxRenderer.class);
+
+   /**
+     * Encodes any stand-alone javascript functions that are needed.
+     * Uses either the extension filter, or a
+     * user-supplied location for the javascript files.
+     *
+     * @param context FacesContext
+     * @param component UIComponent
+     * @throws java.io.IOException
+     */
+    private void encodeJavascript(FacesContext context, UIComponent component)
+                                                                        throws IOException
+    {
+        String javascriptLocation = (String)component.getAttributes().get(JSFAttr.JAVASCRIPT_LOCATION);
+        String styleLocation = (String)component.getAttributes().get(JSFAttr.STYLE_LOCATION);
+
+        DojoUtils.addMainInclude(context, component, javascriptLocation, new DojoConfig());
+        DojoUtils.addRequire(context, component, "extensions.FacesIO");
+        DojoUtils.addRequire(context, component, "dojo.widget.ComboBox");
+        DojoUtils.addRequire(context, component, "extensions.ComboBox");
+        DojoUtils.addRequire(context, component, "dojo.widget.Wizard");
+        DojoUtils.addRequire(context, component, "dojo.event.*");
+
+        AddResource addResource = AddResourceFactory.getInstance(context);
+
+        InputSuggestAjax inputSuggestAjax = (InputSuggestAjax) component;
+
+        if (inputSuggestAjax.getPopupStyleClass() == null)
+        {
+            if( styleLocation != null)
+            {
+                addResource.addStyleSheet(context, AddResource.HEADER_BEGIN, styleLocation + "/input_suggest.css");
+            }
+            else
+            {
+                String theme = ((InputSuggestAjax)component).getLayout();
+                if(theme == null)
+                    theme = "default";
+                addResource.addStyleSheet(context, AddResource.HEADER_BEGIN, InputSuggestAjaxRenderer.class, theme + "/input_suggest.css");
+            }
+        }
+    }
+
+    public void encodeEnd(FacesContext context, UIComponent component) throws IOException
+    {
+        RendererUtils.checkParamValidity(context, component, InputSuggestAjax.class);
+
+        InputSuggestAjax inputSuggestAjax = (InputSuggestAjax) component;
+
+        encodeJavascript(context,component);
+
+        inputSuggestAjax.getAttributes().put("autocomplete","off");
+
+    /*     String oldStyleClass = inputSuggestAjax.getStyleClass();
+    inputSuggestAjax.setStyleClass(
+            (oldStyleClass!=null && oldStyleClass.length()>=0 ? oldStyleClass : "")+" myFacesInputSuggestAjax");
+
+    inputSuggestAjax.setStyleClass(oldStyleClass);*/
+
+        String clientId = component.getClientId(context);
+        String actionURL = getActionUrl(context);
+
+        String charset = (inputSuggestAjax.getCharset() != null ? inputSuggestAjax.getCharset() : "");
+
+        String ajaxUrl = context.getExternalContext().encodeActionURL(actionURL+"?affectedAjaxComponent=" + clientId +
+                "&charset=" + charset + "&" + clientId + "=%{searchString}");
+
+        ResponseWriter out = context.getResponseWriter();
+
+        String value = RendererUtils.getStringValue(context, component);
+
+        out.startElement(HTML.INPUT_ELEM, component);
+        renderId(context, component);
+        out.writeAttribute(HTML.NAME_ATTR, clientId, null);
+        out.writeAttribute(HTML.SIZE_ATTR, "100px", null);
+        out.writeAttribute("dojoType", "combobox", null);
+        out.writeAttribute("dataUrl", ajaxUrl, null);
+        out.writeAttribute("mode", "remote", null);
+        if (value != null && value.length()>0)
+        {
+            out.writeAttribute(HTML.VALUE_ATTR, value, null);
+        }
+
+        if (isDisabled(context, component))
+        {
+            out.writeAttribute(HTML.DISABLED_ATTR, Boolean.TRUE, null);
+        }
+
+        out.endElement(HTML.INPUT_ELEM);
+
+        out.startElement(HTML.SCRIPT_ELEM, null);
+        out.writeAttribute(HTML.TYPE_ATTR, HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT, null);
+        out.write("dojo.event.connect(window, \"onload\", function(evt) {\n"
+                    + "var comboWidget = dojo.widget.byId(\""+ clientId +"\");\n"
+                    + "comboWidget.textInputNode.value = \""+ value +"\";\n"
+                    + "comboWidget.comboBoxValue.value = \""+ value +"\";\n");
+        out.write("});\n");
+        out.endElement(HTML.SCRIPT_ELEM);
+    }
+
+    public void encodeAjax(FacesContext context, UIComponent uiComponent)
+                                                                    throws IOException
+    {
+        Collection suggesteds = getSuggestedItems(context, uiComponent);
+
+        StringBuffer buf = new StringBuffer();
+
+        buf.append("[");
+
+        int suggestedCount=0;
+
+        //writing the suggested list
+        for (Iterator suggestedItem = suggesteds.iterator() ; suggestedItem.hasNext() ; suggestedCount++)
+        {
+            if( suggestedCount > DEFAULT_MAX_SUGGESTED_ITEMS)
+                break;
+
+            Object item = suggestedItem.next();
+
+            buf.append("[\"").append(item.toString()).append("\",\"")
+                .append(item.toString().substring(0, 1).toUpperCase()).append("\"],");
+        }
+
+        buf.append("];");
+
+        context.getResponseWriter().write(buf.toString());
+    }
+
+    public void decode(FacesContext facesContext, UIComponent component)
+    {
+        super.decode(facesContext, component);
+    }
+
+}

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/inputsuggestajax/InputSuggestAjaxRenderer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/inputsuggestajax/InputSuggestAjaxTag.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/inputsuggestajax/InputSuggestAjaxTag.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/inputsuggestajax/InputSuggestAjaxTag.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/inputsuggestajax/InputSuggestAjaxTag.java Tue Aug  1 10:43:28 2006
@@ -1,95 +1,95 @@
-/*
- * Copyright 2005 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.custom.suggestajax.inputsuggestajax;
-
-
-import javax.faces.component.UIComponent;
-
-import org.apache.myfaces.custom.suggestajax.SuggestAjaxTag;
-
-
-/**
- * @author Gerald Muellan
- * @author Martin Marinschek
- * @version $Revision: $ $Date: $
- */
-
-public class InputSuggestAjaxTag extends SuggestAjaxTag
-{
-    private String _listId;
-    private String _listStyleClass;
-    private String _listStyle;
-
-    private String _listItemStyleClass;
-    private String _listItemStyle;
-
-    public String getComponentType() {
-        return InputSuggestAjax.COMPONENT_TYPE;
-    }
-
-    public String getRendererType() {
-        return InputSuggestAjax.DEFAULT_RENDERER_TYPE;
-    }
-
-    public void release() {
-
-        super.release();
-
-       _listId = null;
-       _listStyleClass = null;
-       _listStyle = null;
-       _listItemStyleClass = null;
-       _listItemStyle = null;
-    }
-
-    protected void setProperties(UIComponent component) {
-
-        super.setProperties(component);
-
-        setStringProperty(component,"listId",_listId);
-        setStringProperty(component,"listStyleClass",_listStyleClass);
-        setStringProperty(component,"listStyle",_listStyle);
-        setStringProperty(component,"listItemStyleClass",_listItemStyleClass);
-        setStringProperty(component,"listItemStyle",_listItemStyle);
-    }
-
-    // setter methodes to populate the components properites
-    public void setListId(String listId)
-    {
-        _listId = listId;
-    }
-
-    public void setListStyleClass(String listStyleClass)
-    {
-        _listStyleClass = listStyleClass;
-    }
-
-    public void setListStyle(String listStyle)
-    {
-        _listStyle = listStyle;
-    }
-
-    public void setListItemStyleClass(String listItemStyleClass)
-    {
-        _listItemStyleClass = listItemStyleClass;
-    }
-
-    public void setListItemStyle(String listItemStyle)
-    {
-        _listItemStyle = listItemStyle;
-    }
-
-}
+/*
+ * Copyright 2005 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.custom.suggestajax.inputsuggestajax;
+
+
+import javax.faces.component.UIComponent;
+
+import org.apache.myfaces.custom.suggestajax.SuggestAjaxTag;
+
+
+/**
+ * @author Gerald Muellan
+ * @author Martin Marinschek
+ * @version $Revision: $ $Date: $
+ */
+
+public class InputSuggestAjaxTag extends SuggestAjaxTag
+{
+    private String _listId;
+    private String _listStyleClass;
+    private String _listStyle;
+
+    private String _listItemStyleClass;
+    private String _listItemStyle;
+
+    public String getComponentType() {
+        return InputSuggestAjax.COMPONENT_TYPE;
+    }
+
+    public String getRendererType() {
+        return InputSuggestAjax.DEFAULT_RENDERER_TYPE;
+    }
+
+    public void release() {
+
+        super.release();
+
+       _listId = null;
+       _listStyleClass = null;
+       _listStyle = null;
+       _listItemStyleClass = null;
+       _listItemStyle = null;
+    }
+
+    protected void setProperties(UIComponent component) {
+
+        super.setProperties(component);
+
+        setStringProperty(component,"listId",_listId);
+        setStringProperty(component,"listStyleClass",_listStyleClass);
+        setStringProperty(component,"listStyle",_listStyle);
+        setStringProperty(component,"listItemStyleClass",_listItemStyleClass);
+        setStringProperty(component,"listItemStyle",_listItemStyle);
+    }
+
+    // setter methodes to populate the components properites
+    public void setListId(String listId)
+    {
+        _listId = listId;
+    }
+
+    public void setListStyleClass(String listStyleClass)
+    {
+        _listStyleClass = listStyleClass;
+    }
+
+    public void setListStyle(String listStyle)
+    {
+        _listStyle = listStyle;
+    }
+
+    public void setListItemStyleClass(String listItemStyleClass)
+    {
+        _listItemStyleClass = listItemStyleClass;
+    }
+
+    public void setListItemStyle(String listItemStyle)
+    {
+        _listItemStyle = listItemStyle;
+    }
+
+}

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/inputsuggestajax/InputSuggestAjaxTag.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/tablesuggestajax/HtmlOutputText.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/tablesuggestajax/HtmlOutputText.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/tablesuggestajax/HtmlOutputText.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/tablesuggestajax/HtmlOutputText.java Tue Aug  1 10:43:28 2006
@@ -1,171 +1,171 @@
-/*
- * Copyright 2004-2006 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.custom.suggestajax.tablesuggestajax;
-
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import javax.faces.el.ValueBinding;
-
-import org.apache.myfaces.custom.inputAjax.Listener;
-import org.apache.myfaces.custom.util.ComponentUtils;
-import org.apache.myfaces.shared_tomahawk.renderkit.html.HTML;
-
-/**
- * @author Gerald Muellan
- *         Date: 15.02.2006
- *         Time: 13:30:43
- */
-public class HtmlOutputText extends org.apache.myfaces.component.html.ext.HtmlOutputText
-{
-    public static final String COMPONENT_TYPE = "org.apache.myfaces.HtmlOutputTextFor";
-
-    private String _for;
-    private String _forValue;
-    private String _label;
-
-    public HtmlOutputText()
-    {
-    }
-
-    public void encodeBegin(FacesContext facesContext) throws IOException
-    {
-        super.encodeBegin(facesContext);
-    }
-
-    public void encodeEnd(FacesContext facesContext) throws IOException
-    {
-        ResponseWriter writer = facesContext.getResponseWriter();
-        writer.startElement(HTML.SPAN_ELEM, null);
-        writer.writeAttribute("id", this.getClientId(facesContext), null);
-        super.encodeEnd(facesContext);
-        writer.endElement(HTML.SPAN_ELEM);
-    }
-
-    public boolean getRendersChildren()
-    {
-        return true;
-    }
-
-    public void encodeChildren(FacesContext facesContext) throws IOException
-    {
-        checkForListeners(facesContext, this);
-        super.encodeChildren(facesContext);
-    }
-
-    private void checkForListeners(FacesContext context, UIComponent component)
-    {
-        // TODO: MOVE THIS UP THE TREE OR TO SOME OTHER LEVEL SO IT CAN WORK ON ANY COMPONENT
-        List children = component.getChildren();
-        if(children != null){
-            for (int i=0; i<children.size(); i++)
-            {
-                UIComponent child = (UIComponent) children.get(i);
-                if(child instanceof Listener){
-                    Listener listener = (Listener) child;
-                    Map rmap = context.getExternalContext().getRequestMap();
-                    List listeners = (List) rmap.get(Listener.LISTENER_MAP_ENTRY);
-                    if(listeners == null){
-                        listeners = new ArrayList();
-                        rmap.put(Listener.LISTENER_MAP_ENTRY, listeners);
-                    }
-                    // find component
-                    UIViewRoot root = context.getViewRoot();
-                    UIComponent ajaxComponent; //= component.findComponent(listener.getOn());
-                    //System.out.println("FINDING COMPONENT TO LISTEN ON: " + ajaxComponent);
-                    ajaxComponent = ComponentUtils.findComponentById(context, root, listener.getOn());
-                    if(ajaxComponent != null){
-                        //System.out.println("FINDING COMPONENT TO LISTEN ON: " + ajaxComponent);
-                        Map listenerItem = new HashMap();
-                        listenerItem.put("listenOn", ajaxComponent.getClientId(context));
-                        listenerItem.put("listenerId", component.getClientId(context));
-                        listenerItem.put("action", listener.getAction());
-                        listenerItem.put("eventType", listener.getEventType());
-                        listeners.add(listenerItem);
-                    }
-                }
-            }
-        }
-    }
-
-    public Object saveState(FacesContext context)
-    {
-        Object values[] = new Object[4];
-        values[0] = super.saveState(context);
-        values[1] = _for;
-        values[2] = _label;
-        values[3] = _forValue;
-
-        return ((Object) (values));
-    }
-
-    public void restoreState(FacesContext context, Object state)
-    {
-        Object values[] = (Object[]) state;
-        super.restoreState(context, values[0]);
-        _for = (String) values[1];
-        _label = (String) values[2];
-        _forValue = (String) values[3];
-    }
-
-    public String getFor()
-    {
-         if (_for != null)
-            return _for;
-        ValueBinding vb = getValueBinding("for");
-        return vb != null ? vb.getValue(getFacesContext()).toString() : null;
-    }
-
-    public void setFor(String aFor)
-    {
-        _for = aFor;
-    }
-
-
-    public String getForValue()
-    {
-         if (_forValue != null)
-            return _forValue;
-        ValueBinding vb = getValueBinding("forValue");
-        return vb != null ? vb.getValue(getFacesContext()).toString() : null;
-    }
-
-    public void setForValue(String forValue)
-    {
-        _forValue = forValue;
-    }
-
-    public String getLabel()
-    {
-        if (_label != null)
-            return _label;
-        ValueBinding vb = getValueBinding("label");
-        return vb != null ? vb.getValue(getFacesContext()).toString() : null;
-    }
-
-    public void setLabel(String label)
-    {
-        _label = label;
-    }
-}
+/*
+ * Copyright 2004-2006 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.custom.suggestajax.tablesuggestajax;
+
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.el.ValueBinding;
+
+import org.apache.myfaces.custom.inputAjax.Listener;
+import org.apache.myfaces.custom.util.ComponentUtils;
+import org.apache.myfaces.shared_tomahawk.renderkit.html.HTML;
+
+/**
+ * @author Gerald Muellan
+ *         Date: 15.02.2006
+ *         Time: 13:30:43
+ */
+public class HtmlOutputText extends org.apache.myfaces.component.html.ext.HtmlOutputText
+{
+    public static final String COMPONENT_TYPE = "org.apache.myfaces.HtmlOutputTextFor";
+
+    private String _for;
+    private String _forValue;
+    private String _label;
+
+    public HtmlOutputText()
+    {
+    }
+
+    public void encodeBegin(FacesContext facesContext) throws IOException
+    {
+        super.encodeBegin(facesContext);
+    }
+
+    public void encodeEnd(FacesContext facesContext) throws IOException
+    {
+        ResponseWriter writer = facesContext.getResponseWriter();
+        writer.startElement(HTML.SPAN_ELEM, null);
+        writer.writeAttribute("id", this.getClientId(facesContext), null);
+        super.encodeEnd(facesContext);
+        writer.endElement(HTML.SPAN_ELEM);
+    }
+
+    public boolean getRendersChildren()
+    {
+        return true;
+    }
+
+    public void encodeChildren(FacesContext facesContext) throws IOException
+    {
+        checkForListeners(facesContext, this);
+        super.encodeChildren(facesContext);
+    }
+
+    private void checkForListeners(FacesContext context, UIComponent component)
+    {
+        // TODO: MOVE THIS UP THE TREE OR TO SOME OTHER LEVEL SO IT CAN WORK ON ANY COMPONENT
+        List children = component.getChildren();
+        if(children != null){
+            for (int i=0; i<children.size(); i++)
+            {
+                UIComponent child = (UIComponent) children.get(i);
+                if(child instanceof Listener){
+                    Listener listener = (Listener) child;
+                    Map rmap = context.getExternalContext().getRequestMap();
+                    List listeners = (List) rmap.get(Listener.LISTENER_MAP_ENTRY);
+                    if(listeners == null){
+                        listeners = new ArrayList();
+                        rmap.put(Listener.LISTENER_MAP_ENTRY, listeners);
+                    }
+                    // find component
+                    UIViewRoot root = context.getViewRoot();
+                    UIComponent ajaxComponent; //= component.findComponent(listener.getOn());
+                    //System.out.println("FINDING COMPONENT TO LISTEN ON: " + ajaxComponent);
+                    ajaxComponent = ComponentUtils.findComponentById(context, root, listener.getOn());
+                    if(ajaxComponent != null){
+                        //System.out.println("FINDING COMPONENT TO LISTEN ON: " + ajaxComponent);
+                        Map listenerItem = new HashMap();
+                        listenerItem.put("listenOn", ajaxComponent.getClientId(context));
+                        listenerItem.put("listenerId", component.getClientId(context));
+                        listenerItem.put("action", listener.getAction());
+                        listenerItem.put("eventType", listener.getEventType());
+                        listeners.add(listenerItem);
+                    }
+                }
+            }
+        }
+    }
+
+    public Object saveState(FacesContext context)
+    {
+        Object values[] = new Object[4];
+        values[0] = super.saveState(context);
+        values[1] = _for;
+        values[2] = _label;
+        values[3] = _forValue;
+
+        return ((Object) (values));
+    }
+
+    public void restoreState(FacesContext context, Object state)
+    {
+        Object values[] = (Object[]) state;
+        super.restoreState(context, values[0]);
+        _for = (String) values[1];
+        _label = (String) values[2];
+        _forValue = (String) values[3];
+    }
+
+    public String getFor()
+    {
+         if (_for != null)
+            return _for;
+        ValueBinding vb = getValueBinding("for");
+        return vb != null ? vb.getValue(getFacesContext()).toString() : null;
+    }
+
+    public void setFor(String aFor)
+    {
+        _for = aFor;
+    }
+
+
+    public String getForValue()
+    {
+         if (_forValue != null)
+            return _forValue;
+        ValueBinding vb = getValueBinding("forValue");
+        return vb != null ? vb.getValue(getFacesContext()).toString() : null;
+    }
+
+    public void setForValue(String forValue)
+    {
+        _forValue = forValue;
+    }
+
+    public String getLabel()
+    {
+        if (_label != null)
+            return _label;
+        ValueBinding vb = getValueBinding("label");
+        return vb != null ? vb.getValue(getFacesContext()).toString() : null;
+    }
+
+    public void setLabel(String label)
+    {
+        _label = label;
+    }
+}

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/tablesuggestajax/HtmlOutputText.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/tablesuggestajax/HtmlOutputTextTag.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/tablesuggestajax/HtmlOutputTextTag.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/tablesuggestajax/HtmlOutputTextTag.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/tablesuggestajax/HtmlOutputTextTag.java Tue Aug  1 10:43:28 2006
@@ -1,70 +1,70 @@
-/*
- * Copyright 2004-2006 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.custom.suggestajax.tablesuggestajax;
-
-import javax.faces.component.UIComponent;
-
-import org.apache.myfaces.shared_tomahawk.renderkit.JSFAttr;
-
-/**
- * @author Gerald Muellan
- *         Date: 15.02.2006
- *         Time: 13:40:43
- */
-public class HtmlOutputTextTag extends org.apache.myfaces.taglib.html.ext.HtmlOutputTextTag
-{
-    private String _for;
-    private String _forValue;
-    private String _label;
-
-    public String getComponentType() {
-        return HtmlOutputText.COMPONENT_TYPE;
-    }
-
-    public void release() {
-
-        super.release();
-
-        _for = null;
-        _label = null;
-        _forValue = null;
-    }
-
-    protected void setProperties(UIComponent component) {
-
-        super.setProperties(component);
-
-        setStringProperty(component, JSFAttr.FOR_ATTR, _for);
-        setStringProperty(component, "label", _label);
-        setStringProperty(component, "forValue", _forValue);
-    }
-
-    public void setFor(String aFor)
-    {
-        _for = aFor;
-    }
-
-    public void setLabel(String label)
-    {
-        _label = label;
-    }
-
-
-    public void setForValue(String forValue)
-    {
-        _forValue = forValue;
-    }
-}
+/*
+ * Copyright 2004-2006 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.custom.suggestajax.tablesuggestajax;
+
+import javax.faces.component.UIComponent;
+
+import org.apache.myfaces.shared_tomahawk.renderkit.JSFAttr;
+
+/**
+ * @author Gerald Muellan
+ *         Date: 15.02.2006
+ *         Time: 13:40:43
+ */
+public class HtmlOutputTextTag extends org.apache.myfaces.taglib.html.ext.HtmlOutputTextTag
+{
+    private String _for;
+    private String _forValue;
+    private String _label;
+
+    public String getComponentType() {
+        return HtmlOutputText.COMPONENT_TYPE;
+    }
+
+    public void release() {
+
+        super.release();
+
+        _for = null;
+        _label = null;
+        _forValue = null;
+    }
+
+    protected void setProperties(UIComponent component) {
+
+        super.setProperties(component);
+
+        setStringProperty(component, JSFAttr.FOR_ATTR, _for);
+        setStringProperty(component, "label", _label);
+        setStringProperty(component, "forValue", _forValue);
+    }
+
+    public void setFor(String aFor)
+    {
+        _for = aFor;
+    }
+
+    public void setLabel(String label)
+    {
+        _label = label;
+    }
+
+
+    public void setForValue(String forValue)
+    {
+        _forValue = forValue;
+    }
+}

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/tablesuggestajax/HtmlOutputTextTag.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/tablesuggestajax/TableSuggestAjax.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/tablesuggestajax/TableSuggestAjaxRenderer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/suggestajax/tablesuggestajax/TableSuggestAjaxTag.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/template/XmlTemplate.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/template/XmlTemplate.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/template/XmlTemplate.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/template/XmlTemplate.java Tue Aug  1 10:43:28 2006
@@ -1,253 +1,253 @@
-/*
- * Copyright 2006 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.custom.template;
-
-import javax.faces.component.UIComponentBase;
-import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-import java.io.*;
-import java.net.URL;
-
-/**
- * Used to transform XML (from either a String or URL) using either XSLT or
- * Velocity.
- *
- * @author Sean Schofield
- */
-public class XmlTemplate extends UIComponentBase
-{
-    public static final String COMPONENT_TYPE = "org.apache.myfaces.tomahawk.XmlTemplate";
-    public static final String COMPONENT_FAMILY = "org.apache.myfaces.tomahawk.Template";
-
-    private String content;
-    private String contentLocation;
-    private Object contentStream;
-    private String stylesheet;
-    private String stylesheetLocation;
-    private Object styleStream;
-
-    // see superclass for documentation
-    public String getFamily()
-    {
-        return COMPONENT_FAMILY;
-    }
-
-    public void encodeBegin(FacesContext context)
-            throws IOException
-    {
-        InputStream xmlStream = (InputStream)getContentStream();
-        String xml = getContent();
-        String xmlLocation = getContentLocation();
-
-        InputStream xslStream = (InputStream)getStyleStream();
-        String xsl = getStylesheet();
-        String xslLocation = getStylesheetLocation();
-
-        if (context == null) throw new NullPointerException("context");
-        if (!isRendered()) return;
-
-        if (getContent() == null && getContentLocation() == null && getContentStream() == null)
-            throw new NullPointerException("content/contentLocation/contentStream cannot all be null");
-
-        //TODO - handle all cases
-        if (xmlLocation != null)
-        {
-            ClassLoader loader = Thread.currentThread().getContextClassLoader();
-            if (loader == null)
-            {
-                loader = XmlTemplate.class.getClassLoader();
-            }
-
-            URL url = loader.getResource(xmlLocation);
-            xmlStream = new FileInputStream(new File(url.getFile()));
-        }
-
-        if (xslLocation != null)
-        {
-            ClassLoader loader = Thread.currentThread().getContextClassLoader();
-            if (loader == null)
-            {
-                loader = XmlTemplate.class.getClassLoader();
-            }
-
-            URL url = loader.getResource(xslLocation);
-            xslStream = new FileInputStream(new File(url.getFile()));
-        }
-
-        if (xml != null)
-        {
-            xmlStream = new ByteArrayInputStream(xml.getBytes());
-        }
-
-        if (xsl != null)
-        {
-            xslStream = new ByteArrayInputStream(xsl.getBytes());
-        }
-
-        if (xmlStream != null && xslStream != null)
-        {
-            transformContent(xmlStream, xslStream);
-        }
-    }
-
-    /**
-     * Transforms an XML string using the stylesheet string provided.
-     *
-     * @param content The XML to transform
-     * @param stylesheet The stylesheet to use in the transformation
-     * @throws IOException
-     */
-    private void transformContent(InputStream content, InputStream stylesheet)
-        throws IOException
-    {
-        try
-        {
-            TransformerFactory tFactory = TransformerFactory.newInstance();
-            Transformer transformer = tFactory.newTransformer(new StreamSource(stylesheet));
-
-            Writer responseWriter = FacesContext.getCurrentInstance().getResponseWriter();
-            transformer.transform(new StreamSource(content), new StreamResult(responseWriter));
-        }
-        catch (TransformerException te)
-        {
-            throw new IOException("Error while transforming XML: " + te.getMessage());
-        }
-    }
-
-    // component does not need to manage its own children (its not allowed to have any)
-    public void encodeChildren(FacesContext context)
-            throws IOException
-    {}
-
-    // nothing special to do here
-    public void encodeEnd(FacesContext context)
-            throws IOException
-    {}
-
-    //  see superclass for documentation
-    public Object saveState(FacesContext context)
-    {
-        Object values[] = new Object[5];
-
-        values[0] = super.saveState(context);
-        values[1] = content;
-        values[2] = contentLocation;
-        values[3] = stylesheet;
-        values[4] = stylesheetLocation;
-
-        /**
-         * NOTE: If setContentStream is called directly (instead of through value binding) it will
-         * not be saved in the state since it does not make sense to serialize a stream.
-         */
-
-        return values;
-    }
-
-    // see superclass for documentation
-    public void restoreState(FacesContext context, Object state)
-    {
-        Object values[] = (Object[]) state;
-        super.restoreState(context, values[0]);
-
-        content = (String)values[1];
-        contentLocation = (String)values[2];
-        stylesheet = (String)values[3];
-        stylesheetLocation = (String)values[4];
-    }
-
-    public void setContent(String content)
-    {
-        this.content = content;
-    }
-
-    public String getContent()
-    {
-        if (content != null) return content;
-
-        ValueBinding vb = getValueBinding("content");
-        return (vb != null) ? (String)vb.getValue(getFacesContext()) : null;
-    }
-
-    public void setContentLocation(String contentLocation)
-    {
-        this.contentLocation = contentLocation;
-    }
-
-    public String getContentLocation()
-    {
-        if (contentLocation != null) return contentLocation;
-
-        ValueBinding vb = getValueBinding("contentLocation");
-        return (vb != null) ? (String)vb.getValue(getFacesContext()) : null;
-    }
-
-    public void setStylesheet(String stylesheet)
-    {
-        this.stylesheet = stylesheet;
-    }
-
-    public String getStylesheet()
-    {
-        if (stylesheet != null) return stylesheet;
-
-        ValueBinding vb = getValueBinding("stylesheet");
-        return (vb != null) ? (String)vb.getValue(getFacesContext()) : null;
-    }
-
-    public void setContentStream(Object contentStream)
-    {
-        this.contentStream = contentStream;
-    }
-
-    public Object getContentStream()
-    {
-        if (contentStream != null) return contentStream;
-
-        ValueBinding vb = getValueBinding("contentStream");
-        return (vb != null) ? vb.getValue(getFacesContext()) : null;
-    }
-
-    public void setStylesheetLocation(String stylesheetLocation)
-    {
-        this.stylesheetLocation = stylesheetLocation;
-    }
-
-    public String getStylesheetLocation()
-    {
-        if (stylesheetLocation != null) return stylesheetLocation;
-
-        ValueBinding vb = getValueBinding("stylesheetLocation");
-        return (vb != null) ? (String)vb.getValue(getFacesContext()) : null;
-    }
-
-    public void setStyleStream(Object styleStream)
-    {
-        this.styleStream = styleStream;
-    }
-
-    public Object getStyleStream()
-    {
-        if (styleStream != null) return styleStream;
-
-        ValueBinding vb = getValueBinding("styleStream");
-        return (vb != null) ? vb.getValue(getFacesContext()) : null;
-    }
-}
+/*
+ * Copyright 2006 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.custom.template;
+
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.transform.stream.StreamResult;
+import java.io.*;
+import java.net.URL;
+
+/**
+ * Used to transform XML (from either a String or URL) using either XSLT or
+ * Velocity.
+ *
+ * @author Sean Schofield
+ */
+public class XmlTemplate extends UIComponentBase
+{
+    public static final String COMPONENT_TYPE = "org.apache.myfaces.tomahawk.XmlTemplate";
+    public static final String COMPONENT_FAMILY = "org.apache.myfaces.tomahawk.Template";
+
+    private String content;
+    private String contentLocation;
+    private Object contentStream;
+    private String stylesheet;
+    private String stylesheetLocation;
+    private Object styleStream;
+
+    // see superclass for documentation
+    public String getFamily()
+    {
+        return COMPONENT_FAMILY;
+    }
+
+    public void encodeBegin(FacesContext context)
+            throws IOException
+    {
+        InputStream xmlStream = (InputStream)getContentStream();
+        String xml = getContent();
+        String xmlLocation = getContentLocation();
+
+        InputStream xslStream = (InputStream)getStyleStream();
+        String xsl = getStylesheet();
+        String xslLocation = getStylesheetLocation();
+
+        if (context == null) throw new NullPointerException("context");
+        if (!isRendered()) return;
+
+        if (getContent() == null && getContentLocation() == null && getContentStream() == null)
+            throw new NullPointerException("content/contentLocation/contentStream cannot all be null");
+
+        //TODO - handle all cases
+        if (xmlLocation != null)
+        {
+            ClassLoader loader = Thread.currentThread().getContextClassLoader();
+            if (loader == null)
+            {
+                loader = XmlTemplate.class.getClassLoader();
+            }
+
+            URL url = loader.getResource(xmlLocation);
+            xmlStream = new FileInputStream(new File(url.getFile()));
+        }
+
+        if (xslLocation != null)
+        {
+            ClassLoader loader = Thread.currentThread().getContextClassLoader();
+            if (loader == null)
+            {
+                loader = XmlTemplate.class.getClassLoader();
+            }
+
+            URL url = loader.getResource(xslLocation);
+            xslStream = new FileInputStream(new File(url.getFile()));
+        }
+
+        if (xml != null)
+        {
+            xmlStream = new ByteArrayInputStream(xml.getBytes());
+        }
+
+        if (xsl != null)
+        {
+            xslStream = new ByteArrayInputStream(xsl.getBytes());
+        }
+
+        if (xmlStream != null && xslStream != null)
+        {
+            transformContent(xmlStream, xslStream);
+        }
+    }
+
+    /**
+     * Transforms an XML string using the stylesheet string provided.
+     *
+     * @param content The XML to transform
+     * @param stylesheet The stylesheet to use in the transformation
+     * @throws IOException
+     */
+    private void transformContent(InputStream content, InputStream stylesheet)
+        throws IOException
+    {
+        try
+        {
+            TransformerFactory tFactory = TransformerFactory.newInstance();
+            Transformer transformer = tFactory.newTransformer(new StreamSource(stylesheet));
+
+            Writer responseWriter = FacesContext.getCurrentInstance().getResponseWriter();
+            transformer.transform(new StreamSource(content), new StreamResult(responseWriter));
+        }
+        catch (TransformerException te)
+        {
+            throw new IOException("Error while transforming XML: " + te.getMessage());
+        }
+    }
+
+    // component does not need to manage its own children (its not allowed to have any)
+    public void encodeChildren(FacesContext context)
+            throws IOException
+    {}
+
+    // nothing special to do here
+    public void encodeEnd(FacesContext context)
+            throws IOException
+    {}
+
+    //  see superclass for documentation
+    public Object saveState(FacesContext context)
+    {
+        Object values[] = new Object[5];
+
+        values[0] = super.saveState(context);
+        values[1] = content;
+        values[2] = contentLocation;
+        values[3] = stylesheet;
+        values[4] = stylesheetLocation;
+
+        /**
+         * NOTE: If setContentStream is called directly (instead of through value binding) it will
+         * not be saved in the state since it does not make sense to serialize a stream.
+         */
+
+        return values;
+    }
+
+    // see superclass for documentation
+    public void restoreState(FacesContext context, Object state)
+    {
+        Object values[] = (Object[]) state;
+        super.restoreState(context, values[0]);
+
+        content = (String)values[1];
+        contentLocation = (String)values[2];
+        stylesheet = (String)values[3];
+        stylesheetLocation = (String)values[4];
+    }
+
+    public void setContent(String content)
+    {
+        this.content = content;
+    }
+
+    public String getContent()
+    {
+        if (content != null) return content;
+
+        ValueBinding vb = getValueBinding("content");
+        return (vb != null) ? (String)vb.getValue(getFacesContext()) : null;
+    }
+
+    public void setContentLocation(String contentLocation)
+    {
+        this.contentLocation = contentLocation;
+    }
+
+    public String getContentLocation()
+    {
+        if (contentLocation != null) return contentLocation;
+
+        ValueBinding vb = getValueBinding("contentLocation");
+        return (vb != null) ? (String)vb.getValue(getFacesContext()) : null;
+    }
+
+    public void setStylesheet(String stylesheet)
+    {
+        this.stylesheet = stylesheet;
+    }
+
+    public String getStylesheet()
+    {
+        if (stylesheet != null) return stylesheet;
+
+        ValueBinding vb = getValueBinding("stylesheet");
+        return (vb != null) ? (String)vb.getValue(getFacesContext()) : null;
+    }
+
+    public void setContentStream(Object contentStream)
+    {
+        this.contentStream = contentStream;
+    }
+
+    public Object getContentStream()
+    {
+        if (contentStream != null) return contentStream;
+
+        ValueBinding vb = getValueBinding("contentStream");
+        return (vb != null) ? vb.getValue(getFacesContext()) : null;
+    }
+
+    public void setStylesheetLocation(String stylesheetLocation)
+    {
+        this.stylesheetLocation = stylesheetLocation;
+    }
+
+    public String getStylesheetLocation()
+    {
+        if (stylesheetLocation != null) return stylesheetLocation;
+
+        ValueBinding vb = getValueBinding("stylesheetLocation");
+        return (vb != null) ? (String)vb.getValue(getFacesContext()) : null;
+    }
+
+    public void setStyleStream(Object styleStream)
+    {
+        this.styleStream = styleStream;
+    }
+
+    public Object getStyleStream()
+    {
+        if (styleStream != null) return styleStream;
+
+        ValueBinding vb = getValueBinding("styleStream");
+        return (vb != null) ? vb.getValue(getFacesContext()) : null;
+    }
+}

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/template/XmlTemplate.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/template/XmlTemplateTag.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/template/XmlTemplateTag.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/template/XmlTemplateTag.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/template/XmlTemplateTag.java Tue Aug  1 10:43:28 2006
@@ -1,137 +1,137 @@
-/*
- * Copyright 2006 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.custom.template;
-
-import javax.faces.component.UIComponent;
-import javax.faces.webapp.UIComponentTag;
-import javax.faces.el.ValueBinding;
-
-/**
- * JspTag for XmlTemplate Component
- * @author Sean Schofield
- */
-public class XmlTemplateTag extends UIComponentTag
-{
-    private String content;
-    private String contentLocation;
-    private String contentStream;
-    private String stylesheet;
-    private String stylesheetLocation;
-    private String styleStream;
-
-    public String getComponentType()
-    {
-        return XmlTemplate.COMPONENT_TYPE;
-    }
-
-    public String getRendererType()
-    {
-        /**
-         * There is no renderer for this component.  Component just transforms XML and writes directly to the
-         * response stream.
-         */
-        return null;
-    }
-
-    public void setContent(String content)
-    {
-        this.content = content;
-    }
-
-    public void setContentLocation(String contentLocation)
-    {
-        this.contentLocation = contentLocation;
-    }
-
-    public void setContentStream(String contentStream)
-    {
-        this.contentStream = contentStream;
-    }
-
-    public void setStylesheet(String stylesheet)
-    {
-        this.stylesheet = stylesheet;
-    }
-
-    public void setStylesheetLocation(String stylesheetLocation)
-    {
-        this.stylesheetLocation = stylesheetLocation;
-    }
-
-    public void setStyleStream(String styleStream)
-    {
-        this.styleStream = styleStream;
-    }
-
-    protected void setProperties(UIComponent component)
-    {
-        super.setProperties(component);
-
-        XmlTemplate template = (XmlTemplate)component;
-
-        if (content != null && isValueReference(content))
-        {
-            ValueBinding vb = getFacesContext().getApplication().createValueBinding(content);
-            component.setValueBinding("content", vb);
-        }
-        else
-        {
-            template.setContent(content);
-        }
-
-        if (contentLocation != null && isValueReference(contentLocation))
-        {
-            ValueBinding vb = getFacesContext().getApplication().createValueBinding(contentLocation);
-            component.setValueBinding("contentLocation", vb);
-        }
-        else
-        {
-            template.setContentLocation(contentLocation);
-        }
-
-        if (contentStream != null && isValueReference(contentStream))
-        {
-            ValueBinding vb = getFacesContext().getApplication().createValueBinding(contentStream);
-            component.setValueBinding("contentStream", vb);
-        }
-
-        if (stylesheet != null && isValueReference(stylesheet))
-        {
-            ValueBinding vb = getFacesContext().getApplication().createValueBinding(stylesheet);
-            component.setValueBinding("stylesheet", vb);
-        }
-        else
-        {
-            template.setStylesheet(stylesheet);
-        }
-
-        if (stylesheetLocation != null && isValueReference(stylesheetLocation))
-        {
-            ValueBinding vb = getFacesContext().getApplication().createValueBinding(stylesheetLocation);
-            component.setValueBinding("stylesheetLocation", vb);
-        }
-        else
-        {
-            template.setStylesheetLocation(stylesheetLocation);
-        }
-
-        if (styleStream != null && isValueReference(styleStream))
-        {
-            ValueBinding vb = getFacesContext().getApplication().createValueBinding(styleStream);
-            component.setValueBinding("styleStream", vb);
-        }
-    }
-}
+/*
+ * Copyright 2006 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.custom.template;
+
+import javax.faces.component.UIComponent;
+import javax.faces.webapp.UIComponentTag;
+import javax.faces.el.ValueBinding;
+
+/**
+ * JspTag for XmlTemplate Component
+ * @author Sean Schofield
+ */
+public class XmlTemplateTag extends UIComponentTag
+{
+    private String content;
+    private String contentLocation;
+    private String contentStream;
+    private String stylesheet;
+    private String stylesheetLocation;
+    private String styleStream;
+
+    public String getComponentType()
+    {
+        return XmlTemplate.COMPONENT_TYPE;
+    }
+
+    public String getRendererType()
+    {
+        /**
+         * There is no renderer for this component.  Component just transforms XML and writes directly to the
+         * response stream.
+         */
+        return null;
+    }
+
+    public void setContent(String content)
+    {
+        this.content = content;
+    }
+
+    public void setContentLocation(String contentLocation)
+    {
+        this.contentLocation = contentLocation;
+    }
+
+    public void setContentStream(String contentStream)
+    {
+        this.contentStream = contentStream;
+    }
+
+    public void setStylesheet(String stylesheet)
+    {
+        this.stylesheet = stylesheet;
+    }
+
+    public void setStylesheetLocation(String stylesheetLocation)
+    {
+        this.stylesheetLocation = stylesheetLocation;
+    }
+
+    public void setStyleStream(String styleStream)
+    {
+        this.styleStream = styleStream;
+    }
+
+    protected void setProperties(UIComponent component)
+    {
+        super.setProperties(component);
+
+        XmlTemplate template = (XmlTemplate)component;
+
+        if (content != null && isValueReference(content))
+        {
+            ValueBinding vb = getFacesContext().getApplication().createValueBinding(content);
+            component.setValueBinding("content", vb);
+        }
+        else
+        {
+            template.setContent(content);
+        }
+
+        if (contentLocation != null && isValueReference(contentLocation))
+        {
+            ValueBinding vb = getFacesContext().getApplication().createValueBinding(contentLocation);
+            component.setValueBinding("contentLocation", vb);
+        }
+        else
+        {
+            template.setContentLocation(contentLocation);
+        }
+
+        if (contentStream != null && isValueReference(contentStream))
+        {
+            ValueBinding vb = getFacesContext().getApplication().createValueBinding(contentStream);
+            component.setValueBinding("contentStream", vb);
+        }
+
+        if (stylesheet != null && isValueReference(stylesheet))
+        {
+            ValueBinding vb = getFacesContext().getApplication().createValueBinding(stylesheet);
+            component.setValueBinding("stylesheet", vb);
+        }
+        else
+        {
+            template.setStylesheet(stylesheet);
+        }
+
+        if (stylesheetLocation != null && isValueReference(stylesheetLocation))
+        {
+            ValueBinding vb = getFacesContext().getApplication().createValueBinding(stylesheetLocation);
+            component.setValueBinding("stylesheetLocation", vb);
+        }
+        else
+        {
+            template.setStylesheetLocation(stylesheetLocation);
+        }
+
+        if (styleStream != null && isValueReference(styleStream))
+        {
+            ValueBinding vb = getFacesContext().getApplication().createValueBinding(styleStream);
+            component.setValueBinding("styleStream", vb);
+        }
+    }
+}

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/template/XmlTemplateTag.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/timednotifier/TimedNotifier.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/timednotifier/TimedNotifier.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/timednotifier/TimedNotifier.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/timednotifier/TimedNotifier.java Tue Aug  1 10:43:28 2006
@@ -1,209 +1,209 @@
-/**
- * Copyright 2006 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.custom.timednotifier;
-
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIOutput;
-import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
-
-
-/**
- * 
- * @author werpu
- * Shows a Timed notifier
- * 
- */
-public class TimedNotifier extends UIOutput {
-    public static final String  COMPONENT_TYPE        = "org.apache.myfaces.TimedNotifier";
-    public static final String  DEFAULT_RENDERER_TYPE = "org.apache.myfaces.TimedNotifierRenderer";
-    private static final String DEFAULT_MESSAGE       = "Ok";
-    private static final String CONTENT_FACET_NAME    = "content";
-    private static final String CONFIRM_FACET_NAME    = "confirm";
-
-
-    private String  confirmationMessage = DEFAULT_MESSAGE;
-    private Boolean disabled            = null;
-    private String  height              = null;
-    private Integer hideDelay           = null;
-    private String  okText              = null;
-    private Integer showDelay           = null;
-    private String  styleClass          = null;
-    private String  width               = null;
-
-
-    public TimedNotifier() {
-        super();
-        setRendererType(DEFAULT_RENDERER_TYPE);
-    }
-
-    public UIComponent getConfirm() {
-        return (UIComponent) getFacets().get(CONFIRM_FACET_NAME);
-    }
-
-    public String getConfirmationMessage() {
-
-        if (confirmationMessage != null)
-            return confirmationMessage;
-
-        ValueBinding vb = getValueBinding("confirmationMessage");
-
-        return (vb != null) ? (String) vb.getValue(getFacesContext()) : null;
-    }
-
-    public UIComponent getContent() {
-        return (UIComponent) getFacets().get(CONTENT_FACET_NAME);
-    }
-
-    public Boolean getDisabled() {
-
-        if (disabled != null)
-            return disabled;
-
-        ValueBinding vb = getValueBinding("disabled");
-
-        return (vb != null) ? (Boolean) vb.getValue(getFacesContext()) : null;
-    }
-
-    public String getHeight() {
-
-        if (height != null)
-            return height;
-
-        ValueBinding vb = getValueBinding("height");
-
-        return (vb != null) ? (String) vb.getValue(getFacesContext()) : "";
-
-    }
-
-    public Integer getHideDelay() {
-
-        if (hideDelay != null)
-            return hideDelay;
-
-        ValueBinding vb = getValueBinding("hideDelay");
-
-        return (vb != null) ? (Integer) vb.getValue(getFacesContext()) : new Integer(-1);
-    }
-
-    public String getOkText() {
-
-        if (okText != null)
-            return okText;
-
-        ValueBinding vb = getValueBinding("okText");
-
-        return (vb != null) ? (String) vb.getValue(getFacesContext()) : "Ok";
-    }
-
-    public Integer getShowDelay() {
-
-        if (showDelay != null)
-            return showDelay;
-
-        ValueBinding vb = getValueBinding("showDelay");
-
-        return (vb != null) ? (Integer) vb.getValue(getFacesContext()) : new Integer(0);
-    }
-
-    public String getStyleClass() {
-
-        if (styleClass != null)
-            return styleClass;
-
-        ValueBinding vb = getValueBinding("styleClass");
-
-        return (vb != null) ? (String) vb.getValue(getFacesContext()) : "dojoTimedNotifierDialog";
-    }
-
-    public String getWidth() {
-
-        if (width != null)
-            return width;
-
-        ValueBinding vb = getValueBinding("width");
-
-        return (vb != null) ? (String) vb.getValue(getFacesContext()) : "";
-
-    }
-
-    public void restoreState(FacesContext context, Object state) {
-        Object[] values = (Object[]) state;
-        super.restoreState(context, values[0]);
-        this.confirmationMessage = (String) values[1];
-        this.disabled            = (Boolean) values[2];
-        this.showDelay           = (Integer) values[3];
-        this.hideDelay           = (Integer) values[4];
-        this.styleClass          = (String) values[5];
-        this.width               = (String) values[6];
-        this.height              = (String) values[7];
-    }
-
-    public Object saveState(FacesContext context) {
-        Object[] values = new Object[8];
-        values[0] = super.saveState(context);
-        values[1] = confirmationMessage;
-        values[2] = disabled;
-        values[3] = showDelay;
-        values[4] = hideDelay;
-        values[5] = styleClass;
-        values[6] = width;
-        values[7] = height;
-
-        return values;
-    }
-
-    public void setConfirm(UIComponent confirm) {
-        getFacets().put(CONFIRM_FACET_NAME, confirm);
-    }
-
-    public void setConfirmationMessage(String confirmationMessage) {
-        this.confirmationMessage = confirmationMessage;
-    }
-
-
-    public void setContent(UIComponent content) {
-        getFacets().put(CONTENT_FACET_NAME, content);
-    }
-
-    public void setDisabled(Boolean disabled) {
-        this.disabled = disabled;
-    }
-
-    public void setHeight(String height) {
-        this.height = height;
-    }
-
-    public void setHideDelay(Integer hideDelay) {
-        this.hideDelay = hideDelay;
-    }
-
-    public void setOkText(String okText) {
-        this.okText = okText;
-    }
-
-    public void setShowDelay(Integer showDelay) {
-        this.showDelay = showDelay;
-    }
-
-    public void setStyleClass(String styleClass) {
-        this.styleClass = styleClass;
-    }
-
-    public void setWidth(String width) {
-        this.width = width;
-    }
-}
+/**
+ * Copyright 2006 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.custom.timednotifier;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIOutput;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+
+
+/**
+ * 
+ * @author werpu
+ * Shows a Timed notifier
+ * 
+ */
+public class TimedNotifier extends UIOutput {
+    public static final String  COMPONENT_TYPE        = "org.apache.myfaces.TimedNotifier";
+    public static final String  DEFAULT_RENDERER_TYPE = "org.apache.myfaces.TimedNotifierRenderer";
+    private static final String DEFAULT_MESSAGE       = "Ok";
+    private static final String CONTENT_FACET_NAME    = "content";
+    private static final String CONFIRM_FACET_NAME    = "confirm";
+
+
+    private String  confirmationMessage = DEFAULT_MESSAGE;
+    private Boolean disabled            = null;
+    private String  height              = null;
+    private Integer hideDelay           = null;
+    private String  okText              = null;
+    private Integer showDelay           = null;
+    private String  styleClass          = null;
+    private String  width               = null;
+
+
+    public TimedNotifier() {
+        super();
+        setRendererType(DEFAULT_RENDERER_TYPE);
+    }
+
+    public UIComponent getConfirm() {
+        return (UIComponent) getFacets().get(CONFIRM_FACET_NAME);
+    }
+
+    public String getConfirmationMessage() {
+
+        if (confirmationMessage != null)
+            return confirmationMessage;
+
+        ValueBinding vb = getValueBinding("confirmationMessage");
+
+        return (vb != null) ? (String) vb.getValue(getFacesContext()) : null;
+    }
+
+    public UIComponent getContent() {
+        return (UIComponent) getFacets().get(CONTENT_FACET_NAME);
+    }
+
+    public Boolean getDisabled() {
+
+        if (disabled != null)
+            return disabled;
+
+        ValueBinding vb = getValueBinding("disabled");
+
+        return (vb != null) ? (Boolean) vb.getValue(getFacesContext()) : null;
+    }
+
+    public String getHeight() {
+
+        if (height != null)
+            return height;
+
+        ValueBinding vb = getValueBinding("height");
+
+        return (vb != null) ? (String) vb.getValue(getFacesContext()) : "";
+
+    }
+
+    public Integer getHideDelay() {
+
+        if (hideDelay != null)
+            return hideDelay;
+
+        ValueBinding vb = getValueBinding("hideDelay");
+
+        return (vb != null) ? (Integer) vb.getValue(getFacesContext()) : new Integer(-1);
+    }
+
+    public String getOkText() {
+
+        if (okText != null)
+            return okText;
+
+        ValueBinding vb = getValueBinding("okText");
+
+        return (vb != null) ? (String) vb.getValue(getFacesContext()) : "Ok";
+    }
+
+    public Integer getShowDelay() {
+
+        if (showDelay != null)
+            return showDelay;
+
+        ValueBinding vb = getValueBinding("showDelay");
+
+        return (vb != null) ? (Integer) vb.getValue(getFacesContext()) : new Integer(0);
+    }
+
+    public String getStyleClass() {
+
+        if (styleClass != null)
+            return styleClass;
+
+        ValueBinding vb = getValueBinding("styleClass");
+
+        return (vb != null) ? (String) vb.getValue(getFacesContext()) : "dojoTimedNotifierDialog";
+    }
+
+    public String getWidth() {
+
+        if (width != null)
+            return width;
+
+        ValueBinding vb = getValueBinding("width");
+
+        return (vb != null) ? (String) vb.getValue(getFacesContext()) : "";
+
+    }
+
+    public void restoreState(FacesContext context, Object state) {
+        Object[] values = (Object[]) state;
+        super.restoreState(context, values[0]);
+        this.confirmationMessage = (String) values[1];
+        this.disabled            = (Boolean) values[2];
+        this.showDelay           = (Integer) values[3];
+        this.hideDelay           = (Integer) values[4];
+        this.styleClass          = (String) values[5];
+        this.width               = (String) values[6];
+        this.height              = (String) values[7];
+    }
+
+    public Object saveState(FacesContext context) {
+        Object[] values = new Object[8];
+        values[0] = super.saveState(context);
+        values[1] = confirmationMessage;
+        values[2] = disabled;
+        values[3] = showDelay;
+        values[4] = hideDelay;
+        values[5] = styleClass;
+        values[6] = width;
+        values[7] = height;
+
+        return values;
+    }
+
+    public void setConfirm(UIComponent confirm) {
+        getFacets().put(CONFIRM_FACET_NAME, confirm);
+    }
+
+    public void setConfirmationMessage(String confirmationMessage) {
+        this.confirmationMessage = confirmationMessage;
+    }
+
+
+    public void setContent(UIComponent content) {
+        getFacets().put(CONTENT_FACET_NAME, content);
+    }
+
+    public void setDisabled(Boolean disabled) {
+        this.disabled = disabled;
+    }
+
+    public void setHeight(String height) {
+        this.height = height;
+    }
+
+    public void setHideDelay(Integer hideDelay) {
+        this.hideDelay = hideDelay;
+    }
+
+    public void setOkText(String okText) {
+        this.okText = okText;
+    }
+
+    public void setShowDelay(Integer showDelay) {
+        this.showDelay = showDelay;
+    }
+
+    public void setStyleClass(String styleClass) {
+        this.styleClass = styleClass;
+    }
+
+    public void setWidth(String width) {
+        this.width = width;
+    }
+}

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/timednotifier/TimedNotifier.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message