private void initUri() { uri = table.getUri(column, row); }
public String getUri() { return table.getUri(); }
public String getUri() { return getGridTable().getUri(); }
private String getProprtiesTableId(InheritanceLevel inheritanceLevel, ITableProperties props) { String id = null; ILogicalTable propertiesTable = props.getInheritedPropertiesTable(inheritanceLevel); if (propertiesTable != null) { String tableUri = propertiesTable.getSource().getUri(); id = TableUtils.makeTableId(tableUri); } return id; }
private String getProprtiesTableId(InheritanceLevel inheritanceLevel, ITableProperties props) { String id = null; ILogicalTable propertiesTable = props.getInheritedPropertiesTable(inheritanceLevel); if (propertiesTable != null) { String tableUri = propertiesTable.getSource().getUri(); id = TableUtils.makeTableId(tableUri); } return id; }
public TableSyntaxNode findNode(XlsUrlParser p1) { TableSyntaxNode[] nodes = getTableSyntaxNodes(); for (int i = 0; i < nodes.length; i++) { if (XlsUrlUtils.intersects(p1, nodes[i].getGridTable().getUri())) { return nodes[i]; } } return null; }
public TableSyntaxNode findAnyTableNodeByLocation(XlsUrlParser p1) { TableSyntaxNode[] nodes = getTableSyntaxNodes(); for (int i = 0; i < nodes.length; i++) { if (nodes[i].getType().equals(XlsNodeTypes.XLS_DT.toString()) && XlsUrlUtils.intersectsByLocation(p1, nodes[i].getGridTable().getUri())) { return nodes[i]; } } return null; }
cellUri = table.getUri(col, row);
public ITable registerTable(String tableName, TableSyntaxNode tsn) throws DuplicatedTableException { synchronized (lock) { ITable table = getTable(tableName); if (table != null) { String uri = table.getTableSyntaxNode().getTable().getSource().getUri(); String newUri = tsn.getTable().getSource().getUri(); if (!uri.equals(newUri)){ throw new DuplicatedTableException(tableName, table.getTableSyntaxNode(), tsn); }else{ return table; } } table = makeNewTable(tableName, tsn); tables.put(tableName, table); return table; } }
cellUri = table.getUri(col, row);
public static boolean canInsertRows(IGridTable table, int nRows) { IGridRegion region = getOriginalRegion(table); GridRegion newRegion = new GridRegion(region.getBottom() + 1, region.getLeft() - 1, region.getBottom() + 1 + nRows, region.getRight() + 1); IGridTable[] allGridTables = table.getGrid().getTables(); for (IGridTable allGridTable : allGridTables) { if (!table.getUri().equals(allGridTable.getUri()) && IGridRegion.Tool.intersects(newRegion, allGridTable.getRegion())) { return false; } } return true; }
public static boolean canInsertColumns(IGridTable table, int nCols) { IGridRegion region = getOriginalRegion(table); GridRegion newRegion = new GridRegion(region.getTop() - 1, region.getRight() + 1, region.getBottom() + 1, region.getRight() + 1 + nCols); IGridTable[] allGridTables = table.getGrid().getTables(); for (IGridTable allGridTable : allGridTables) { if (!table.getUri().equals(allGridTable.getUri()) && IGridRegion.Tool.intersects(newRegion, allGridTable.getRegion())) { return false; } } return true; }
public void registerTable(ITable newTable) throws DuplicatedTableException{ synchronized (lock) { ITable table = getTable(newTable.getName()); if (table != null) { String uri = table.getTableSyntaxNode().getTable().getSource().getUri(); String newUri = newTable.getTableSyntaxNode().getTable().getSource().getUri(); if (!uri.equals(newUri)){ throw new DuplicatedTableException(newTable.getName(), table.getTableSyntaxNode(), newTable.getTableSyntaxNode()); } } tables.put(newTable.getName(), newTable); } }
private static String display(final SpreadsheetResult res, Map<Point, ComparedResult> spreadsheetCellsForTest, boolean filter, String requestId) { List<IGridFilter> filters = new ArrayList<>(); filters.add(new TableValueFilter(res)); filters.add(CollectionCellFilter.INSTANCE); if (filter) { filters.add(new LinkMaker(requestId)); // Check if the cells for test are initialized, // Means Spreadsheet should be displayed with expected values for tests // if (spreadsheetCellsForTest != null) { filters.add(new ExpectedResultFilter(spreadsheetCellsForTest)); } } ILogicalTable table = res.getLogicalTable(); IGridTable gridtable = table.getSource(); ProjectModel model = WebStudioUtils.getWebStudio().getModel(); TableSyntaxNode syntaxNode = model.getNode(gridtable.getUri()); MetaInfoReader metaInfoReader = syntaxNode == null ? EmptyMetaInfoReader.getInstance() : syntaxNode.getMetaInfoReader(); TableModel tableModel = TableModel.initializeTableModel(gridtable, filters.toArray(new IGridFilter[0]), metaInfoReader); return new HTMLRenderer.TableRenderer(tableModel).render(false); }
/** * @return New table id on the sheet where it was saved. It is needed for tables that were moved * to new place during adding new rows and columns on editing. We need to know new destination of the table. * @throws IOException */ public synchronized String save() throws IOException { XlsSheetGridModel xlsgrid = (XlsSheetGridModel) gridTable.getGrid(); xlsgrid.getSheetSource().getWorkbookSource().save(); actions = new UndoableActions(); String uri = getOriginalGridTable().getUri(); return TableUtils.makeTableId(uri); }
/** * @return New table id on the sheet where it was saved. It is needed for tables that were moved * to new place during adding new rows and columns on editing. We need to know new destination of the table. */ public synchronized String save() throws IOException { XlsSheetGridModel xlsgrid = (XlsSheetGridModel) gridTable.getGrid(); xlsgrid.getSheetSource().getWorkbookSource().save(); actions = new UndoableActions(); String uri = getOriginalGridTable().getUri(); return TableUtils.makeTableId(uri); }
public DataOpenField(ITable table, ModuleOpenClass declaringClass) { super(table.getDataModel().getName(), table.getDataModel() .getType() .getAggregateInfo() .getIndexedAggregateType(table.getDataModel().getType(), 1)); this.table = table; this.uri = table.getTableSyntaxNode().getTable().getSource().getUri(); data = table.getDataArray(); this.declaringClass = declaringClass; }
public ExecutableRulesMethod(IOpenMethodHeader header, ATableBoundNode boundNode) { super(header); this.boundNode = boundNode; if (this.boundNode != null) { uri = boundNode.getTableSyntaxNode().getTable().getSource().getUri(); } hasAliasTypeParams = false; if (header != null) { int i = 0; ICastFactory castFactory = new CastFactory(); for (IOpenClass param : header.getSignature().getParameterTypes()) { if (param instanceof DomainOpenClass) { hasAliasTypeParams = true; if (aliasDatatypesCasts == null) { aliasDatatypesCasts = new IOpenCast[header.getSignature().getNumberOfParameters()]; } IOpenClass methodParam = header.getSignature().getParameterTypes()[i]; aliasDatatypesCasts[i++] = castFactory .getCast(JavaOpenClass.getOpenClass(methodParam.getInstanceClass()), methodParam); } } } }