@Override public int getAbsoluteRow() { return delegate.getAbsoluteRow(); }
public int getAbsoluteRow() { return delegate.getAbsoluteRow(); }
public int getAbsoluteRow() { return cell.getAbsoluteRow(); }
public int getAbsoluteRow() { return delegate.getAbsoluteRow(); }
protected boolean isNeededCell(ICell cell, int row, int col) { return cell.getAbsoluteColumn() == col && cell.getAbsoluteRow() == row; }
public void addConstant(ICell cell, NodeUsage nodeUsage) { int row = cell.getAbsoluteRow(); int col = cell.getAbsoluteColumn(); constantsMap.put(CellKey.CellKeyFactory.getCellKey(col, row), nodeUsage); }
public ForeignKeyColumnDescriptor(IOpenField field, IdentifierNode foreignKeyTable, IdentifierNode foreignKey, IdentifierNode[] foreignKeyTableAccessorChainTokens, ICell foreignKeyCell, StringValue displayValue, OpenL openl, boolean constructor, IdentifierNode[] fieldChainTokens) { super(field, displayValue, openl, constructor, fieldChainTokens); this.foreignKeyTable = foreignKeyTable; this.foreignKey = foreignKey; this.foreignKeyTableAccessorChainTokens = foreignKeyTableAccessorChainTokens; this.foreignKeyCellCoordinate = CellKey.CellKeyFactory.getCellKey(foreignKeyCell.getAbsoluteColumn(), foreignKeyCell.getAbsoluteRow()); }
private static void writeMetaInfo(TableSyntaxNode tableSyntaxNode, ICell cell, String description) { MetaInfoReader metaReader = tableSyntaxNode.getMetaInfoReader(); if (metaReader instanceof DecisionTableMetaInfoReader) { DecisionTableMetaInfoReader metaInfoReader = (DecisionTableMetaInfoReader) metaReader; metaInfoReader.addSimpleRulesReturn(cell.getAbsoluteRow(), cell.getAbsoluteColumn(), description); } }
private boolean isHeaderRow(int row) { TableSyntaxNode syntaxNode = getTableSyntaxNode(); return syntaxNode.getTable().getCell(0, 0).getAbsoluteRow() == row; }
private static Map<String, Point> getAbsoluteSpreadsheetFieldCoordinates(SpreadsheetResult spreadsheetResult) { Map<String, Point> absoluteCoordinates = new HashMap<String, Point>(); IGridTable sourceTable = spreadsheetResult.getLogicalTable().getSource(); String[] rowNames = spreadsheetResult.getRowNames(); String[] columnNames = spreadsheetResult.getColumnNames(); for (int i = 0; i < rowNames.length; i++) { for (int j = 0; j < columnNames.length; j++) { int column = getColumn(sourceTable, j); int row = getRow(sourceTable, i); ICell cell = sourceTable.getCell(column, row); Point absolute = new Point(cell.getAbsoluteColumn(), cell.getAbsoluteRow()); StringBuilder sb = new StringBuilder(); sb.append(SpreadsheetStructureBuilder.DOLLAR_SIGN) .append(columnNames[j]) .append(SpreadsheetStructureBuilder.DOLLAR_SIGN) .append(rowNames[i]); absoluteCoordinates.put(sb.toString(), absolute); } } return absoluteCoordinates; }
SpreadsheetCell[][] cells = getBoundNode().getCells(); ICell firstCell = cells[0][0].getSourceCell(); int r = row - firstCell.getAbsoluteRow(); int c = col - firstCell.getAbsoluteColumn();
private boolean isDescription(ITable table, int row, int col) { if (table.getNumberOfRows() == 0) { // No data values in this table. Only description. return true; } ICell firstDataCell = table.getRowTable(0).getCell(0, 0); if (table.getData().isNormalOrientation()) { return row < firstDataCell.getAbsoluteRow(); } else { return col < firstDataCell.getAbsoluteColumn(); } }
private boolean isProperties(int row, int col) { TableSyntaxNode tableSyntaxNode = getTableSyntaxNode(); if (!tableSyntaxNode.hasPropertiesDefinedInTable()) { return false; } ILogicalTable propertiesSection = tableSyntaxNode.getTableProperties().getPropertiesSection(); ICell firstCell = propertiesSection.getCell(0, 0); int r = row - firstCell.getAbsoluteRow(); int c = col - firstCell.getAbsoluteColumn(); // When c == -1 and r == 0 it's the "properties" keyword. return c >= -1 && r >= 0 && r < propertiesSection.getHeight() && c < propertiesSection.getWidth(); }
@Override protected CellMetaInfo getBodyMetaInfo(int row, int col) { ConstantsTableBoundNode boundNode = getBoundNode(); ILogicalTable normalizedData = boundNode.getNormalizedData(); ICell firstCell = normalizedData.getCell(0, 0); boolean normalOrientation = normalizedData.isNormalOrientation(); int c; int r; if (normalOrientation) { r = row - firstCell.getAbsoluteRow(); c = col - firstCell.getAbsoluteColumn(); } else { r = col - firstCell.getAbsoluteColumn(); c = row - firstCell.getAbsoluteRow(); } if (c == 2 && r >= 0) { // Constant value column String constantName = normalizedData.getCell(1, r).getStringValue(); for (ConstantOpenField field : boundNode.getConstantOpenFields()) { if (field.getName().equals(constantName)) { IOpenClass type = field.getType(); return new CellMetaInfo(type, type.getAggregateInfo().isAggregate(type)); } } } return null; } }
private boolean isSpecialRow(int rowNum) { ColumnMatch columnMatch = getBoundNode().getColumnMatch(); IGrid grid = columnMatch.getSyntaxNode().getTableBody().getSource().getGrid(); int firstNameRowNum = getSpecialRowCount(columnMatch); IGridRegion firstNameRegion = columnMatch.getRows().get(firstNameRowNum).get(NAMES)[0].getGridRegion(); ICell cell = grid.getCell(firstNameRegion.getLeft(), firstNameRegion.getTop()); return rowNum < cell.getAbsoluteRow(); }
private void saveDescriptionMetaInfo(FunctionalRow funcRow, IGridRegion region) { // Condition/Action code (expression) ICell codeCell = funcRow.getCodeTable().getCell(0, 0); int row = codeCell.getAbsoluteRow(); int col = codeCell.getAbsoluteColumn(); if (IGridRegion.Tool.contains(region, col, row)) { List<CellMetaInfo> metaInfoList = OpenLCellExpressionsCompiler.getMetaInfo( funcRow.getSourceCodeModule(), funcRow.getMethod() ); // Decision table always contains 1 meta info setPreparedMetaInfo(row, col, metaInfoList.get(0)); } // Condition/Action type definition ILogicalTable paramsTable = funcRow.getParamsTable(); // In the case of errors params will be null IParameterDeclaration[] params = funcRow.getParams(); if (params != null && params.length > 0 && params[0] != null) { IParameterDeclaration param = params[0]; ICell paramCell = paramsTable.getCell(0, 0); row = paramCell.getAbsoluteRow(); col = paramCell.getAbsoluteColumn(); if (IGridRegion.Tool.contains(region, col, row)) { setPreparedMetaInfo(row, col, getMetaInfo(paramsTable, param.getType())); } } }
@Override public CellMetaInfo getBodyMetaInfo(int row, int col) { ICell firstCell = getTableSyntaxNode().getTableBody().getCell(0, 2); if (operationColumn == -1) { log.error("Operation column isn't initialized"); } else { if (col == operationColumn) { return firstCell.getAbsoluteRow() <= row ? AlgorithmBuilder.CELL_META_INFO : null; } } Algorithm algorithm = getBoundNode().getAlgorithm(); if (algorithm != null) { CellMetaInfo metaInfo = searchMetaInfo(row, col, algorithm.getAlgorithmSteps()); if (metaInfo != NOT_FOUND) { return metaInfo; } for (AlgorithmSubroutineMethod method : algorithm.getSubroutines()) { metaInfo = searchMetaInfo(row, col, method.getAlgorithmSteps()); if (metaInfo != NOT_FOUND) { return metaInfo; } } } return null; }
ICell cell = grid.getCell(region.getLeft(), region.getTop()); if (cell.getAbsoluteRow() != rowNum) { continue;
private CellMetaInfo getPropertiesMetaInfo(int row, int col) { ILogicalTable propertiesSection = getTableSyntaxNode().getTableProperties().getPropertiesSection(); ICell firstCell = propertiesSection.getCell(0, 0); int r = row - firstCell.getAbsoluteRow(); int c = col - firstCell.getAbsoluteColumn(); if (c == 1) { // Create meta info for property value String fieldName = propertiesSection.getCell(0, r).getStringValue(); IOpenField field = JavaOpenClass.getOpenClass(TableProperties.class).getField(fieldName); if (field != null) { IOpenClass type = field.getType(); if (type.getAggregateInfo().isAggregate(type)) { return new CellMetaInfo(type.getAggregateInfo().getComponentType(type), true); } else { return new CellMetaInfo(type, false); } } return null; } return null; } }
private static void writeMetaInfoForHConditions(ILogicalTable originalTable, DecisionTable decisionTable, Condition[] conditions, int numberOfHcondition, int numberOfConditions, int hColumn) { MetaInfoReader metaInfoReader = decisionTable.getSyntaxNode().getMetaInfoReader(); int j = 0; for (int i = numberOfConditions - numberOfHcondition; i < numberOfConditions; i++) { int c = hColumn; while (c <= originalTable.getSource().getWidth()) { ICell cell = originalTable.getSource().getCell(c, j); String cellValue = cell.getStringValue(); if (cellValue != null) { if (metaInfoReader instanceof DecisionTableMetaInfoReader) { ((DecisionTableMetaInfoReader) metaInfoReader).addSimpleRulesCondition(cell.getAbsoluteRow(), cell.getAbsoluteColumn(), decisionTable.getSignature().getParameterName(conditions[i].getParameterIndex()), decisionTable.getSignature().getParameterType(conditions[i].getParameterIndex())); } } c = c + cell.getWidth(); } j++; } }