Author: onealj
Date: Mon Feb 12 06:19:14 2018
New Revision: 1823922
URL: http://svn.apache.org/viewvc?rev=1823922&view=rev
Log:
bug 61898, 59837: update Spreadsheet Quick Guide to use alignment enums:
CellStyle#ALIGN_* short constants -> HorizontalAlignment and VerticalAlignment
enums
Modified:
poi/site/src/documentation/content/xdocs/spreadsheet/quick-guide.xml
Modified: poi/site/src/documentation/content/xdocs/spreadsheet/quick-guide.xml
URL:
http://svn.apache.org/viewvc/poi/site/src/documentation/content/xdocs/spreadsheet/quick-guide.xml?rev=1823922&r1=1823921&r2=1823922&view=diff
==============================================================================
--- poi/site/src/documentation/content/xdocs/spreadsheet/quick-guide.xml
(original)
+++ poi/site/src/documentation/content/xdocs/spreadsheet/quick-guide.xml Mon
Feb 12 06:19:14 2018
@@ -263,13 +263,13 @@
Row row = sheet.createRow((short) 2);
row.setHeightInPoints(30);
- createCell(wb, row, (short) 0, CellStyle.ALIGN_CENTER,
CellStyle.VERTICAL_BOTTOM);
- createCell(wb, row, (short) 1, CellStyle.ALIGN_CENTER_SELECTION,
CellStyle.VERTICAL_BOTTOM);
- createCell(wb, row, (short) 2, CellStyle.ALIGN_FILL,
CellStyle.VERTICAL_CENTER);
- createCell(wb, row, (short) 3, CellStyle.ALIGN_GENERAL,
CellStyle.VERTICAL_CENTER);
- createCell(wb, row, (short) 4, CellStyle.ALIGN_JUSTIFY,
CellStyle.VERTICAL_JUSTIFY);
- createCell(wb, row, (short) 5, CellStyle.ALIGN_LEFT,
CellStyle.VERTICAL_TOP);
- createCell(wb, row, (short) 6, CellStyle.ALIGN_RIGHT,
CellStyle.VERTICAL_TOP);
+ createCell(wb, row, (short) 0, HorizontalAlignment.CENTER,
VerticalAlignment.BOTTOM);
+ createCell(wb, row, (short) 1, HorizontalAlignment.CENTER_SELECTION,
VerticalAlignment.BOTTOM);
+ createCell(wb, row, (short) 2, HorizontalAlignment.FILL,
VerticalAlignment.CENTER);
+ createCell(wb, row, (short) 3, HorizontalAlignment.GENERAL,
VerticalAlignment.CENTER);
+ createCell(wb, row, (short) 4, HorizontalAlignment.JUSTIFY,
VerticalAlignment.JUSTIFY);
+ createCell(wb, row, (short) 5, HorizontalAlignment.LEFT,
VerticalAlignment.TOP);
+ createCell(wb, row, (short) 6, HorizontalAlignment.RIGHT,
VerticalAlignment.TOP);
// Write the output to a file
FileOutputStream fileOut = new FileOutputStream("xssf-align.xlsx");
@@ -286,7 +286,7 @@
* @param column the column number to create the cell in
* @param halign the horizontal alignment for the cell.
*/
- private static void createCell(Workbook wb, Row row, short column, short
halign, short valign) {
+ private static void createCell(Workbook wb, Row row, short column,
HorizontalAlignment halign, VerticalAlignment valign) {
Cell cell = row.createCell(column);
cell.setCellValue("Align It");
CellStyle cellStyle = wb.createCellStyle();
@@ -824,7 +824,7 @@ Examples:
style.setIndention((short)4);
CellUtil.createCell(row, 8, "This is the value of the cell", style);
Cell cell2 = CellUtil.createCell( row2, 8, "This is the value of the
cell");
- CellUtil.setAlignment(cell2, wb, CellStyle.ALIGN_CENTER);
+ CellUtil.setAlignment(cell2, HorizontalAlignment.CENTER);
// Write out the workbook
FileOutputStream fileOut = new FileOutputStream( "workbook.xls" );
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]