Package com.haulmont.yarg.formatters.impl.doc

Examples of com.haulmont.yarg.formatters.impl.doc.TableManager


    protected void fillTables(XDispatchHelper xDispatchHelper) throws com.sun.star.uno.Exception {
        List<String> tablesNames = TableManager.getTablesNames(xComponent);

        for (String tableName : tablesNames) {
            TableManager tableManager = new TableManager(xComponent, tableName);
            BandFinder bandFinder = new BandFinder(tableManager).find();

            BandData band = bandFinder.getBand();
            String bandName = bandFinder.getBandName();
            int numberOfRowWithAliases = tableManager.findRowWithAliases();

            if (band != null && numberOfRowWithAliases > -1) {
                XTextTable xTextTable = tableManager.getXTextTable();

                // try to select one cell without it workaround
                int columnCount = xTextTable.getColumns().getCount();
                if (columnCount < 2) {
                    xTextTable.getColumns().insertByIndex(columnCount, 1);
                }

                fillTable(band.getName(), band.getParentBand(), tableManager, xDispatchHelper, numberOfRowWithAliases);

                // end of workaround ->
                if (columnCount < 2) {
                    xTextTable.getColumns().removeByIndex(columnCount, 1);
                }
            } else if (numberOfRowWithAliases > -1
                    && rootBand.getFirstLevelBandDefinitionNames() != null
                    && rootBand.getFirstLevelBandDefinitionNames().contains(bandName)) {
                //if table is linked with band and has aliases on it, but no band data found -
                //we are removing the row
                tableManager.deleteRow(numberOfRowWithAliases);
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.haulmont.yarg.formatters.impl.doc.TableManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.