*
* @author Jason Height
*/
-public class SVRowHeader extends JList {
+public class SVRowHeader extends JList<Object> {
/** This model simply returns an integer number up to the number of rows
* that are present in the sheet.
*
*/
- private class SVRowHeaderModel extends AbstractListModel {
+ private class SVRowHeaderModel extends AbstractListModel<Object> {
private HSSFSheet sheet;
public SVRowHeaderModel(HSSFSheet sheet) {
}
/** Renderes the row number*/
- private class RowHeaderRenderer extends JLabel implements ListCellRenderer {
+ private class RowHeaderRenderer extends JLabel implements ListCellRenderer<Object> {
private HSSFSheet sheet;
private int extraHeight;
}
public SVRowHeader(HSSFSheet sheet, JTable table, int extraHeight) {
- ListModel lm = new SVRowHeaderModel(sheet);
+ ListModel<Object> lm = new SVRowHeaderModel(sheet);
this.setModel(lm);
setFixedCellWidth(50);
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.Color;
import org.apache.poi.ss.usermodel.DateUtil;
+import org.apache.poi.ss.usermodel.FillPatternType;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
/**
* Utility to compare Excel File Contents cell by cell for all sheets.
*
- * @param workbook1 the workbook1
- * @param workbook2 the workbook2
+ * @param wb1 the workbook1
+ * @param wb2 the workbook2
* @return the Excel file difference containing a flag and a list of differences
- * @throws ExcelCompareException the excel compare exception
*/
public static List<String> compare(Workbook wb1, Workbook wb2) {
Locator loc1 = new Locator();
/**
* Compare data in all sheets.
- *
- * @param workbook1 the workbook1
- * @param workbook2 the workbook2
- * @param listOfDifferences the list of differences
- * @throws ExcelCompareException the excel compare exception
*/
private void compareDataInAllSheets(Locator loc1, Locator loc2) {
for (int i = 0; i < loc1.workbook.getNumberOfSheets(); i++) {
/**
* Compare sheet data.
- *
- * @param workbook1
- * the workbook1
- * @param workbook2
- * the workbook2
- * @param listOfDifferences
- *
- * @throws ExcelCompareException
- * the excel compare exception
*/
private void compareSheetData(Locator loc1, Locator loc2) {
compareNumberOfRowsInSheets(loc1, loc2);
*/
private void isCellAlignmentMatches(Locator loc1, Locator loc2) {
// TODO: check for NPE
- short align1 = loc1.cell.getCellStyle().getAlignment();
- short align2 = loc2.cell.getCellStyle().getAlignment();
+ HorizontalAlignment align1 = loc1.cell.getCellStyle().getAlignmentEnum();
+ HorizontalAlignment align2 = loc2.cell.getCellStyle().getAlignmentEnum();
if (align1 != align2) {
addMessage(loc1, loc2,
"Cell Alignment does not Match ::",
- Short.toString(align1),
- Short.toString(align2)
+ align1.name(),
+ align2.name()
);
}
}
Date date1 = loc1.cell.getDateCellValue();
Date date2 = loc2.cell.getDateCellValue();
if (!date1.equals(date2)) {
- addMessage(loc1, loc2, CELL_DATA_DOES_NOT_MATCH, date1.toGMTString(), date2.toGMTString());
+ addMessage(loc1, loc2, CELL_DATA_DOES_NOT_MATCH, date1.toString(), date2.toString());
}
}
*/
private void isCellFillPatternMatches(Locator loc1, Locator loc2) {
// TOOO: Check for NPE
- short fill1 = loc1.cell.getCellStyle().getFillPattern();
- short fill2 = loc2.cell.getCellStyle().getFillPattern();
+ FillPatternType fill1 = loc1.cell.getCellStyle().getFillPatternEnum();
+ FillPatternType fill2 = loc2.cell.getCellStyle().getFillPatternEnum();
if (fill1 != fill2) {
addMessage(loc1, loc2,
"Cell Fill pattern does not Match ::",
- Short.toString(fill1),
- Short.toString(fill2)
+ fill1.name(),
+ fill2.name()
);
}
}
/**
* Checks if cell under line matches.
- *
- * @param cellWorkBook1
- * the cell work book1
- * @param cellWorkBook2
- * the cell work book2
- * @return true, if cell under line matches
*/
private void isCellUnderLineMatches(Locator loc1, Locator loc2) {
// TOOO: distinguish underline type