mirror of https://github.com/apache/poi.git
Fix compiling Examples after adding new interface-method, fix compiler warnings and adjust some broken Javadoc
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809388 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
851be073bc
commit
4b5c908180
|
@ -32,12 +32,12 @@ import org.apache.poi.hssf.usermodel.*;
|
||||||
*
|
*
|
||||||
* @author Jason Height
|
* @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
|
/** This model simply returns an integer number up to the number of rows
|
||||||
* that are present in the sheet.
|
* that are present in the sheet.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private class SVRowHeaderModel extends AbstractListModel {
|
private class SVRowHeaderModel extends AbstractListModel<Object> {
|
||||||
private HSSFSheet sheet;
|
private HSSFSheet sheet;
|
||||||
|
|
||||||
public SVRowHeaderModel(HSSFSheet sheet) {
|
public SVRowHeaderModel(HSSFSheet sheet) {
|
||||||
|
@ -55,7 +55,7 @@ public class SVRowHeader extends JList {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Renderes the row number*/
|
/** Renderes the row number*/
|
||||||
private class RowHeaderRenderer extends JLabel implements ListCellRenderer {
|
private class RowHeaderRenderer extends JLabel implements ListCellRenderer<Object> {
|
||||||
private HSSFSheet sheet;
|
private HSSFSheet sheet;
|
||||||
private int extraHeight;
|
private int extraHeight;
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ public class SVRowHeader extends JList {
|
||||||
}
|
}
|
||||||
|
|
||||||
public SVRowHeader(HSSFSheet sheet, JTable table, int extraHeight) {
|
public SVRowHeader(HSSFSheet sheet, JTable table, int extraHeight) {
|
||||||
ListModel lm = new SVRowHeaderModel(sheet);
|
ListModel<Object> lm = new SVRowHeaderModel(sheet);
|
||||||
this.setModel(lm);
|
this.setModel(lm);
|
||||||
|
|
||||||
setFixedCellWidth(50);
|
setFixedCellWidth(50);
|
||||||
|
|
|
@ -28,6 +28,8 @@ import org.apache.poi.ss.usermodel.Cell;
|
||||||
import org.apache.poi.ss.usermodel.CellType;
|
import org.apache.poi.ss.usermodel.CellType;
|
||||||
import org.apache.poi.ss.usermodel.Color;
|
import org.apache.poi.ss.usermodel.Color;
|
||||||
import org.apache.poi.ss.usermodel.DateUtil;
|
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.Row;
|
||||||
import org.apache.poi.ss.usermodel.Sheet;
|
import org.apache.poi.ss.usermodel.Sheet;
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
|
@ -109,10 +111,9 @@ public class ExcelComparator {
|
||||||
/**
|
/**
|
||||||
* Utility to compare Excel File Contents cell by cell for all sheets.
|
* Utility to compare Excel File Contents cell by cell for all sheets.
|
||||||
*
|
*
|
||||||
* @param workbook1 the workbook1
|
* @param wb1 the workbook1
|
||||||
* @param workbook2 the workbook2
|
* @param wb2 the workbook2
|
||||||
* @return the Excel file difference containing a flag and a list of differences
|
* @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) {
|
public static List<String> compare(Workbook wb1, Workbook wb2) {
|
||||||
Locator loc1 = new Locator();
|
Locator loc1 = new Locator();
|
||||||
|
@ -130,11 +131,6 @@ public class ExcelComparator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compare data in all sheets.
|
* 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) {
|
private void compareDataInAllSheets(Locator loc1, Locator loc2) {
|
||||||
for (int i = 0; i < loc1.workbook.getNumberOfSheets(); i++) {
|
for (int i = 0; i < loc1.workbook.getNumberOfSheets(); i++) {
|
||||||
|
@ -291,15 +287,6 @@ public class ExcelComparator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compare sheet data.
|
* 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) {
|
private void compareSheetData(Locator loc1, Locator loc2) {
|
||||||
compareNumberOfRowsInSheets(loc1, loc2);
|
compareNumberOfRowsInSheets(loc1, loc2);
|
||||||
|
@ -343,13 +330,13 @@ public class ExcelComparator {
|
||||||
*/
|
*/
|
||||||
private void isCellAlignmentMatches(Locator loc1, Locator loc2) {
|
private void isCellAlignmentMatches(Locator loc1, Locator loc2) {
|
||||||
// TODO: check for NPE
|
// TODO: check for NPE
|
||||||
short align1 = loc1.cell.getCellStyle().getAlignment();
|
HorizontalAlignment align1 = loc1.cell.getCellStyle().getAlignmentEnum();
|
||||||
short align2 = loc2.cell.getCellStyle().getAlignment();
|
HorizontalAlignment align2 = loc2.cell.getCellStyle().getAlignmentEnum();
|
||||||
if (align1 != align2) {
|
if (align1 != align2) {
|
||||||
addMessage(loc1, loc2,
|
addMessage(loc1, loc2,
|
||||||
"Cell Alignment does not Match ::",
|
"Cell Alignment does not Match ::",
|
||||||
Short.toString(align1),
|
align1.name(),
|
||||||
Short.toString(align2)
|
align2.name()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -424,7 +411,7 @@ public class ExcelComparator {
|
||||||
Date date1 = loc1.cell.getDateCellValue();
|
Date date1 = loc1.cell.getDateCellValue();
|
||||||
Date date2 = loc2.cell.getDateCellValue();
|
Date date2 = loc2.cell.getDateCellValue();
|
||||||
if (!date1.equals(date2)) {
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -473,13 +460,13 @@ public class ExcelComparator {
|
||||||
*/
|
*/
|
||||||
private void isCellFillPatternMatches(Locator loc1, Locator loc2) {
|
private void isCellFillPatternMatches(Locator loc1, Locator loc2) {
|
||||||
// TOOO: Check for NPE
|
// TOOO: Check for NPE
|
||||||
short fill1 = loc1.cell.getCellStyle().getFillPattern();
|
FillPatternType fill1 = loc1.cell.getCellStyle().getFillPatternEnum();
|
||||||
short fill2 = loc2.cell.getCellStyle().getFillPattern();
|
FillPatternType fill2 = loc2.cell.getCellStyle().getFillPatternEnum();
|
||||||
if (fill1 != fill2) {
|
if (fill1 != fill2) {
|
||||||
addMessage(loc1, loc2,
|
addMessage(loc1, loc2,
|
||||||
"Cell Fill pattern does not Match ::",
|
"Cell Fill pattern does not Match ::",
|
||||||
Short.toString(fill1),
|
fill1.name(),
|
||||||
Short.toString(fill2)
|
fill2.name()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -591,12 +578,6 @@ public class ExcelComparator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if cell under line matches.
|
* 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) {
|
private void isCellUnderLineMatches(Locator loc1, Locator loc2) {
|
||||||
// TOOO: distinguish underline type
|
// TOOO: distinguish underline type
|
||||||
|
|
|
@ -140,6 +140,10 @@ public class XLSX2CSV {
|
||||||
public void headerFooter(String text, boolean isHeader, String tagName) {
|
public void headerFooter(String text, boolean isHeader, String tagName) {
|
||||||
// Skip, no headers or footers in CSV
|
// Skip, no headers or footers in CSV
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void endSheet() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,11 @@ public class HybridStreaming {
|
||||||
@Override
|
@Override
|
||||||
public void cell(String cellReference, String formattedValue, XSSFComment comment) {
|
public void cell(String cellReference, String formattedValue, XSSFComment comment) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void endSheet() {
|
||||||
|
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue