001    // Copyright 2007 The Apache Software Foundation
002    //
003    // Licensed under the Apache License, Version 2.0 (the "License");
004    // you may not use this file except in compliance with the License.
005    // You may obtain a copy of the License at
006    //
007    //     http://www.apache.org/licenses/LICENSE-2.0
008    //
009    // Unless required by applicable law or agreed to in writing, software
010    // distributed under the License is distributed on an "AS IS" BASIS,
011    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012    // See the License for the specific language governing permissions and
013    // limitations under the License.
014    
015    package org.apache.tapestry.javascript;
016    
017    import java.util.List;
018    
019    import org.apache.tapestry.IAsset;
020    
021    /**
022     * Manages javascript files of 3rd party libraries.
023     */
024    public interface JavascriptManager
025    {
026        /**
027         * The javascript files that should always be included.
028         *
029         * @return A not-null (but possibly empty) list of {@link IAsset}s.
030         */
031        List getAssets();
032    
033        IAsset getFirstAsset();
034    
035        /**
036         * The javascript files that provide form-related functionality.
037         * They're dynamically included when the page contains forms.
038         *
039         * @return A not-null (but possibly empty) list of {@link IAsset}s.
040         */
041        List getFormAssets();
042        
043        IAsset getFirstFormAsset();
044    
045        /**
046         * The javascript files that provide widget-related functionality.
047         * They're dynamically included when the page contains widgets.
048         *
049         * @return A not-null (but possibly empty) list of {@link IAsset}s.
050         */
051        List getWidgetAssets();
052    
053        IAsset getFirstWidgetAsset();
054    
055        /**
056         * The base path to the javascript files.
057         *
058         * @return if null, it is left unused.
059         */
060        IAsset getPath();
061    
062        /**
063         * The tapestry js file.
064         *
065         * @return if null then no tapestry file is included.
066         */
067        IAsset getTapestryAsset();
068    
069        /**
070         * The base path to the tapestry js files.
071         * 
072         * @return if null, it is left unused.
073         */
074        IAsset getTapestryPath();
075    }