You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mm...@apache.org on 2005/07/16 10:03:59 UTC

svn commit: r219292 - in /myfaces: examples/trunk/sandbox/ sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/ sandbox/trunk/tld/

Author: mmarinschek
Date: Sat Jul 16 01:03:58 2005
New Revision: 219292

URL: http://svn.apache.org/viewcvs?rev=219292&view=rev
Log:
finished moving the ajax components

Modified:
    myfaces/examples/trunk/sandbox/ajaxInputSuggest.jsp
    myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/AjaxComponent.java
    myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/AjaxPhaseListener.java
    myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/AjaxRenderer.java
    myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/InputSuggestAjax.java
    myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/InputSuggestAjaxRenderer.java
    myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/InputSuggestAjaxTag.java
    myfaces/sandbox/trunk/tld/myfaces_sandbox.tld

Modified: myfaces/examples/trunk/sandbox/ajaxInputSuggest.jsp
URL: http://svn.apache.org/viewcvs/myfaces/examples/trunk/sandbox/ajaxInputSuggest.jsp?rev=219292&r1=219291&r2=219292&view=diff
==============================================================================
--- myfaces/examples/trunk/sandbox/ajaxInputSuggest.jsp (original)
+++ myfaces/examples/trunk/sandbox/ajaxInputSuggest.jsp Sat Jul 16 01:03:58 2005
@@ -35,7 +35,7 @@
             .ajaxListItem {}
             .ajaxList {}
        </style>
-       <s:ajaxSuggest suggestedItemsMethod="#{ajaxInputSuggest.getItems}" styleLocation="" />
+       <s:inputSuggestAjax suggestedItemsMethod="#{ajaxInputSuggest.getItems}" styleLocation="" />
 
        <x:inputCalendar renderAsPopup="true" />
 

Modified: myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/AjaxComponent.java
URL: http://svn.apache.org/viewcvs/myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/AjaxComponent.java?rev=219292&r1=219291&r2=219292&view=diff
==============================================================================
--- myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/AjaxComponent.java (original)
+++ myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/AjaxComponent.java Sat Jul 16 01:03:58 2005
@@ -1,4 +1,4 @@
-package org.apache.myfaces.custom.ajaxsuggest;
+package org.apache.myfaces.custom.inputsuggestajax;
 
 import javax.faces.context.FacesContext;
 import java.io.IOException;

Modified: myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/AjaxPhaseListener.java
URL: http://svn.apache.org/viewcvs/myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/AjaxPhaseListener.java?rev=219292&r1=219291&r2=219292&view=diff
==============================================================================
--- myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/AjaxPhaseListener.java (original)
+++ myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/AjaxPhaseListener.java Sat Jul 16 01:03:58 2005
@@ -1,20 +1,19 @@
 /**
  * Copyright 2004 by Irian Marinschek & Spiegl Software OEG
  */
-package org.apache.myfaces.custom.ajaxsuggest;
+package org.apache.myfaces.custom.inputsuggestajax;
 
-import org.apache.myfaces.renderkit.RendererUtils;
-import org.apache.myfaces.custom.buffer.HtmlBufferResponseWriterWrapper;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.custom.buffer.HtmlBufferResponseWriterWrapper;
+import org.apache.myfaces.renderkit.RendererUtils;
 
-import javax.faces.event.PhaseListener;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
 import javax.faces.event.PhaseEvent;
 import javax.faces.event.PhaseId;
-import javax.faces.context.FacesContext;
-
-import javax.faces.component.UIViewRoot;
-import javax.faces.component.UIComponent;
+import javax.faces.event.PhaseListener;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.PrintWriter;
@@ -86,7 +85,7 @@
      * We need to hang our AJAX phase listener in the invoke application phase as it is
      * impossible to stop rendering in the render response phase.
      *
