You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by an...@apache.org on 2006/11/15 20:13:36 UTC

svn commit: r475366 - in /tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry: form/FormSupportFactory.java form/FormSupportFactoryImpl.java wml/GoFormSupportFactory.java

Author: andyhot
Date: Wed Nov 15 11:13:35 2006
New Revision: 475366

URL: http://svn.apache.org/viewvc?view=rev&rev=475366
Log:
Interface and implementations for factories of FormSupport instances

Added:
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/FormSupportFactory.java
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/FormSupportFactoryImpl.java
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/wml/GoFormSupportFactory.java

Added: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/FormSupportFactory.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/FormSupportFactory.java?view=auto&rev=475366
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/FormSupportFactory.java (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/FormSupportFactory.java Wed Nov 15 11:13:35 2006
@@ -0,0 +1,36 @@
+// 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.tapestry.form;
+
+import org.apache.tapestry.IForm;
+import org.apache.tapestry.IMarkupWriter;
+import org.apache.tapestry.IRequestCycle;
+
+/**
+ * Interface for factories that can generate {@link FormSupport} 
+ * objects.
+ *
+ * @since 4.1.1
+ */
+public interface FormSupportFactory 
+{
+    
+    /**
+     * Invoked every time an {@link IForm} is rendering in order to obtain a 
+     * {@link FormSupport} instance to support and manage the process.
+     * <p/>
+     */ 
+    FormSupport createFormSupport(IMarkupWriter writer, IRequestCycle cycle, IForm form);
+}

Added: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/FormSupportFactoryImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/FormSupportFactoryImpl.java?view=auto&rev=475366
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/FormSupportFactoryImpl.java (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/FormSupportFactoryImpl.java Wed Nov 15 11:13:35 2006
@@ -0,0 +1,33 @@
+// 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.tapestry.form;
+
+import org.apache.tapestry.IForm;
+import org.apache.tapestry.IMarkupWriter;
+import org.apache.tapestry.IRequestCycle;
+
+/**
+ * The standard implementation of {@link FormSupportFactory}. It generates 
+ * {@link FormSupportImpl} instances.
+ *
+ * @since 4.1.1
+ */
+public class FormSupportFactoryImpl implements FormSupportFactory
+{
+    public FormSupport createFormSupport(IMarkupWriter writer, IRequestCycle cycle, IForm form) 
+    {
+        return new FormSupportImpl(writer, cycle, form);
+    }    
+}

Added: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/wml/GoFormSupportFactory.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/wml/GoFormSupportFactory.java?view=auto&rev=475366
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/wml/GoFormSupportFactory.java (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/wml/GoFormSupportFactory.java Wed Nov 15 11:13:35 2006
@@ -0,0 +1,35 @@
+// 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.tapestry.wml;
+
+import org.apache.tapestry.IForm;
+import org.apache.tapestry.IMarkupWriter;
+import org.apache.tapestry.IRequestCycle;
+import org.apache.tapestry.form.FormSupport;
+import org.apache.tapestry.form.FormSupportFactory;
+
+/**
+ * Implementation of {@link FormSupportFactory} that generates 
+ * {@link GoFormSupportImpl} instances, suitable for WML content.
+ *
+ * @since 4.1.1
+ */
+public class GoFormSupportFactory implements FormSupportFactory
+{
+    public FormSupport createFormSupport(IMarkupWriter writer, IRequestCycle cycle, IForm form) 
+    {
+        return new GoFormSupportImpl(writer, cycle, form);
+    }    
+}