headerRow.getCells().get(6).getContext().setTextAlignment(TextAlignment.RIGHT); headerRow.getCells().get(7).getContext().setTextAlignment(TextAlignment.RIGHT); headerRow.getCells().get(8).getContext().setTextAlignment(TextAlignment.RIGHT); headerRow.getCells().get(9).getContext().setTextAlignment(TextAlignment.RIGHT); row.getCells().get(6).getContext().setTextAlignment(TextAlignment.RIGHT); row.getCells().get(7).getContext().setTextAlignment(TextAlignment.RIGHT); row.getCells().get(8).getContext().setTextAlignment(TextAlignment.RIGHT); row.getCells().get(9).getContext().setTextAlignment(TextAlignment.RIGHT); });
/** * Sets all padding for all cells in the row to the same value. * @param padding new padding for top, bottom, left, and right, ignored if smaller than 0 * @return this to allow chaining */ public AT_Row setPadding(int padding){ if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setPadding(padding); } } return this; }
/** * Sets the bottom padding character for all cells in the row. * @param paddingBottomChar new padding character, ignored if null * @return this to allow chaining */ public AT_Row setPaddingBottomChar(Character paddingBottomChar) { if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setPaddingBottomChar(paddingBottomChar); } } return this; }
/** * Sets the right padding for all cells in the row. * @param paddingRight new padding, ignored if smaller than 0 * @return this to allow chaining */ public AT_Row setPaddingRight(int paddingRight) { if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setPaddingRight(paddingRight); } } return this; }
/** * Sets the right padding character for all cells in the row. * @param paddingRightChar new padding character, ignored if null * @return this to allow chaining */ public AT_Row setPaddingRightChar(Character paddingRightChar) { if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setPaddingRightChar(paddingRightChar); } } return this; }
/** * Sets the left padding for all cells in the row. * @param paddingLeft new padding, ignored if smaller than 0 * @return this to allow chaining */ public AT_Row setPaddingLeft(int paddingLeft) { if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setPaddingLeft(paddingLeft); } } return this; }
/** * Sets left and right padding for all cells in the row. * @param padding new padding for left and right, ignored if smaller than 0 * @return this to allow chaining */ public AT_Row setPaddingLeftRight(int padding){ if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setPaddingLeftRight(padding); } } return this; }
/** * Sets the top padding for all cells in the row. * @param paddingTop new padding, ignored if smaller than 0 * @return this to allow chaining */ public AT_Row setPaddingTop(int paddingTop) { if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setPaddingTop(paddingTop); } } return this; }
/** * Sets top and bottom padding for all cells in the row. * @param padding new padding for top and bottom, ignored if smaller than 0 * @return this to allow chaining */ public AT_Row setPaddingTopBottom(int padding){ if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setPaddingTopBottom(padding); } } return this; }
/** * Sets the HTML entity translator for all cells in the row. * It will also remove any other translator set. * Nothing will happen if the argument is null. * @param htmlElementTranslator translator * @return this to allow chaining */ public AT_Row setHtmlElementTranslator(HtmlElementTranslator htmlElementTranslator) { if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setHtmlElementTranslator(htmlElementTranslator); } } return this; }
/** * Sets left and right padding for all cells in the row (only if both values are not smaller than 0). * @param paddingLeft new left padding, ignored if smaller than 0 * @param paddingRight new right padding, ignored if smaller than 0 * @return this to allow chaining */ public AT_Row setPaddingLeftRight(int paddingLeft, int paddingRight){ if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setPaddingLeftRight(paddingLeft, paddingRight); } } return this; }
/** * Sets all padding for all cells in the row to the same value. * @param padding new padding for top, bottom, left, and right, ignored if smaller than 0 * @return this to allow chaining */ public AT_Row setPadding(int padding){ if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setPadding(padding); } } return this; }
/** * Sets the bottom padding for all cells in the row. * @param paddingBottom new padding, ignored if smaller than 0 * @return this to allow chaining */ public AT_Row setPaddingBottom(int paddingBottom) { if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setPaddingBottom(paddingBottom); } } return this; }
/** * Sets the bottom padding character for all cells in the row. * @param paddingBottomChar new padding character, ignored if null * @return this to allow chaining */ public AT_Row setPaddingBottomChar(Character paddingBottomChar) { if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setPaddingBottomChar(paddingBottomChar); } } return this; }
/** * Sets the left padding for all cells in the row. * @param paddingLeft new padding, ignored if smaller than 0 * @return this to allow chaining */ public AT_Row setPaddingLeft(int paddingLeft) { if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setPaddingLeft(paddingLeft); } } return this; }
/** * Sets the top padding for all cells in the row. * @param paddingTop new padding, ignored if smaller than 0 * @return this to allow chaining */ public AT_Row setPaddingTop(int paddingTop) { if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setPaddingTop(paddingTop); } } return this; }
/** * Sets the left padding character for all cells in the row. * @param paddingLeftChar new padding character, ignored if null * @return this to allow chaining */ public AT_Row setPaddingLeftChar(Character paddingLeftChar) { if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setPaddingLeftChar(paddingLeftChar); } } return this; }
/** * Sets top and bottom padding for all cells in the row. * @param padding new padding for top and bottom, ignored if smaller than 0 * @return this to allow chaining */ public AT_Row setPaddingTopBottom(int padding){ if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setPaddingTopBottom(padding); } } return this; }
/** * Sets the top padding character for all cells in the row. * @param paddingTopChar new padding character, ignored if null * @return this to allow chaining */ public AT_Row setPaddingTopChar(Character paddingTopChar) { if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setPaddingTopChar(paddingTopChar); } } return this; }
private static void initializeTable() { generatedTable = new AsciiTable(); generatedTable.addRule(); AT_Row header = generatedTable.addRow(Constants.TABLE_POSTFIX_COLUMN, Constants.TABLE_FILE_COLUMN, Constants.TABLE_RESULT_COLUMN); header.getCells().forEach(c -> c.getContext().setTextAlignment(TextAlignment.CENTER)); }