public TableEditorModel(IOpenLTable table, String view, boolean showFormulas) { this.table = table; this.gridTable = table.getGridTable(view); if (gridTable == table.getGridTable()) { // table have no business view(e.g. Method Table) this.view = IXlsTableNames.VIEW_DEVELOPER; } else { this.view = view; } this.showFormulas = showFormulas; }
public TableEditorModel(IOpenLTable table, String view, boolean showFormulas) { this.table = table; this.gridTable = table.getGridTable(view); if (gridTable == table.getGridTable()) { // table have no business view(e.g. Method Table) this.view = IXlsTableNames.VIEW_DEVELOPER; } else { this.view = view; } this.showFormulas = showFormulas; }
public String getTableName() { String header = table.getGridTable().getCell(0, 0).getStringValue(); String tableName = (header == null) ? "" : header; return tableName; }
public String getTableName() { String header = table.getGridTable().getCell(0, 0).getStringValue(); String tableName = (header == null) ? "" : header; return tableName; }
private String getName(IOpenLTable table) { String tableName = table.getDisplayName(); if (tableName == null || tableName.isEmpty()) { tableName = TableSyntaxNodeUtils.str2name(table.getGridTable().getCell(0, 0).getStringValue() , XlsNodeTypes.getEnumByValue(table.getType())); } String[] dimensionProps = TablePropertyDefinitionUtils.getDimensionalTablePropertiesNames(); ITableProperties tableProps = table.getProperties(); StringBuilder dimensionBuilder = new StringBuilder(); if (tableProps != null) { for (String dimensionProp : dimensionProps) { String propValue = tableProps.getPropertyValueAsString(dimensionProp); if (propValue != null && !propValue.isEmpty()) { dimensionBuilder.append(dimensionBuilder.length() == 0 ? "" : ", ").append(dimensionProp).append(" = ").append(propValue); } } } if (dimensionBuilder.length() > 0) { return tableName +"["+ dimensionBuilder.toString() +"]"; } else { return tableName; } }
private String getName(IOpenLTable table) { String tableName = table.getDisplayName(); if (tableName == null || tableName.isEmpty()) { tableName = TableSyntaxNodeUtils.str2name(table.getGridTable().getCell(0, 0).getStringValue() , XlsNodeTypes.getEnumByValue(table.getType())); } String[] dimensionProps = TablePropertyDefinitionUtils.getDimensionalTablePropertiesNames(); ITableProperties tableProps = table.getProperties(); StringBuilder dimensionBuilder = new StringBuilder(); if (tableProps != null) { for (String dimensionProp : dimensionProps) { String propValue = tableProps.getPropertyValueAsString(dimensionProp); if (propValue != null && !propValue.isEmpty()) { dimensionBuilder.append(dimensionBuilder.length() == 0 ? "" : ", ").append(dimensionProp).append(" = ").append(propValue); } } } if (dimensionBuilder.length() > 0) { return tableName +"["+ dimensionBuilder.toString() +"]"; } else { return tableName; } }
public IGridFilter getFilter(int i) { XlsProjection projection = projectionTable(i); if (projection != null) { IOpenLTable table = (IOpenLTable) projection.getData(); List<ICell> diffCells = projection.getDiffCells(); if (diffCells != null) { return makeFilter(table.getGridTable(), diffCells); } } return null; }
public IGridFilter getFilter(int i) { XlsProjection projection = projectionTable(i); if (projection != null) { IOpenLTable table = (IOpenLTable) projection.getData(); List<ICell> diffCells = projection.getDiffCells(); if (diffCells != null) { return makeFilter(table.getGridTable(), diffCells); } } return null; }
public IGridFilter getFilter(int i) { XlsProjection projection = projectionTable(i); if (projection != null) { IOpenLTable table = (IOpenLTable) projection.getData(); List<ICell> diffCells = projection.getDiffCells(); if (diffCells != null) { return makeFilter(table.getGridTable(), diffCells); } } return null; }
public String removeTable() { final WebStudio studio = WebStudioUtils.getWebStudio(); IGridTable gridTable = table.getGridTable(IXlsTableNames.VIEW_DEVELOPER); try { new TableServiceImpl(true).removeTable(gridTable); studio.rebuildModel(); } catch (TableServiceException e) { e.printStackTrace(); // TODO UI exception return null; } return "mainPage"; }
public Integer getRowIndex() { if (runnableTestMethods.length > 0 && !runnableTestMethods[0].hasId()) { if (method instanceof TestSuiteMethod) { TestMethodBoundNode boundNode = ((TestSuiteMethod) method).getBoundNode(); if (boundNode != null && !boundNode.getTable().getHeaderTable().isNormalOrientation()) { // Currently row indexes aren't supported for transposed test tables return null; } } return table.getGridTable().getHeight() - runnableTestMethods.length + 1; } return null; }
public Integer getRowIndex() { if (runnableTestMethods.length > 0 && !runnableTestMethods[0].hasId()) { if (method instanceof TestSuiteMethod) { TestMethodBoundNode boundNode = ((TestSuiteMethod) method).getBoundNode(); if (boundNode != null && !boundNode.getTable().getHeaderTable().isNormalOrientation()) { // Currently row indexes aren't supported for transposed test tables return null; } } return table.getGridTable().getHeight() - runnableTestMethods.length + 1; } return null; }
private void initTableName() { if (table != null) { String name = table.getName(); if (StringUtils.isEmpty(name)) { // If table contains errors, it will not contain compiled name. Try to parse table header instead. String methodHeader = table.getGridTable().getCell(0, 0).getStringValue(); name = TableSyntaxNodeUtils.str2name(methodHeader, XlsNodeTypes.getEnumByValue(table.getType())); } tableTechnicalName = name; } }
private void initTableName() { if (table != null) { String name = table.getName(); if (StringUtils.isEmpty(name)) { // If table contains errors, it will not contain compiled name. Try to parse table header instead. String methodHeader = table.getGridTable().getCell(0, 0).getStringValue(); name = TableSyntaxNodeUtils.str2name(methodHeader, XlsNodeTypes.getEnumByValue(table.getType())); } tableTechnicalName = name; } }
public void fillProps(XlsProjection projection, XlsTable xlsTable) { projection.addProperty(new AbstractProperty("name", xlsTable.getTableName())); projection.addProperty(new AbstractProperty("location", xlsTable.getLocation().getStart().toString())); IGridTable grid = xlsTable.getTable().getGridTable(); projection.addProperty(new AbstractProperty("size", grid.getWidth() + "x" + grid.getHeight())); }
public String removeTable() throws Throwable { try { final WebStudio studio = WebStudioUtils.getWebStudio(); IGridTable gridTable = table.getGridTable(IXlsTableNames.VIEW_DEVELOPER); new TableServiceImpl().removeTable(gridTable); XlsSheetGridModel sheetModel = (XlsSheetGridModel) gridTable.getGrid(); sheetModel.getSheetSource().getWorkbookSource().save(); studio.compile(); RecentlyVisitedTables visitedTables = studio.getModel().getRecentlyVisitedTables(); visitedTables.remove(table); } catch (Exception e) { throw e.getCause(); } return null; }
public void fillProps(XlsProjection projection, XlsTable xlsTable) { projection.addProperty(new AbstractProperty("name", xlsTable.getTableName())); projection.addProperty(new AbstractProperty("location", xlsTable.getLocation().getStart().toString())); IGridTable grid = xlsTable.getTable().getGridTable(); projection.addProperty(new AbstractProperty("size", grid.getWidth() + "x" + grid.getHeight())); }
public static XlsProjection buildTable(IOpenLTable table, String tableName) { XlsProjection projection = new XlsProjection(tableName, TABLE); projection.setData(table); // GRID XlsProjection grid = new XlsProjection("GRID", XlsProjectionType.GRID); projection.addChild(grid); IGridTable gridTable = table.getGridTable(); int height = gridTable.getHeight(); int width = gridTable.getWidth(); for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { ICell cell = gridTable.getCell(j, i); grid.addChild(buildCell(cell, i + "x" + j)); } } // ROWS /*for (int i = 1; i < gridTable.getLogicalHeight(); i++) { ILogicalTable row = gridTable.getLogicalRow(i); projection.addChild(buildRow(row, "row" + i)); }*/ return projection; }
public String removeTable() throws Throwable { try { final WebStudio studio = WebStudioUtils.getWebStudio(); IGridTable gridTable = table.getGridTable(IXlsTableNames.VIEW_DEVELOPER); gridTable.edit(); new TableServiceImpl().removeTable(gridTable); XlsSheetGridModel sheetModel = (XlsSheetGridModel) gridTable.getGrid(); sheetModel.getSheetSource().getWorkbookSource().save(); gridTable.stopEditing(); FacesUtils.removeSessionParam(org.openl.rules.tableeditor.util.Constants.TABLE_EDITOR_MODEL_NAME); studio.compile(); RecentlyVisitedTables visitedTables = studio.getModel().getRecentlyVisitedTables(); visitedTables.remove(table); } catch (Exception e) { throw e.getCause(); } return null; }
public static XlsProjection buildTable(IOpenLTable table, String tableName) { XlsProjection projection = new XlsProjection(tableName, TABLE); projection.setData(table); // GRID XlsProjection grid = new XlsProjection("GRID", XlsProjectionType.GRID); projection.addChild(grid); IGridTable gridTable = table.getGridTable(); int height = gridTable.getHeight(); int width = gridTable.getWidth(); for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { ICell cell = gridTable.getCell(j, i); grid.addChild(buildCell(cell, i + "x" + j)); } } // ROWS /*for (int i = 1; i < gridTable.getLogicalHeight(); i++) { ILogicalTable row = gridTable.getLogicalRow(i); projection.addChild(buildRow(row, "row" + i)); }*/ return projection; }