49719837a549a0b6b36cb1b6898d6d2e5b842780
[aaf/authz.git] / authz-gui / src / main / java / com / att / authz / gui / table / RefCell.java
1 /*******************************************************************************
2  * Copyright (c) 2016 AT&T Intellectual Property. All rights reserved.
3  *******************************************************************************/
4 package com.att.authz.gui.table;
5
6 import static com.att.xgen.html.HTMLGen.A;
7
8 import com.att.xgen.html.HTMLGen;
9
10 /**
11  * Write a Reference Link into a Cell
12  *
13  */
14 public class RefCell extends AbsCell {
15         public final String name;
16         public final String href;
17         private String[] attrs;
18         
19         public RefCell(String name, String href, String... attributes) {
20                 attrs = new String[attributes.length];
21                 System.arraycopy(attributes, 0, attrs, 0, attributes.length);
22                 this.name = name;
23                 this.href = href;
24         }
25         
26         @Override
27         public void write(HTMLGen hgen) {
28                 hgen.leaf(A,"href="+href).text(name);
29         }
30         
31         @Override
32         public String[] attrs() {
33                 return attrs;
34         }
35 }