WorksheetFeed worksheetFeed = s.getFeed(spreadsheet.getWorksheetFeedUrl(), WorksheetFeed.class); List<WorksheetEntry> worksheets = worksheetFeed.getEntries(); WorksheetEntry worksheet = worksheets.get(0); URL cellFeedUrl= worksheet.getCellFeedUrl (); CellFeed cellFeed= s.getFeed (cellFeedUrl, CellFeed.class); CellEntry cellEntry= new CellEntry (1, 1, "aa"); cellFeed.insert (cellEntry);
/** * Declare the extensions of the feeds for the Google Spreadsheets service. */ private void declareExtensions() { new CellFeed().declareExtensions(extProfile); new ListFeed().declareExtensions(extProfile); new RecordFeed().declareExtensions(extProfile); new SpreadsheetFeed().declareExtensions(extProfile); new TableFeed().declareExtensions(extProfile); new WorksheetFeed().declareExtensions(extProfile); }
/** * Updates the cell's formula so it can be sent back to the server. * * Note that this destroys the cell's value! * * @param newInputValue the new input value (starts with '=' if a formula) */ public void changeInputValueLocal(String newInputValue) { setExtension(getCell().withNewInputValue(newInputValue)); }
/** * Constructs a new entry with the given row count and column count * @param rowCount the number of rows in the worksheet * @param colCount the number of columns in a worksheet */ public WorksheetEntry(int rowCount, int colCount) { getCategories().add(CATEGORY); addExtension(new RowCount(rowCount)); addExtension(new ColCount(colCount)); }
/** * Common initialization code for new list entries. */ private void init() { customElements = new CustomElementCollection(); this.setExtension(customElements); }
/** * Gets the total number of rows in the spreadsheet. * * This refers to the hard bound on rows. It is possible that your * spreadsheet has many, many empty rows, all of which are counted in * this count. * * Column positions 1 to getRowCount() are valid. */ public int getRowCount() { return getExtension(RowCount.class).getCount(); }
/** * Gets the total number of columns. * * This refers to the hard bound on columns. It is possible that your * spreadsheet has many empty columns, all of which are counted in * this count. * * Column positions 1 to getColCount() are valid. */ public int getColCount() { return getExtension(ColCount.class).getCount(); } }
/** * Sets the total number of rows. * * If the new number of rows is greater than the old, (new-old) * blank rows will be appended to the end. If the new number of * rows is less than the old, then (old-new) rows will be removed * from the end which will DELETE ALL DATE IN DELETED ROWS. * * @param count the new row count. */ public void setRowCount(int count) { setExtension(new RowCount(count)); }
/** * Returns whether it has the letter(s) or integer position of the column. * * @return whether it has the letter(s) or integer position of the column */ public boolean hasIndex() { return getIndex() != null; }
/** * Returns whether it has the index of the first row of the data section * (inclusive). * * @return whether it has the index of the first row of the data section * (inclusive) */ public boolean hasStartIndex() { return getStartIndex() != null; }
/** * Returns whether it has the position of the header. * * @return whether it has the position of the header */ public boolean hasRow() { return getRow() != null; }
@Override protected void validate() { if (row == null) { throwExceptionForMissingAttribute(ROW); } }
/** * Yields the <gd:cell> element that makes up this Cell Entry. */ public Cell getCell() { return getExtension(Cell.class); }
/** * Declare the extensions of the feeds for the Google Spreadsheets service. */ private void declareExtensions() { new CellFeed().declareExtensions(extProfile); new ListFeed().declareExtensions(extProfile); new RecordFeed().declareExtensions(extProfile); new SpreadsheetFeed().declareExtensions(extProfile); new TableFeed().declareExtensions(extProfile); new WorksheetFeed().declareExtensions(extProfile); }
/** * Updates the cell's formula so it can be sent back to the server. * * Note that this destroys the cell's value! * * @param newInputValue the new input value (starts with '=' if a formula) */ public void changeInputValueLocal(String newInputValue) { setExtension(getCell().withNewInputValue(newInputValue)); }
worksheetFeedUrl, WorksheetFeed.class); List <WorksheetEntry> worksheetEntrys= worksheetFeed.getEntries (); WorksheetEntry worksheetEntry= worksheetEntrys.get (0);
/** * Common initialization code for new list entries. */ private void init() { customElements = new CustomElementCollection(); this.setExtension(customElements); }
/** * Gets the total number of rows in the spreadsheet. * * This refers to the hard bound on rows. It is possible that your * spreadsheet has many, many empty rows, all of which are counted in * this count. * * Column positions 1 to getRowCount() are valid. */ public int getRowCount() { return getExtension(RowCount.class).getCount(); }
/** * Gets the total number of columns. * * This refers to the hard bound on columns. It is possible that your * spreadsheet has many empty columns, all of which are counted in * this count. * * Column positions 1 to getColCount() are valid. */ public int getColCount() { return getExtension(ColCount.class).getCount(); } }
/** * Sets the total number of rows. * * If the new number of rows is greater than the old, (new-old) * blank rows will be appended to the end. If the new number of * rows is less than the old, then (old-new) rows will be removed * from the end which will DELETE ALL DATE IN DELETED ROWS. * * @param count the new row count. */ public void setRowCount(int count) { setExtension(new RowCount(count)); }