2 * ============LICENSE_START====================================================
4 * ===========================================================================
5 * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
6 * ===========================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END====================================================
22 package org.onap.aaf.misc.xgen.html;
24 import java.util.ArrayList;
25 import java.util.List;
27 public class Imports implements Thematic{
29 public final int backdots;
30 // public final File webDir;
33 public Imports(int backdots) {
34 // this.webDir = webDir;
36 css = new ArrayList<String>();
37 js = new ArrayList<String>();
38 this.backdots = backdots;
42 public Imports css(String str) {
47 public Imports js(String str) {
52 public Imports theme(String str) {
53 theme = str==null?"":str;
58 * Pass in a possible Theme. If it is "" or null, it will resolve to default Theme set in Imports
64 public String themePath(String theTheme) {
65 StringBuilder src = dots(new StringBuilder());
66 if(theTheme==null||theTheme.length()==0) {
68 if(theme.length()>0)src.append('/');
74 return src.toString();
78 * Pass in a possible Theme. If it is "" or null, it will resolve to default Theme set in Imports
84 public String themeResolve(String theTheme) {
85 return (theTheme==null||theTheme.length()==0)
90 public StringBuilder dots(StringBuilder src) {
91 for(int i=0;i<backdots;++i) {