@Override public void run() throws Exception { ILogicalTable row = dataTable.getRow(index); boolean firstField = (index == 0); processRow(row, cxt, fields, firstField); } });
@Override protected ILogicalTable parseInternal(ILogicalTable unparsedTable, ITableObject tobj) { ILogicalTable row = unparsedTable.getRow(0); tobj.addParsedTable(name, row); return unparsedTable.getRows(1); }
@Override public void run() throws Exception { ILogicalTable row = dataTable.getRow(index); processRow(row, cxt); } });
private IGridRegion getDisplayRowRegion(ILogicalTable originaltable) { ILogicalTable tableWithDisplay = originaltable.getRows(DISPLAY_ROW); ILogicalTable displayRow = tableWithDisplay.getRow(0); IGridRegion displayRowRegion = (displayRow.getSource()).getRegion(); return displayRowRegion; }
public IGridTable getRowTable(int row) { return logicalTable.getRow(row + 1).getSource(); }
public SpreadsheetComponentsBuilder(TableSyntaxNode tableSyntaxNode, IBindingContext bindingContext) { this.tableSyntaxNode = tableSyntaxNode; CellsHeaderExtractor extractor = ((SpreadsheetHeaderNode)tableSyntaxNode.getHeader()).getCellHeadersExtractor(); if (extractor == null) { extractor = new CellsHeaderExtractor(getSignature(tableSyntaxNode), tableSyntaxNode.getTableBody().getRow(0).getColumns(1), tableSyntaxNode.getTableBody().getColumn(0).getRows(1)); } this.cellsHeaderExtractor = extractor; this.bindingContext = bindingContext; }
public IGridTable getHeaderTable() { return logicalTable.getRow(0).getSource(); }
private static Object loadCommaSeparatedArrayParams(ILogicalTable dataTable, String paramName, String ruleName, OpenlToolAdaptor openlAdaptor, IOpenClass aggregateType, IOpenClass paramType) throws SyntaxNodeException { ILogicalTable paramSource = dataTable.getRow(0); Object params = RuleRowHelper .loadCommaSeparatedParam(aggregateType, paramType, paramName, ruleName, paramSource, openlAdaptor); Class<?> paramClass = params.getClass(); if (paramClass.isArray() && !paramClass.getComponentType().isPrimitive()) { return processAsObjectParams(paramType, (Object[]) params); } return params; }
private String getHeaderStr(int row, ILogicalTable table) { String headerStr = table.getRow(row) .getSource() .getCell(IDecisionTableConstants.INFO_COLUMN_INDEX, 0) .getStringValue(); if (headerStr == null) { return ""; } return headerStr.toUpperCase(); }
public static int calculateHeight(ILogicalTable table) { int height = table.getHeight(); int last = -1; for (int i = 0; i < height; i++) { String source = table.getRow(i).getSource().getCell(0, 0).getStringValue(); if (source != null && source.trim().length() != 0) { last = i; } } return last + 1; }
private IOpenSourceCodeModule getSourceCodeModule(ILogicalTable bodyTable) { int height = bodyTable.getHeight(); IOpenSourceCodeModule[] cellSources = new IOpenSourceCodeModule[height]; for (int i = 0; i < height; i++) { cellSources[i] = new GridCellSourceCodeModule(bodyTable.getRow(i).getSource(), null); } return new CompositeSourceCodeModule(cellSources, "\n"); } }
private void addRule(int row, ILogicalTable table, IBindingContext bindingContext) throws SyntaxNodeException { if (ruleRow != null) { throw SyntaxNodeExceptionUtils.createError("Only one rule row/column allowed", new GridCellSourceCodeModule(table.getRow(row).getSource(), IDecisionTableConstants.INFO_COLUMN_INDEX, 0, bindingContext)); } ruleRow = new RuleRow(row, table); }
private void addRowHeaders() { String[] rowNames = cellsHeaderExtractor.getRowNames(); for (int i = 0; i < rowNames.length; i++) { if (rowNames[i] != null) { IGridTable rowNameForHeader = cellsHeaderExtractor.getRowNamesTable().getRow(i).getColumn(0).getSource(); IOpenSourceCodeModule source = new GridCellSourceCodeModule(rowNameForHeader, bindingContext); SpreadsheetHeaderDefinition header = rowHeaders.get(i); if (header == null) { header = new SpreadsheetHeaderDefinition(i, -1); rowHeaders.put(i, header); } parseHeader(header, source); } } }
private void addColumnHeaders() { String[] columnNames = cellsHeaderExtractor.getColumnNames(); for (int i = 0; i < columnNames.length; i++) { if (columnNames[i] != null) { IGridTable columnNameForHeader = cellsHeaderExtractor.getColumnNamesTable().getColumn(i).getRow(0).getSource(); GridCellSourceCodeModule source = new GridCellSourceCodeModule(columnNameForHeader, bindingContext); SpreadsheetHeaderDefinition header = columnHeaders.get(i); if (header == null) { header = new SpreadsheetHeaderDefinition(-1, i); columnHeaders.put(i, header); } parseHeader(header, source); } } }
private Object getArrayValues(ILogicalTable valuesTable, OpenlToolAdaptor ota, IOpenClass aggregateType, IOpenClass paramType) throws SyntaxNodeException { if (valuesTable.getHeight() == 1 && valuesTable.getWidth() == 1) { return RuleRowHelper.loadCommaSeparatedParam(aggregateType, paramType, field.getName(), null, valuesTable.getRow(0), ota); } return loadMultiRowArray(valuesTable, ota, paramType, aggregateType); }
public String[] getColumnNames() { if (columnNames == null) { int width = getWidth(); columnNames = new String[width]; for (int col = 0; col < width; col++) { IGridTable nameCell = columnNamesTable.getColumn(col).getRow(0).getSource(); columnNames[col] = nameCell.getCell(0, 0).getStringValue(); } } return columnNames; }
public String[] getRowNames() { if (rowNames == null) { int height = getHeight(); rowNames = new String[height]; for (int row = 0; row < height; row++) { IGridTable nameCell = rowNamesTable.getRow(row).getColumn(0).getSource(); rowNames[row] = nameCell.getCell(0, 0).getStringValue(); } } return rowNames; }
public String[] getParamPresentation() { int length = paramsTable.getHeight(); String[] result = new String[length]; int fromHeight = 0; for (int i = 0; i < result.length; i++) { int gridHeight = paramsTable.getRow(i).getSource().getHeight(); IGridTable singleParamGridTable = presentationTable.getSource().getRows(fromHeight, fromHeight + gridHeight - 1); result[i] = singleParamGridTable.getCell(0, 0).getStringValue(); fromHeight += gridHeight; } return result; }
public TableValueFilter(final SpreadsheetResult res) { this.res = res; ILogicalTable table = res.getLogicalTable(); IGridTable t = table.getSource(); this.startX = t.getGridColumn(0, 0) + table.getColumn(0).getSource().getWidth(); this.startY = t.getGridRow(0, 0) + table.getRow(0).getSource().getHeight(); }
public TableValueFilter(final SpreadsheetResult res) { this.res = res; ILogicalTable table = res.getLogicalTable(); IGridTable t = table.getSource(); this.startX = t.getGridColumn(0, 0) + table.getColumn(0).getSource().getWidth(); this.startY = t.getGridRow(0, 0) + table.getRow(0).getSource().getHeight(); }