001// Licensed under the Apache License, Version 2.0 (the "License");
002// you may not use this file except in compliance with the License.
003// You may obtain a copy of the License at
004//
005// http://www.apache.org/licenses/LICENSE-2.0
006//
007// Unless required by applicable law or agreed to in writing, software
008// distributed under the License is distributed on an "AS IS" BASIS,
009// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
010// See the License for the specific language governing permissions and
011// limitations under the License.
012
013package org.apache.tapestry5.modules;
014
015import org.apache.tapestry5.SymbolConstants;
016import org.apache.tapestry5.commons.MappedConfiguration;
017import org.apache.tapestry5.ioc.annotations.Contribute;
018import org.apache.tapestry5.services.compatibility.Compatibility;
019import org.apache.tapestry5.services.compatibility.Trait;
020
021/**
022 * Module which defines the options needed to run Tapestry using Bootstrap 4 instead of the default
023 * Bootstrap 3.
024 *
025 * @since 5.5
026 */
027public class Bootstrap4Module
028{
029    public static void contributeApplicationDefaults(MappedConfiguration<String, Object> configuration)
030    {
031        configuration.add(SymbolConstants.BOOTSTRAP_ROOT, "${tapestry.asset.root}/bootstrap4");
032//        configuration.add(SymbolConstants.BEAN_DISPLAY_CSS_CLASS, "card");
033    }
034    
035    @Contribute(Compatibility.class)
036    public static void setupCompatibilityDefaults(MappedConfiguration<Trait, Boolean> configuration)
037    {
038        configuration.override(Trait.BOOTSTRAP_4, true);
039        configuration.add(Trait.BOOTSTRAP_3, false);
040    }
041    
042}