summaryrefslogtreecommitdiffstats
path: root/authz-gui/src/main/java/com/att/authz/gui/BreadCrumbs.java
blob: ffcc3f295e0211d2dd5106ad37dc6cd23ab9b195 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*******************************************************************************
 * Copyright (c) 2016 AT&T Intellectual Property. All rights reserved.
 *******************************************************************************/
package com.att.authz.gui;

import static com.att.xgen.html.HTMLGen.A;
import static com.att.xgen.html.HTMLGen.LI;
import static com.att.xgen.html.HTMLGen.UL;

import java.io.IOException;

import org.onap.aaf.inno.env.APIException;
import com.att.xgen.Cache;
import com.att.xgen.Mark;
import com.att.xgen.html.HTMLGen;

public class BreadCrumbs extends NamedCode {
	private Page[] breadcrumbs;

	public BreadCrumbs(Page ... pages) {
		super(false,"breadcrumbs");
		breadcrumbs = pages;
	}
	
	@Override
	public void code(Cache<HTMLGen> cache, HTMLGen hgen) throws APIException, IOException {
		// BreadCrumbs
		Mark mark = new Mark();
		hgen.incr(mark, UL);
		for(Page p : breadcrumbs) {
			hgen.incr(LI,true)
				.leaf(A,"href="+p.url()).text(p.name())
				.end(2);
		}
		hgen.end(mark);
	}
}