width = "90%";
// -----------
// Title table
// -----------
Div titleDiv = new Div();
titleDiv.addAttribute("align", AlignType.RIGHT);
// Location path
if(path != null)
titleDiv.addElement(path);
// Help link
if(helpId != null && helpLinkResource != null) {
try {
A helpLink = helpLinkResource.getHelpLink(helpId, lang);
if(helpLink != null)
titleDiv.addElement(helpLink);
}
//catch(java.sql.SQLException sqle) {
//sqle.printStackTrace();
//}
catch(Exception e) {
e.printStackTrace();
}
}
Table titleTable = new Table()
.setWidth(width)
.setBorder(0)
.setAlign(AlignType.CENTER)
.setCellPadding(0)
.setCellSpacing(0)
.addElement(new TR().addElement(new TD().addElement(titleDiv)));
// ------------
// Header table
// ------------
UL headerList = new UL();
for(int i = 0; i < texts.length; i++) {
LI listItem = new LI();
listItem.setNeedClosingTag(true);
if(i == up)
listItem.setID("current");
Span headerSpan = new Span();
String link = links != null && links[i] != null ? links[i] : null;
String text = texts[i] != null ? texts[i] : "";
text = text.trim();
if(link == null){
link = "#";
} else if(link.length() == 0){
link = "#";
listItem.setID("dummy");
}
if(parameters != null) {
link += parameters;
}
A anchor = new A(link.trim(), text);
anchor.setOnMouseOver("window.status='" + text + "'; return true");
anchor.setOnMouseOut("window.status=''; return true");
headerSpan.addElement(anchor);
headerList.addElement(listItem.addElement(headerSpan));
}
Table headerTable = new Table()
.setWidth(width)
.setBorder(0)
.setAlign(AlignType.CENTER)
.setCellSpacing(0)
.setCellPadding(0)
.addElement(
new TR().addElement(
new TD().setColSpan(2).setVAlign(AlignType.BOTTOM).addElement(
new Table().setWidth("100%").setBorder(0).setCellSpacing(0).setCellPadding(
0).addElement(
new TR().addElement(new TD().addElement(new Div()
.addElement(headerList)
.setID("header")))))
.setClass("tabtopbg")).addElement(
new TD().setWidth(2).setVAlign(AlignType.BOTTOM).addElement(