Author: nick
Date: Thu Apr 14 14:32:49 2011
New Revision: 1092286
URL: http://svn.apache.org/viewvc?rev=1092286&view=rev
Log:
Rename/Move xssf.model.Table to xssf.usermodel.XSSFTable as it now has
usermodel-like features
Added:
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java
- copied, changed from r1092273,
poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/Table.java
Removed:
poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/Table.java
Modified:
poi/trunk/src/documentation/content/xdocs/status.xml
poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExportToXml.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFImportFromXML.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFMap.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRelation.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java
Modified: poi/trunk/src/documentation/content/xdocs/status.xml
URL:
http://svn.apache.org/viewvc/poi/trunk/src/documentation/content/xdocs/status.xml?rev=1092286&r1=1092285&r2=1092286&view=diff
==============================================================================
--- poi/trunk/src/documentation/content/xdocs/status.xml (original)
+++ poi/trunk/src/documentation/content/xdocs/status.xml Thu Apr 14 14:32:49
2011
@@ -34,6 +34,7 @@
<changes>
<release version="3.8-beta3" date="2011-??-??">
+ <action dev="poi-developers" type="fix">Rename/Move
xssf.model.Table to xssf.usermodel.XSSFTable as it now has usermodel-like
features</action>
<action dev="poi-developers" type="fix">51061 - Correct target URI
for new XSSF Tables</action>
<action dev="poi-developers" type="add">Initial support for XSSF
Charts. Provides easy access to the underlying CTChart object via the Sheet
Drawing, but no high level interface onto the chart contents as yet.</action>
<action dev="poi-developers" type="fix">50884 - XSSF and HSSF
freeze panes now behave the same</action>
Modified:
poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExportToXml.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExportToXml.java?rev=1092286&r1=1092285&r2=1092286&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExportToXml.java
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExportToXml.java
Thu Apr 14 14:32:49 2011
@@ -41,7 +41,7 @@ import javax.xml.validation.SchemaFactor
import javax.xml.validation.Validator;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
-import org.apache.poi.xssf.model.Table;
+import org.apache.poi.xssf.usermodel.XSSFTable;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFMap;
import org.apache.poi.xssf.usermodel.XSSFRow;
@@ -123,7 +123,7 @@ public class XSSFExportToXml implements
*/
public void exportToXML(OutputStream os, String encoding, boolean
validate) throws SAXException, ParserConfigurationException,
TransformerException{
List<XSSFSingleXmlCell> singleXMLCells = map.getRelatedSingleXMLCell();
- List<Table> tables = map.getRelatedTables();
+ List<XSSFTable> tables = map.getRelatedTables();
String rootElement = map.getCtMap().getRootElement();
@@ -141,13 +141,13 @@ public class XSSFExportToXml implements
List<String> xpaths = new Vector<String>();
Map<String,XSSFSingleXmlCell> singleXmlCellsMappings = new
HashMap<String,XSSFSingleXmlCell>();
- Map<String,Table> tableMappings = new HashMap<String,Table>();
+ Map<String,XSSFTable> tableMappings = new HashMap<String,XSSFTable>();
for(XSSFSingleXmlCell simpleXmlCell : singleXMLCells) {
xpaths.add(simpleXmlCell.getXpath());
singleXmlCellsMappings.put(simpleXmlCell.getXpath(),
simpleXmlCell);
}
- for(Table table : tables) {
+ for(XSSFTable table : tables) {
String commonXPath = table.getCommonXpath();
xpaths.add(commonXPath);
tableMappings.put(commonXPath, table);
@@ -159,7 +159,7 @@ public class XSSFExportToXml implements
for(String xpath : xpaths) {
XSSFSingleXmlCell simpleXmlCell =
singleXmlCellsMappings.get(xpath);
- Table table = tableMappings.get(xpath);
+ XSSFTable table = tableMappings.get(xpath);
if (!xpath.matches(".*\\[.*")) {
Modified:
poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFImportFromXML.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFImportFromXML.java?rev=1092286&r1=1092285&r2=1092286&view=diff
==============================================================================
---
poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFImportFromXML.java
(original)
+++
poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFImportFromXML.java
Thu Apr 14 14:32:49 2011
@@ -33,7 +33,7 @@ import javax.xml.xpath.XPathFactory;
import org.apache.poi.util.POILogFactory;
import org.apache.poi.util.POILogger;
-import org.apache.poi.xssf.model.Table;
+import org.apache.poi.xssf.usermodel.XSSFTable;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFMap;
import org.apache.poi.xssf.usermodel.XSSFRow;
@@ -85,7 +85,7 @@ public class XSSFImportFromXML {
List<XSSFSingleXmlCell> singleXmlCells =
_map.getRelatedSingleXMLCell();
- List<Table> tables = _map.getRelatedTables();
+ List<XSSFTable> tables = _map.getRelatedTables();
XPathFactory xpathFactory = XPathFactory.newInstance();
XPath xpath = xpathFactory.newXPath();
@@ -107,7 +107,7 @@ public class XSSFImportFromXML {
cell.setCellValue(textContent);
}
- for (Table table : tables) {
+ for (XSSFTable table : tables) {
String commonXPath = table.getCommonXpath();
NodeList result = (NodeList) xpath.evaluate(commonXPath, doc,
XPathConstants.NODESET);
Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFMap.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFMap.java?rev=1092286&r1=1092285&r2=1092286&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFMap.java
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFMap.java Thu Apr
14 14:32:49 2011
@@ -24,7 +24,6 @@ import org.apache.poi.POIXMLDocumentPart
import org.apache.poi.util.Internal;
import org.apache.poi.xssf.model.MapInfo;
import org.apache.poi.xssf.model.SingleXmlCells;
-import org.apache.poi.xssf.model.Table;
import org.apache.poi.xssf.usermodel.helpers.XSSFSingleXmlCell;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTMap;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSchema;
@@ -101,16 +100,16 @@ public class XSSFMap {
/**
* @return the list of all Tables that provide a map rule to this mapping
*/
- public List<Table> getRelatedTables() {
+ public List<XSSFTable> getRelatedTables() {
- List<Table> tables = new Vector<Table>();
+ List<XSSFTable> tables = new Vector<XSSFTable>();
int sheetNumber = mapInfo.getWorkbook().getNumberOfSheets();
for (int i = 0; i < sheetNumber; i++) {
XSSFSheet sheet = mapInfo.getWorkbook().getSheetAt(i);
for (POIXMLDocumentPart p : sheet.getRelations()) {
if
(p.getPackageRelationship().getRelationshipType().equals(XSSFRelation.TABLE.getRelation()))
{
- Table table = (Table) p;
+ XSSFTable table = (XSSFTable) p;
if (table.mapsTo(ctMap.getID())) {
tables.add(table);
}
Modified:
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRelation.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRelation.java?rev=1092286&r1=1092285&r2=1092286&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRelation.java
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRelation.java
Thu Apr 14 14:32:49 2011
@@ -39,7 +39,6 @@ import org.apache.poi.xssf.model.MapInfo
import org.apache.poi.xssf.model.SharedStringsTable;
import org.apache.poi.xssf.model.SingleXmlCells;
import org.apache.poi.xssf.model.StylesTable;
-import org.apache.poi.xssf.model.Table;
import org.apache.poi.xssf.model.ThemesTable;
/**
@@ -146,7 +145,7 @@ public final class XSSFRelation extends
"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",
"/xl/tables/table#.xml",
- Table.class
+ XSSFTable.class
);
public static final XSSFRelation IMAGES = new XSSFRelation(
Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java?rev=1092286&r1=1092285&r2=1092286&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java Thu
Apr 14 14:32:49 2011
@@ -59,7 +59,6 @@ import org.apache.poi.util.Internal;
import org.apache.poi.util.POILogFactory;
import org.apache.poi.util.POILogger;
import org.apache.poi.xssf.model.CommentsTable;
-import org.apache.poi.xssf.model.Table;
import org.apache.poi.xssf.usermodel.helpers.ColumnHelper;
import org.apache.poi.xssf.usermodel.helpers.XSSFRowShifter;
import org.apache.xmlbeans.XmlException;
@@ -130,7 +129,7 @@ public class XSSFSheet extends POIXMLDoc
* Master shared formula is the first formula in a group of shared
formulas is saved in the f element.
*/
private Map<Integer, CTCellFormula> sharedFormulas;
- private TreeMap<String,Table> tables;
+ private TreeMap<String,XSSFTable> tables;
private List<CellRangeAddress> arrayFormulas;
private XSSFDataValidationHelper dataValidationHelper;
@@ -194,8 +193,8 @@ public class XSSFSheet extends POIXMLDoc
sheetComments = (CommentsTable)p;
break;
}
- if(p instanceof Table) {
- tables.put( p.getPackageRelationship().getId(), (Table)p );
+ if(p instanceof XSSFTable) {
+ tables.put( p.getPackageRelationship().getId(), (XSSFTable)p );
}
}
@@ -217,7 +216,7 @@ public class XSSFSheet extends POIXMLDoc
@SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are
deprecated in xmlbeans with JDK 1.5 support
private void initRows(CTWorksheet worksheet) {
_rows = new TreeMap<Integer, XSSFRow>();
- tables = new TreeMap<String, Table>();
+ tables = new TreeMap<String, XSSFTable>();
sharedFormulas = new HashMap<Integer, CTCellFormula>();
arrayFormulas = new ArrayList<CellRangeAddress>();
for (CTRow row : worksheet.getSheetData().getRowArray()) {
@@ -3022,7 +3021,7 @@ public class XSSFSheet extends POIXMLDoc
/**
* Creates a new Table, and associates it with this Sheet
*/
- public Table createTable() {
+ public XSSFTable createTable() {
if(! worksheet.isSetTableParts()) {
worksheet.addNewTableParts();
}
@@ -3033,7 +3032,7 @@ public class XSSFSheet extends POIXMLDoc
// Table numbers need to be unique in the file, not just
// unique within the sheet. Find the next one
int tableNumber =
getPackagePart().getPackage().getPartsByContentType(XSSFRelation.TABLE.getContentType()).size()
+ 1;
- Table table = (Table)createRelationship(XSSFRelation.TABLE,
XSSFFactory.getInstance(), tableNumber);
+ XSSFTable table = (XSSFTable)createRelationship(XSSFRelation.TABLE,
XSSFFactory.getInstance(), tableNumber);
tbl.setId(table.getPackageRelationship().getId());
tables.put(tbl.getId(), table);
@@ -3044,8 +3043,8 @@ public class XSSFSheet extends POIXMLDoc
/**
* Returns any tables associated with this Sheet
*/
- public List<Table> getTables() {
- List<Table> tableList = new ArrayList<Table>(
+ public List<XSSFTable> getTables() {
+ List<XSSFTable> tableList = new ArrayList<XSSFTable>(
tables.values()
);
return tableList;
Copied: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java
(from r1092273, poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/Table.java)
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java?p2=poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java&p1=poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/Table.java&r1=1092273&r2=1092286&rev=1092286&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/Table.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java Thu
Apr 14 14:32:49 2011
@@ -15,7 +15,7 @@
limitations under the License.
==================================================================== */
-package org.apache.poi.xssf.model;
+package org.apache.poi.xssf.usermodel;
import java.io.IOException;
import java.io.InputStream;
@@ -28,7 +28,6 @@ import org.apache.poi.POIXMLDocumentPart
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.ss.util.CellReference;
-import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.helpers.XSSFXmlColumnPr;
import org.apache.xmlbeans.XmlException;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTTable;
@@ -47,7 +46,7 @@ import org.openxmlformats.schemas.spread
*
* @author Roberto Manicardi
*/
-public class Table extends POIXMLDocumentPart {
+public class XSSFTable extends POIXMLDocumentPart {
private CTTable ctTable;
private List<XSSFXmlColumnPr> xmlColumnPr;
@@ -56,13 +55,13 @@ public class Table extends POIXMLDocumen
private String commonXPath;
- public Table() {
+ public XSSFTable() {
super();
ctTable = CTTable.Factory.newInstance();
}
- public Table(PackagePart part, PackageRelationship rel)
+ public XSSFTable(PackagePart part, PackageRelationship rel)
throws IOException {
super(part, rel);
readFrom(part.getInputStream());
Modified:
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java?rev=1092286&r1=1092285&r2=1092286&view=diff
==============================================================================
---
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java
(original)
+++
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java
Thu Apr 14 14:32:49 2011
@@ -17,7 +17,7 @@
package org.apache.poi.xssf.usermodel.helpers;
-import org.apache.poi.xssf.model.Table;
+import org.apache.poi.xssf.usermodel.XSSFTable;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTTableColumn;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXmlColumnPr;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STXmlDataType.Enum;
@@ -33,11 +33,11 @@ import org.openxmlformats.schemas.spread
*/
public class XSSFXmlColumnPr {
- private Table table;
+ private XSSFTable table;
private CTTableColumn ctTableColumn;
private CTXmlColumnPr ctXmlColumnPr;
- public XSSFXmlColumnPr(Table table ,CTTableColumn
ctTableColum,CTXmlColumnPr ctXmlColumnPr){
+ public XSSFXmlColumnPr(XSSFTable table ,CTTableColumn
ctTableColum,CTXmlColumnPr ctXmlColumnPr){
this.table = table;
this.ctTableColumn = ctTableColum;
this.ctXmlColumnPr = ctXmlColumnPr;
Modified:
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java?rev=1092286&r1=1092285&r2=1092286&view=diff
==============================================================================
---
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
(original)
+++
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
Thu Apr 14 14:32:49 2011
@@ -43,7 +43,6 @@ import org.apache.poi.ss.usermodel.Workb
import org.apache.poi.xssf.XSSFITestDataProvider;
import org.apache.poi.xssf.XSSFTestDataSamples;
import org.apache.poi.xssf.model.CalculationChain;
-import org.apache.poi.xssf.model.Table;
import org.apache.poi.xssf.usermodel.extensions.XSSFCellFill;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet;
@@ -852,7 +851,7 @@ public final class TestXSSFBugs extends
assertEquals(0, s2.getTables().size());
assertEquals(0, s3.getTables().size());
- Table t = s1.getTables().get(0);
+ XSSFTable t = s1.getTables().get(0);
assertEquals("Tabella1", t.getName());
assertEquals("Tabella1", t.getDisplayName());
assertEquals("A1:C3", t.getCTTable().getRef());
Modified:
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java?rev=1092286&r1=1092285&r2=1092286&view=diff
==============================================================================
---
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java
(original)
+++
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java
Thu Apr 14 14:32:49 2011
@@ -26,7 +26,6 @@ import org.apache.poi.xssf.XSSFTestDataS
import org.apache.poi.xssf.model.CommentsTable;
import org.apache.poi.xssf.model.StylesTable;
import org.apache.poi.xssf.model.CalculationChain;
-import org.apache.poi.xssf.model.Table;
import org.apache.poi.xssf.usermodel.helpers.ColumnHelper;
import org.apache.poi.util.HexDump;
import org.apache.poi.hssf.record.PasswordRecord;
@@ -1050,11 +1049,11 @@ public final class TestXSSFSheet extends
assertEquals("a",
s1.getRow(0).getCell(0).getRichStringCellValue().toString());
assertEquals(1.0, s1.getRow(1).getCell(0).getNumericCellValue());
- List<Table> tables = s1.getTables();
+ List<XSSFTable> tables = s1.getTables();
assertNotNull(tables);
assertEquals(1, tables.size());
- Table table = tables.get(0);
+ XSSFTable table = tables.get(0);
assertEquals("Tabella1", table.getName());
assertEquals("Tabella1", table.getDisplayName());
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]