1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

v2.11.3.1

This commit is contained in:
gnosygnu
2015-11-15 21:08:17 -05:00
parent d9f45cec19
commit 8a5d58a973
418 changed files with 2694 additions and 1621 deletions

View File

@@ -16,7 +16,8 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.xtns.indicators; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
public class Indicator_html_bldr implements Bry_fmtr_arg {
import gplx.core.brys.fmtrs.*;
public class Indicator_html_bldr extends gplx.core.brys.Bfr_arg_base {
private Indicator_html_bldr_itm bldr_itm = new Indicator_html_bldr_itm();
private Ordered_hash list = Ordered_hash_.New();
public void Enabled_(boolean v) {enabled = v;} private boolean enabled = Bool_.Y;
@@ -30,7 +31,7 @@ public class Indicator_html_bldr implements Bry_fmtr_arg {
if (!enabled) return; // do not add if disabled; called from <page>; PAGE:en.s:The_Parochial_System_(Wilberforce,_1838); DATE:2015-04-29
list.Add_if_dupe_use_nth(xnde.Name(), xnde); // Add_if_dupe_use_nth: 2nd indicator overwrites 1st; DATE:2015-04-29
}
public void Fmt__do(Bry_bfr bfr) {
@Override public void Bfr_arg__add(Bry_bfr bfr) {
if (list.Count() == 0) return; // do not build html if no items; DATE:2015-04-29
bldr_itm.Init(list);
fmtr_grp.Bld_bfr_many(bfr, bldr_itm);
@@ -43,10 +44,10 @@ public class Indicator_html_bldr implements Bry_fmtr_arg {
), "itms")
;
}
class Indicator_html_bldr_itm implements Bry_fmtr_arg {
class Indicator_html_bldr_itm extends gplx.core.brys.Bfr_arg_base {
private Ordered_hash list;
public void Init(Ordered_hash list) {this.list = list;}
public void Fmt__do(Bry_bfr bfr) {
@Override public void Bfr_arg__add(Bry_bfr bfr) {
int list_len = list.Count();
for (int i = list_len - 1; i > -1; --i) { // reverse order
Indicator_xnde xnde = (Indicator_xnde)list.Get_at(i);

View File

@@ -60,7 +60,7 @@ class Indicator_html_bldr_fxt {
}
public void Test_bld(String expd) {
Bry_bfr tmp_bfr = Bry_bfr.reset_(255);
page.Html_data().Indicators().Fmt__do(tmp_bfr);
page.Html_data().Indicators().Bfr_arg__add(tmp_bfr);
Tfds.Eq_str_lines(expd, tmp_bfr.To_str_and_clear());
}
}