/** * Returns the row's total width. * * @return the width of the row. */ public int getRowWidth() { int overallWidth = 0; for (int i = 0; i < data.length; i++) { overallWidth += getTable().getColumnWidth(i); } return overallWidth; }
/** * {@inheritDoc} */ @Override public String draw() { final String[] row = new String[data.length]; for (int i = 0; i < data.length; i++) { row[i] = Util.pad(data[i], ' ', getTable().getColumnWidth(i), getTable().getOrientation(i)); } return Util.combine(new String(new char[] { AbstractTabularComponent.BORDER }), SPACE, Util.implode(Util.combine(SPACE, new String(new char[] { AbstractTabularComponent.BORDER }), SPACE), row), SPACE, new String(new char[] { AbstractTabularComponent.BORDER }), NEWLINE); }