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