Author: almaw
Date: Tue Jun  5 09:59:27 2007
New Revision: 544553

URL: http://svn.apache.org/viewvc?view=rev&rev=544553
Log:
Improve checks and javadoc.

Modified:
    
incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/UploadProgressBar.java
    
incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/UploadStatusResource.java

Modified: 
incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/UploadProgressBar.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/UploadProgressBar.java?view=diff&rev=544553&r1=544552&r2=544553
==============================================================================
--- 
incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/UploadProgressBar.java
 (original)
+++ 
incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/UploadProgressBar.java
 Tue Jun  5 09:59:27 2007
@@ -19,12 +19,15 @@
 import org.apache.wicket.Application;
 import org.apache.wicket.AttributeModifier;
 import org.apache.wicket.IInitializer;
+import org.apache.wicket.RequestCycle;
 import org.apache.wicket.ResourceReference;
 import org.apache.wicket.behavior.HeaderContributor;
 import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.form.Form;
 import org.apache.wicket.markup.html.panel.Panel;
 import org.apache.wicket.model.Model;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A panel to show the progress of an HTTP upload.
@@ -36,6 +39,7 @@
  */
 public class UploadProgressBar extends Panel
 {
+       private static final Logger log = 
LoggerFactory.getLogger(UploadProgressBar.class);
 
        /**
         * Initializer for this component; binds static resources.
@@ -88,6 +92,11 @@
                statusDiv.setOutputMarkupId(true);
                add(statusDiv);
 
+               if (!(RequestCycle.get().getRequest() instanceof 
UploadWebRequest))
+               {
+                       log.warn("UploadProgressBar will not work without an 
UploadWebRequest. See the javadoc for details.");
+               }
+               
                form.add(new AttributeModifier("onsubmit", true, new Model()
                {
 

Modified: 
incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/UploadStatusResource.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/UploadStatusResource.java?view=diff&rev=544553&r1=544552&r2=544553
==============================================================================
--- 
incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/UploadStatusResource.java
 (original)
+++ 
incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/UploadStatusResource.java
 Tue Jun  5 09:59:27 2007
@@ -34,9 +34,6 @@
 class UploadStatusResource extends DynamicWebResource
 {
 
-       /**
-        * 
-        */
        private static final long serialVersionUID = 1L;
 
        protected ResourceState getResourceState()
@@ -53,9 +50,7 @@
                 */
                private String status;
 
-               /**
-                * 
-                */
+               /** Create a new one of these from the current request */
                public UploadResourceState()
                {
 


Reply via email to