public StaticTable setContent(int row, int col, String text) { HtmlItem cell = getCell(row,col); cell.addSubItem(text); return this; }
private HtmlItem getCell(int row,int col) { HtmlItem rw = (HtmlItem) this.getSubItem(row); // HtmlItem rw = rowsList.get(row); return (HtmlItem) rw.getSubItem(col); }
/** TODO: We cannot set the first line as table header here like in the LoadMonitoring App. * This requires an extension of StaticTable */ public void formatStaticTable(StaticTable table) { if(tableStriped) table.addStyle(StaticTable.TABLE_STRIPED); setRowStyle(table, 0, headerRowStyle); for(int i=2;;i+=2) { HtmlItem item = (HtmlItem) table.getSubItem(i); if(item == null) break; item.addStyle(coloredRowStyle); } }
/** * * @param widthString * e.g. "50%" or "100px" * @return */ public HtmlItem setMaxWidth(String widthString) { if (widthString == null) { // TODO remove max-widht return this; } if (!widthString.endsWith(";")) widthString += ";"; if (!widthString.startsWith("max-width:")) widthString = "max-width:" + widthString; return addStyle(new HtmlStyle("style", widthString)); }
private void setRowStyle(StaticTable table, int row, HtmlStyle style) { HtmlItem rw = (HtmlItem) table.getSubItem(row); rw.addStyle(style); }
@Override public String toString() { return getHtml(); }
private void addLine(StaticTable table, OgemaWidgetBase<?> labelWidget, OgemaWidgetBase<?> valueWidget) { table.setContent(lineCounter, 0, labelWidget).setContent(lineCounter++, 1, valueWidget); }
public HtmlItem newEntry() { final HtmlItem item = new ListItem(); addSubItem(item); return item; }
/** * @param size from <br> * 1: largest <br> * 6: smallest * @param headerText */ public StaticHeader(int size, String headerText) { super("h" + size); addSubItem(headerText); }
public static Linebreak getInstance() { if (instance == null) { instance = new Linebreak(); } return instance; }
public BoldText(String text) { super("b"); addSubItem(text); }
public ItalicText(String text) { super("i"); addSubItem(text); }
@Override public String toString() { return getHtml(); }
/** * * @param widthString * e.g. "50%" or "100px" * @return */ public HtmlItem setWidth(String widthString) { if (widthString == null) { // TODO remove widht return this; } if (!widthString.endsWith(";")) widthString += ";"; if (!widthString.startsWith("width:")) widthString = "width:" + widthString; return addStyle(new HtmlStyle("style", widthString)); }
public String getHtml() { return getHtml(true); }
private void addLine(StaticTable table, OgemaWidgetBase<?> labelWidget, OgemaWidgetBase<?> valueWidget) { table.setContent(lineCounter, 0, labelWidget).setContent(lineCounter++, 1, valueWidget); }
public StaticTable setContent(int row,int col, OgemaWidget widget) { HtmlItem cell = getCell(row,col); cell.addSubItem(widget); return this; }
public StaticTable setContent(int row, int col, HtmlItem item) { HtmlItem cell = getCell(row,col); cell.addSubItem(item); return this; }