Пример #1
0
        /**
         * Sets the cell features
         *
         * @param cf the cell features
         */
        public void setCellFeatures(WritableCellFeatures cf)
        {
            if (features != null)
            {
                //logger.warn("current cell features for " +
                //            CellReferenceHelper.getCellReference(this) +
                //            " not null - overwriting");

                // Check to see if the features include a shared data validation
                if (features.hasDataValidation() &&
                    features.getDVParser() != null &&
                    features.getDVParser().extendedCellsValidation())
                {
                    DVParser dvp = features.getDVParser();
                    //logger.warn("Cannot add cell features to " +
                    //            CellReferenceHelper.getCellReference(this) +
                    //            " because it is part of the shared cell validation " +
                    //            "group " +
                    //            CellReferenceHelper.getCellReference(dvp.getFirstColumn(),
                    //                                                 dvp.getFirstRow()) +
                    //            "-" +
                    //            CellReferenceHelper.getCellReference(dvp.getLastColumn(),
                    //                                                 dvp.getLastRow()));
                    return;
                }
            }

            features = cf;
            cf.setWritableCell(this);

            // If the cell is already on the worksheet, then add the cell features
            // to the workbook
            if (referenced)
            {
                addCellFeatures();
            }
        }