/** * Handles any addition cell features, such as comments or data * validation. Called internally from this class when a cell is * added to the workbook, and also externally from BaseCellFeatures * following a call to setComment */ public void addCellFeatures() { if (features == null) { return; } if (copied == true) { copied = false; return; } if (features.getComment() != null) { Comment comment = new Comment(features.getComment(), column, row); comment.setWidth(features.getCommentWidth()); comment.setHeight(features.getCommentHeight()); sheet.addDrawing(comment); sheet.getWorkbook().addDrawing(comment); features.setCommentDrawing(comment); } if (features.hasDataValidation()) { try { features.getDVParser().setCell(column, row, sheet.getWorkbook(), sheet.getWorkbook(), sheet.getWorkbookSettings()); } catch (CSharpJExcel.Jxl.Biff.Formula.FormulaException e) { Assert.verify(false); } sheet.addValidationCell(this); if (!features.hasDropDown()) { return; } // Get the combo box drawing object for list validations if (sheet.getComboBox() == null) { // Need to add the combo box the first time, since even though // it doesn't need a separate Sp entry, it still needs to increment // the shape id ComboBox cb = new ComboBox(); sheet.addDrawing(cb); sheet.getWorkbook().addDrawing(cb); sheet.setComboBox(cb); } features.setComboBox(sheet.getComboBox()); } }
/** * Called when the cell is added to the worksheet. Overrides the * method in the base class in order to get a handle to the * WorkbookSettings so that this formula may be initialized * * @param fr the formatting records * @param ss the shared strings used within the workbook * @param s the sheet this is being added to */ public override void setCellDetails(FormattingRecords fr, SharedStrings ss, WritableSheetImpl s) { base.setCellDetails(fr, ss, s); initialize(s.getWorkbookSettings(), s.getWorkbook(), s.getWorkbook()); s.getWorkbook().addRCIRCell(this); }