KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > tags > javascript > IScriptReporter


1 /*
2  * Copyright 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  * $Header:$
17  */

18 package org.apache.beehive.netui.tags.javascript;
19
20 import org.apache.beehive.netui.util.internal.InternalStringBuilder;
21
22 import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender;
23
24 /**
25  * A <code>ScriptReporter</code> acts as a container for JavaScript generated by children of
26  * the tag. Usually a <code>ScriptReporter</code> will gather up all of the JavaScript
27  * generated by children into a single &lt;script> element output into the HTML. A script container
28  * will implement a map beteween the TagId and the real <code>name</code> or <code>id</code> attribute
29  * written into the HTML.
30  */

31 public interface IScriptReporter
32 {
33     /**
34      * This method will add Script as a function.
35      * @param placement
36      * @param script the text of the function. This value must not be null.
37      */

38     void addScriptFunction(ScriptPlacement placement, String JavaDoc script);
39
40     /**
41      * Adds a tagID and tagName to the id to name map. A script container
42      * can maintain a mapping of user ids to actual ids generated by
43      * the tagId. This method will track these.
44      * @param tagId the id of a child tag.
45      * @param tagName the name of a child tag.
46      */

47     void addLegacyTagIdMappings(String JavaDoc tagId, String JavaDoc tagName);
48
49     /**
50      * @param tagId
51      * @param realId
52      * @param realName
53      */

54     void addTagIdMappings(String JavaDoc tagId, String JavaDoc realId, String JavaDoc realName);
55
56     /**
57      * This method will output all of the Script associated with the script reporter.
58      * @param sb The script is written into the provided InternalStringBuilder. This value must not be null.
59      */

60     void writeScript(AbstractRenderAppender sb);
61 }
62
Popular Tags