public ITableItemStrategy getTableItem(TableEle tableEle) { if (tableEle == null) { return null; } return getTableEle(tableEle); }
@Override public TableRowStyle withStyle() { style.setElement(this); return style; }
@Override public TableCellStyle withStyle() { style.setElement(this); return style; }
private ITableItemStrategy getTableEle(TableEle tableEle) { if (tableEle.getValue().equals("tableDef")) { return new TableDefinition(); }else if (tableEle.getValue().equals("th")) { return new TableHeader(); }else if (tableEle.getValue().equals("td")) { return new TableCol(); }else { //if (tableEle.getValue().equals("tf")) { return new TableFooter(); } }
public void addTableEle(TableEle tableEle, String... cols) { if (cols != null && cols.length > 0) { StringBuilder th = new StringBuilder(""); ITableItemStrategy item = TableFactoryMethod.getInstance().getTableItem(tableEle); for (int i = 0; i < cols.length; i++) { //if(!"".equals(cols[i])){ th.append("\n" + item.getMiddle().replace("{value}", cols[i])); //} } joinTopMiddleBottom(th, item); } }
public TableRow(Object[] cols) { txt.append(tableRowTop); for (int i = 0; i < cols.length; i++) { //TableCell knows how to do the rest. txt.append( TableCell.with(cols[i]).create().getContent() ); } txt.append(tableRowBottom); }
public static TableFactoryMethod getInstance() { if (instance == null) { instance = new TableFactoryMethod(); } return instance; }
public static TableRow with(Object ... colls) { return new TableRow(colls); }
@Override public String getContent() { String withStyle = style.getNewContentWithStyle(txt.toString()); return withStyle; }
@Override public String getContent() { String withStyle = style.getNewContentWithStyle(txt.toString()); return withStyle; }
private ITableItemStrategy getTableEle(TableEle tableEle) { if (tableEle.getValue().equals("tableDef")) { return new TableDefinition(); }else if (tableEle.getValue().equals("th")) { return new TableHeader(); }else if (tableEle.getValue().equals("td")) { return new TableCol(); }else { //if (tableEle.getValue().equals("tf")) { return new TableFooter(); } }
public void addTableEle(TableEle tableEle, String... cols) { if (cols != null && cols.length > 0) { StringBuilder th = new StringBuilder(""); ITableItemStrategy item = TableFactoryMethod.getInstance().getTableItem(tableEle); for (int i = 0; i < cols.length; i++) { //if(!"".equals(cols[i])){ th.append("\n" + item.getMiddle().replace("{value}", cols[i])); //} } joinTopMiddleBottom(th, item); } }
public TableRow(Object[] cols) { txt.append(tableRowTop); for (int i = 0; i < cols.length; i++) { //TableCell knows how to do the rest. txt.append( TableCell.with(cols[i]).create().getContent() ); } txt.append(tableRowBottom); }
public ITableItemStrategy getTableItem(TableEle tableEle) { if (tableEle == null) { return null; } return getTableEle(tableEle); }
@Override public TableRowStyle withStyle() { style.setElement(this); return style; }
@Override public TableCellStyle withStyle() { style.setElement(this); return style; }
public static TableFactoryMethod getInstance() { if (instance == null) { instance = new TableFactoryMethod(); } return instance; }
public static TableRow with(Object ... colls) { return new TableRow(colls); }
@Override public String getContent() { String withStyle = style.getNewContentWithStyle(txt.toString()); return withStyle; }
@Override public String getContent() { String withStyle = style.getNewContentWithStyle(txt.toString()); return withStyle; }