public TabPageStruct getPageStruct(String pageName) { for (TabPageStruct struct : this.pageList) { if (struct.getName().equals(pageName)) { return struct; } } return null; }
public void render(HtmlStringBuffer buff) { // 渲染tab头 if (this.customPage) { buff.append("<div class=\"tabs\" style=\"margin-top: 5px;\">\r\n"); buff.append(" <div class=\"tabsHeader\">\r\n"); buff.append(" <div class=\"tabsHeaderContent\">\r\n"); buff.append(" <ul>\r\n"); String isSelect = "class=\"selected\""; for (TabPageStruct page : pageList) { if (page.isHidden()) { buff.append(" <li id=\"") .append(page.getName()) .append("Head\" style=\"display:none\" ") .append(isSelect) .append("><a href=\"#\"><span>") .append(page.getName()) .append("</span></a></li>\r\n"); } else { buff.append(" <li id=\"") .append(page.getName()) .append("Head\"") .append(isSelect) .append("><a href=\"#\"><span>") .append(page.getName()) .append("</span></a></li>\r\n"); } isSelect = ""; } buff.append(" </ul>\r\n"); buff.append(" </div>\r\n"); buff.append(" </div>\r\n"); // 内容 if (isMainTab) { buff.append(" <div class=\"tabsContent\" style=\"border-width: 0 1px 1px 1px;\">\r\n"); } else { buff.append(" <div class=\"tabsContent\" style=\"border-width: 0 1px 1px 1px;\">\r\n"); } for (TabPageStruct page : pageList) { buff.append(" <div>\r\n"); if (isMainTab) { buff.append(" <div layoutH=\"").append(this.layoutH).append("\">\r\n"); // 需要自动布局 } else { buff.append(" <div >\r\n"); // 需要自动布局 } page.render(buff); buff.append(" </div>\r\n"); buff.append(" </div>\r\n"); } buff.append(" </div>\r\n"); buff.append("</div>\r\n"); } else { // 空白页 this.blankPage.render(buff); } }