RowLineRenderer(RowElement row, BorderStyle separator, int leftCellPadding, int rightCellPadding) { List<LineRenderer> cols = new ArrayList<LineRenderer>(row.cols.size()); for (Element col : row.cols) { cols.add(col.renderer()); } // this.cols = cols; this.style = row.getStyle(); this.separator = separator; this.leftCellPadding = leftCellPadding; this.rightCellPadding = rightCellPadding; }
public void testRowStyleWithEnd() { GroovyShell shell = new GroovyShell(); UIBuilder res = (UIBuilder)shell.evaluate( "import org.crsh.text.ui.UIBuilder;\n" + "import org.crsh.text.Color;\n" + "import org.crsh.text.Style;\n" + "def builder = new UIBuilder();\n" + "builder.table {\n" + "row (bold: true, foreground: red, background: green) {\n" + "label(\"col1\"); label(\"col2\")\n" + "}\n" + "};\n" + "return builder;\n" ); assertEquals(1, res.getElements().size()); TableElement table = assertInstance(TableElement.class, res.getElements().get(0)); assertEquals(1, table.getRows().size()); assertEquals(2, table.getRows().get(0).getSize()); assertEquals(Decoration.bold.fg(Color.red).bg(Color.green), table.getRows().get(0).getStyle()); }
RowLineRenderer(RowElement row, BorderStyle separator, int leftCellPadding, int rightCellPadding) { List<LineRenderer> cols = new ArrayList<LineRenderer>(row.cols.size()); for (Element col : row.cols) { cols.add(col.renderer()); } // this.cols = cols; this.style = row.getStyle(); this.separator = separator; this.leftCellPadding = leftCellPadding; this.rightCellPadding = rightCellPadding; }
RowLineRenderer(RowElement row, BorderStyle separator, int leftCellPadding, int rightCellPadding) { List<LineRenderer> cols = new ArrayList<LineRenderer>(row.cols.size()); for (Element col : row.cols) { cols.add(col.renderer()); } // this.cols = cols; this.style = row.getStyle(); this.separator = separator; this.leftCellPadding = leftCellPadding; this.rightCellPadding = rightCellPadding; }
RowRenderer(RowElement row, BorderStyle separator, int leftCellPadding, int rightCellPadding) { List<Renderer> cols = new ArrayList<Renderer>(row.cols.size()); for (Element col : row.cols) { cols.add(col.renderer()); } // this.cols = cols; this.style = row.getStyle(); this.separator = separator; this.leftCellPadding = leftCellPadding; this.rightCellPadding = rightCellPadding; }