View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  
20  package org.apache.myfaces.tobago.internal.mock.faces;
21  
22  import org.apache.myfaces.tobago.context.Theme;
23  import org.apache.myfaces.tobago.context.ThemeImpl;
24  import org.apache.myfaces.tobago.internal.config.RenderersConfig;
25  
26  import java.util.List;
27  
28  public class MockTheme extends ThemeImpl {
29  
30    private String name;
31  
32    private String displayName;
33  
34    private List<Theme> fallbackThemeList;
35  
36    private RenderersConfig config = new MockRenderersConfig();
37  
38    private boolean versioned;
39  
40    private String version;
41  
42    public MockTheme(final String name, final String displayName, final List<Theme> fallbackThemeList) {
43      this.name = name;
44      this.displayName = displayName;
45      this.fallbackThemeList = fallbackThemeList;
46    }
47  
48    @Override
49    public String getName() {
50      return name;
51    }
52  
53    @Override
54    public List<Theme> getFallbackList() {
55      return fallbackThemeList;
56    }
57  
58    @Override
59    public String getDisplayName() {
60      return displayName;
61    }
62  
63    @Override
64    public String getResourcePath() {
65      return null;
66    }
67  
68    @Override
69    public RenderersConfig getRenderersConfig() {
70      return config;
71    }
72  
73    @Override
74    public String[] getScriptResources(final boolean production) {
75      return new String[0];
76    }
77  
78    @Override
79    public String[] getStyleResources(final boolean production) {
80      return new String[0];
81    }
82  
83    @Override
84    public boolean isVersioned() {
85      return versioned;
86    }
87  
88    @Override
89    public void setVersioned(final boolean versioned) {
90      this.versioned = versioned;
91    }
92  
93    @Override
94    public String getVersion() {
95      return version;
96    }
97  
98    @Override
99    public void setVersion(final String version) {
100     this.version = version;
101   }
102 }