X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-gui%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fgui%2FTable.java;fp=auth%2Fauth-gui%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fgui%2FTable.java;h=bcef6de9ba2b2c17971708588d651b289c76e99a;hb=1296352d8eafee57f982a4342ad79ada4aa56d28;hp=6451c4e7faa2d9ba7f05d5d7a49ed23a3c0326d4;hpb=bdce7667a6e272e2fa32e298d957a0d9090c5bc9;p=aaf%2Fauthz.git diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Table.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Table.java index 6451c4e7..bcef6de9 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Table.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Table.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -53,7 +53,7 @@ public class Table, TRANS extends TransStore> extends Named this(title,trans,data,name, attrs); this.other = other; } - + public Table(String title, TRANS trans, Data data, String name, String ... attrs) { super(true,name); // prefix=postfix=null; @@ -73,7 +73,7 @@ public class Table, TRANS extends TransStore> extends Named this.title = title; // Derive an ID from title (from no spaces, etc), and prepend to IDAttributes (Protected from NamedCode) addAttr(true,title(trans).replaceAll("\\s","")); - + other = null; } @@ -87,12 +87,12 @@ public class Table, TRANS extends TransStore> extends Named }); Mark table = new Mark(); Mark tr = new Mark(); - + hgen.incr(table,TABLE); if (title==null) { cache.dynamic(hgen, new DynamicCode() { @Override - public void code(S state, TRANS trans, final Cache cache, final HTMLGen hgen) throws APIException, IOException { + public void code(S state, TRANS trans, final Cache cache, final HTMLGen hgen) throws APIException, IOException { hgen.leaf("caption", "class=title").text(title(trans)).end(); } }); @@ -104,16 +104,16 @@ public class Table, TRANS extends TransStore> extends Named hgen.leaf("th").text(column).end(); } hgen.end(tr); - + // Load Rows Dynamically cache.dynamic(hgen, rows); // End Table - hgen.end(table); - + hgen.end(table); + if (other!=null) { other.code(cache,hgen); } - + // Print Message from Row Gathering, if available cache.dynamic(hgen, new DynamicCode() { @Override @@ -122,7 +122,7 @@ public class Table, TRANS extends TransStore> extends Named if ((msg = trans.get(EMPTY_TABLE_SLOT, null))!=null) { hgen.incr("style").text("#inner tr,caption,input,p.preamble {display: none;}#inner p.notfound {margin: 0px 0px 0px 20px}").end(); hgen.incr(HTMLGen.P,"class=notfound").text(msg).end().br(); - } else if ((msg=trans.get(ROW_MSG_SLOT,null))!=null) { + } else if ((msg=trans.get(ROW_MSG_SLOT,null))!=null) { hgen.p(msg).br(); } } @@ -146,7 +146,7 @@ public class Table, TRANS extends TransStore> extends Named cells = new AbsCell[0][0]; msg = "No Data Found"; } - + public Cells(ArrayList arrayCells, String msg) { cells = new AbsCell[arrayCells.size()][]; arrayCells.toArray(cells); @@ -154,9 +154,9 @@ public class Table, TRANS extends TransStore> extends Named } public AbsCell[][] cells; public String msg; - + } - + public interface Data, TRANS extends Trans> { // Note: Trans is not first to avoid Method Name Collision public void prefix(S state, TRANS trans, final Cache cache, final HTMLGen hgen); @@ -168,17 +168,17 @@ public class Table, TRANS extends TransStore> extends Named private class Rows extends DynamicCode { private Data data; private int alt; - + public Rows(Data data, int alt) { this.data = data; this.alt = alt; } - + @Override public void code(final S state, final TRANS trans, final Cache cache, final HTMLGen hgen) throws APIException, IOException { Mark tr = new Mark(); Mark td = new Mark(); - + int alt = this.alt; Cells cells = data.get(trans,state); if (cells.cells.length>0) { @@ -220,7 +220,7 @@ public class Table, TRANS extends TransStore> extends Named // prefix = dynamicCode; // return this; // } -// +// // public Table setPostfix(DynamicCode dynamicCode) { // postfix = dynamicCode; // return this;