KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > woody > formmodel > RepeaterActionDefinition


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.woody.formmodel;
17
18 /**
19  * Abstract repeater action. Subclasses will typically just self-add an
20  * event handler that will act on the repeater.
21  *
22  * @see RepeaterActionDefinitionBuilder
23  * @author <a HREF="http://www.apache.org/~sylvain/">Sylvain Wallez</a>
24  * @version CVS $Id: RepeaterActionDefinition.java 30932 2004-07-29 17:35:38Z vgritsenko $
25  */

26 public abstract class RepeaterActionDefinition extends ActionDefinition {
27
28     private String JavaDoc name = null;
29     
30     /**
31      * Builds an action whose target repeater is the parent of this widget
32      */

33     public RepeaterActionDefinition() {
34     }
35     
36     /**
37      * Builds an action whose target is a sibling of this widget
38      * @param repeaterName the name of the repeater
39      */

40     public RepeaterActionDefinition(String JavaDoc repeaterName) {
41         this.name = repeaterName;
42     }
43
44     public Widget createInstance() {
45         return new RepeaterAction(this);
46     }
47     
48     /**
49      * Get the name of the repeater on which to act. If <code>null</code>, the repeater
50      * is the parent of the current widget (i.e. actions are in repeater rows). Otherwise,
51      * the repeater is a sibling of the current widget.
52      *
53      * @return the repeater name (can be <code>null</code>).
54      */

55     public String JavaDoc getRepeaterName() {
56         return this.name;
57     }
58     
59 }
60
Popular Tags