-     * @return
+     * @return PhaseId The AJAX phase listener will be invoked after the invoke application phase.
      */
     public PhaseId getPhaseId()
     {

Modified: myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/AjaxRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/AjaxRenderer.java?rev=219292&r1=219291&r2=219292&view=diff
==============================================================================
--- myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/AjaxRenderer.java (original)
+++ myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/AjaxRenderer.java Sat Jul 16 01:03:58 2005
@@ -1,4 +1,4 @@
-package org.apache.myfaces.custom.ajaxsuggest;
+package org.apache.myfaces.custom.inputsuggestajax;
 
 import javax.faces.context.FacesContext;
 import javax.faces.component.UIComponent;

Modified: myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/InputSuggestAjax.java
URL: http://svn.apache.org/viewcvs/myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/InputSuggestAjax.java?rev=219292&r1=219291&r2=219292&view=diff
==============================================================================
--- myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/InputSuggestAjax.java (original)
+++ myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/InputSuggestAjax.java Sat Jul 16 01:03:58 2005
@@ -13,13 +13,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.myfaces.custom.ajaxsuggest;
+package org.apache.myfaces.custom.inputsuggestajax;
 
 import org.apache.myfaces.component.html.ext.HtmlInputText;
 
-import javax.faces.el.MethodBinding;
-import javax.faces.el.ValueBinding;
 import javax.faces.context.FacesContext;
+import javax.faces.el.MethodBinding;
 import javax.faces.render.Renderer;
 import java.io.IOException;
 
@@ -30,7 +29,7 @@
  * @version $Revision: 169662 $ $Date: 2005-05-11 19:57:24 +0200 (Wed, 11 May 2005) $
  */
 
-public class AjaxInputSuggest extends HtmlInputText implements AjaxComponent
+public class InputSuggestAjax extends HtmlInputText implements AjaxComponent
 {
     private MethodBinding _suggestedItemsMethod;
 

Modified: myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/InputSuggestAjaxRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/InputSuggestAjaxRenderer.java?rev=219292&r1=219291&r2=219292&view=diff
==============================================================================
--- myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/InputSuggestAjaxRenderer.java (original)
+++ myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/InputSuggestAjaxRenderer.java Sat Jul 16 01:03:58 2005
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.apache.myfaces.custom.ajaxsuggest;
+package org.apache.myfaces.custom.inputsuggestajax;
 
 
 
@@ -37,7 +37,7 @@
  * @author Martin Marinschek
  * @version $Revision: 177984 $ $Date: 2005-05-23 19:39:37 +0200 (Mon, 23 May 2005) $
  */
-public class AjaxInputSuggestRenderer extends HtmlTextRenderer implements AjaxRenderer
+public class InputSuggestAjaxRenderer extends HtmlTextRenderer implements AjaxRenderer
 {
     //private static Log log = LogFactory.getLog(AjaxInputSuggestRenderer.class);
 
@@ -65,14 +65,14 @@
         String javascriptLocation = (String)component.getAttributes().get(JSFAttr.JAVASCRIPT_LOCATION);
         if (javascriptLocation == null)
         {
-            AddResource.addJavaScriptHere(AjaxInputSuggestRenderer.class, "prototype.js", context);
-            AddResource.addJavaScriptHere(AjaxInputSuggestRenderer.class, "effects.js", context);
-            AddResource.addJavaScriptHere(AjaxInputSuggestRenderer.class, "dragdrop.js", context);
-            AddResource.addJavaScriptHere(AjaxInputSuggestRenderer.class, "controls.js", context);
+            AddResource.addJavaScriptHere(InputSuggestAjaxRenderer.class, "prototype.js", context);
+            AddResource.addJavaScriptHere(InputSuggestAjaxRenderer.class, "effects.js", context);
+            AddResource.addJavaScriptHere(InputSuggestAjaxRenderer.class, "dragdrop.js", context);
+            AddResource.addJavaScriptHere(InputSuggestAjaxRenderer.class, "controls.js", context);
 
-            if ( ((AjaxInputSuggest)component).getLayout().equals("default"))
+            if ( ((InputSuggestAjax)component).getLayout().equals("default"))
             {
-                AddResource.addStyleSheet(AjaxInputSuggestRenderer.class,"defaultTheme.css",context);
+                AddResource.addStyleSheet(InputSuggestAjaxRenderer.class,"defaultTheme.css",context);
             }
         }
         else
@@ -108,9 +108,9 @@
 
     public void encodeEnd(FacesContext context, UIComponent component) throws IOException
     {
-        RendererUtils.checkParamValidity(context, component, AjaxInputSuggest.class);
+        RendererUtils.checkParamValidity(context, component, InputSuggestAjax.class);
 
-        AjaxInputSuggest ajaxInputSuggest = (AjaxInputSuggest) component;
+        InputSuggestAjax InputSuggestAjax = (InputSuggestAjax) component;
 
         this.encodeJavascript(context,component);
 
@@ -120,26 +120,26 @@
         ResponseWriter out = context.getResponseWriter();
 
         out.startElement(HTML.DIV_ELEM, null);
-        if(ajaxInputSuggest.getLayout().equals("default"))
+        if(InputSuggestAjax.getLayout().equals("default"))
         {
             out.writeAttribute(HTML.CLASS_ATTR, "ajaxPopup", null);
         }
-        if(ajaxInputSuggest.getPopupStyleClass()!= null)
+        if(InputSuggestAjax.getPopupStyleClass()!= null)
         {
-            out.writeAttribute(HTML.CLASS_ATTR, ajaxInputSuggest.getPopupStyleClass(), null);
+            out.writeAttribute(HTML.CLASS_ATTR, InputSuggestAjax.getPopupStyleClass(), null);
         }
-        if (ajaxInputSuggest.getPopupId() != null)
+        if (InputSuggestAjax.getPopupId() != null)
         {
-            out.writeAttribute(HTML.ID_ATTR,ajaxInputSuggest.getPopupId(), null);
+            out.writeAttribute(HTML.ID_ATTR,InputSuggestAjax.getPopupId(), null);
         }
         else
         {
             out.writeAttribute(HTML.ID_ATTR,
                     component.getClientId(context)+"_auto_complete", null);
         }
-        if (ajaxInputSuggest.getPopupStyle() != null)
+        if (InputSuggestAjax.getPopupStyle() != null)
         {
-            out.writeAttribute(HTML.STYLE_ATTR, ajaxInputSuggest.getPopupStyle(),null);
+            out.writeAttribute(HTML.STYLE_ATTR, InputSuggestAjax.getPopupStyle(),null);
         }
         out.endElement(HTML.DIV_ELEM);
 
@@ -152,9 +152,9 @@
         out.writeText("new Ajax.Autocompleter('",null);
         out.writeText(component.getClientId(context),null);
         out.writeText("','",null);
-        if (ajaxInputSuggest.getPopupId() != null)
+        if (InputSuggestAjax.getPopupId() != null)
         {
-            out.writeText(ajaxInputSuggest.getPopupId(), null);
+            out.writeText(InputSuggestAjax.getPopupId(), null);
         }
         else
         {
@@ -178,41 +178,41 @@
 
     public void encodeAjax(FacesContext context, UIComponent uiComponent) throws IOException
     {
-        RendererUtils.checkParamValidity(context, uiComponent, AjaxInputSuggest.class);
+        RendererUtils.checkParamValidity(context, uiComponent, InputSuggestAjax.class);
 
-        AjaxInputSuggest ajaxInputSuggest = (AjaxInputSuggest) uiComponent;
+        InputSuggestAjax InputSuggestAjax = (InputSuggestAjax) uiComponent;
 
-        MethodBinding mb = ajaxInputSuggest.getSuggestedItemsMethod();
+        MethodBinding mb = InputSuggestAjax.getSuggestedItemsMethod();
 
         List li = (List) mb.invoke(context,new Object[]{context.getExternalContext().getRequestParameterMap().get(
                 uiComponent.getClientId(context))});
 
         StringBuffer buf = new StringBuffer();
         buf.append("<ul");
-        if (ajaxInputSuggest.getListStyleClass() != null)
+        if (InputSuggestAjax.getListStyleClass() != null)
         {
-            buf.append(" class='"+ajaxInputSuggest.getListStyleClass()+"'");
+            buf.append(" class='"+InputSuggestAjax.getListStyleClass()+"'");
         }
-        if (ajaxInputSuggest.getListStyle() != null)
+        if (InputSuggestAjax.getListStyle() != null)
         {
-            buf.append(" style='"+ajaxInputSuggest.getListStyle()+"'");
+            buf.append(" style='"+InputSuggestAjax.getListStyle()+"'");
         }
-        if (ajaxInputSuggest.getListId() != null)
+        if (InputSuggestAjax.getListId() != null)
         {
-            buf.append(" id='"+ajaxInputSuggest.getListId()+"'");
+            buf.append(" id='"+InputSuggestAjax.getListId()+"'");
         }
         buf.append(">");
 
         for (int i = 0; i < li.size(); i++)
         {
             buf.append("<li");
-            if (ajaxInputSuggest.getListItemStyleClass() != null)
+            if (InputSuggestAjax.getListItemStyleClass() != null)
             {
-                buf.append(" class='"+ajaxInputSuggest.getListItemStyleClass()+"'");
+                buf.append(" class='"+InputSuggestAjax.getListItemStyleClass()+"'");
             }
-            if (ajaxInputSuggest.getListItemStyle() != null)
+            if (InputSuggestAjax.getListItemStyle() != null)
             {
-                buf.append(" style='"+ajaxInputSuggest.getListItemStyle()+"'");
+                buf.append(" style='"+InputSuggestAjax.getListItemStyle()+"'");
             }
             buf.append(">");
             buf.append((String) li.get(i));

Modified: myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/InputSuggestAjaxTag.java
URL: http://svn.apache.org/viewcvs/myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/InputSuggestAjaxTag.java?rev=219292&r1=219291&r2=219292&view=diff
==============================================================================
--- myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/InputSuggestAjaxTag.java (original)
+++ myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/inputsuggestajax/InputSuggestAjaxTag.java Sat Jul 16 01:03:58 2005
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.myfaces.custom.ajaxsuggest;
+package org.apache.myfaces.custom.inputsuggestajax;
 
 
 import org.apache.commons.logging.Log;
@@ -30,9 +30,9 @@
  * @version $Revision: $ $Date: $
  */
 
-public class AjaxInputSuggestTag extends HtmlInputTagBase
+public class InputSuggestAjaxTag extends HtmlInputTagBase
 {
-    private static Log log = LogFactory.getLog(AjaxInputSuggestTag.class);
+    private static Log log = LogFactory.getLog(InputSuggestAjaxTag.class);
 
     private String _suggestedItemsMethod;
 
@@ -96,14 +96,14 @@
     {
         if (suggestedItemsMethod != null)
         {
-            if (!(component instanceof AjaxInputSuggest))
+            if (!(component instanceof InputSuggestAjax))
             {
                 throw new IllegalArgumentException("Component " + component.getClientId(context) + " is no AjaxInputSuggest");
             }
             if (isValueReference(suggestedItemsMethod))
             {
                 MethodBinding mb = context.getApplication().createMethodBinding(suggestedItemsMethod,new Class[]{String.class});
-                ((AjaxInputSuggest)component).setSuggestedItemsMethod(mb);
+                ((InputSuggestAjax)component).setSuggestedItemsMethod(mb);
             }
             else
             {

Modified: myfaces/sandbox/trunk/tld/myfaces_sandbox.tld
URL: http://svn.apache.org/viewcvs/myfaces/sandbox/trunk/tld/myfaces_sandbox.tld?rev=219292&r1=219291&r2=219292&view=diff
==============================================================================
--- myfaces/sandbox/trunk/tld/myfaces_sandbox.tld (original)
+++ myfaces/sandbox/trunk/tld/myfaces_sandbox.tld Sat Jul 16 01:03:58 2005
@@ -98,7 +98,7 @@
 
     <tlib-version>1.0.10</tlib-version>
     <jsp-version>1.2</jsp-version>
-    <short-name>x</short-name>
+    <short-name>s</short-name>
     <uri>http://myfaces.apache.org/sandbox</uri>
     <description>
         Enhanced standard JSP actions and custom MyFaces actions.
@@ -149,7 +149,7 @@
        &html_schedule_attributes;
     </tag>
 
-    <!-- AjaxinputSuggest -->
+    <!-- inputSuggestAjax -->
     <tag>
         <name>inputSuggestAjax</name>
         <tag-class>org.apache.myfaces.custom.inputsuggestajax.inputSuggestAjaxTag</tag-class>