public void testTableCols() { GroovyShell shell = new GroovyShell(); UIBuilder res = (UIBuilder)shell.evaluate( "import org.crsh.text.ui.UIBuilder;\n" + "def builder = new UIBuilder();\n" + "builder.table(columns: [1,1]) {\n" + "row {\n" + "}\n" + "};\n" + "return builder;\n" ); assertEquals(1, res.getElements().size()); TableElement table = assertInstance(TableElement.class, res.getElements().get(0)); Layout.Weighted layout = assertInstance(Layout.Weighted.class, table.getColumnLayout()); assertTrue(Arrays.equals(new int[]{1,1}, layout.getWeights())); }
TableLineRenderer(TableElement table) { this.rowLayout = table.getRowLayout(); this.columnLayout = table.getColumnLayout(); this.border = table.getBorder(); this.style = table.getStyle(); this.separator = table.getSeparator(); this.overflow = table.getOverflow(); this.leftCellPadding = table.getLeftCellPadding(); this.rightCellPadding = table.getRightCellPadding(); // for (RowElement row : table.getRows()) { if (head == null) { head = tail = new TableRowLineRenderer(this, row); } else { tail = tail.add(new TableRowLineRenderer(this, row)); } } }
TableLineRenderer(TableElement table) { this.rowLayout = table.getRowLayout(); this.columnLayout = table.getColumnLayout(); this.border = table.getBorder(); this.style = table.getStyle(); this.separator = table.getSeparator(); this.overflow = table.getOverflow(); this.leftCellPadding = table.getLeftCellPadding(); this.rightCellPadding = table.getRightCellPadding(); // for (RowElement row : table.getRows()) { if (head == null) { head = tail = new TableRowLineRenderer(this, row); } else { tail = tail.add(new TableRowLineRenderer(this, row)); } } }
TableRenderer(TableElement table) { this.rowLayout = table.getRowLayout(); this.columnLayout = table.getColumnLayout(); this.border = table.getBorder(); this.style = table.getStyle(); this.separator = table.getSeparator(); this.overflow = table.getOverflow(); this.leftCellPadding = table.getLeftCellPadding(); this.rightCellPadding = table.getRightCellPadding(); // for (RowElement row : table.getRows()) { if (head == null) { head = tail = new TableRowRenderer(this, row); } else { tail = tail.add(new TableRowRenderer(this, row)); } } }
TableLineRenderer(TableElement table) { this.rowLayout = table.getRowLayout(); this.columnLayout = table.getColumnLayout(); this.border = table.getBorder(); this.style = table.getStyle(); this.separator = table.getSeparator(); this.overflow = table.getOverflow(); this.leftCellPadding = table.getLeftCellPadding(); this.rightCellPadding = table.getRightCellPadding(); // for (RowElement row : table.getRows()) { if (head == null) { head = tail = new TableRowLineRenderer(this, row); } else { tail = tail.add(new TableRowLineRenderer(this, row)); } } }