Class SpreadsheetAction

    • Constructor Detail

      • SpreadsheetAction

        public SpreadsheetAction​(String caption)
    • Method Detail

      • isApplicableForSelection

        public abstract boolean isApplicableForSelection​(Spreadsheet spreadsheet,
                                                         Spreadsheet.SelectionChangeEvent event)
        Returns true if this action is possible in the given spreadsheet for the given selection.
        Parameters:
        spreadsheet - Target spreadsheet
        event - Selection event
        Returns:
        true if it's possible to execute this action
      • isApplicableForHeader

        public abstract boolean isApplicableForHeader​(Spreadsheet spreadsheet,
                                                      org.apache.poi.ss.util.CellRangeAddress headerRange)
        Returns true if this action is possible for the given row/column header.
        Parameters:
        spreadsheet - Target spreadsheet
        headerRange - Target column/row header range
        Returns:
        true if it's possible to execute this action
      • executeActionOnSelection

        public abstract void executeActionOnSelection​(Spreadsheet spreadsheet,
                                                      Spreadsheet.SelectionChangeEvent event)
        Execute this action on the given spreadsheet and selection.
        Parameters:
        spreadsheet - Target spreadsheet
        event - Selection event
      • executeActionOnHeader

        public abstract void executeActionOnHeader​(Spreadsheet spreadsheet,
                                                   org.apache.poi.ss.util.CellRangeAddress headerRange)
        Execute this action on the given spreadsheet and row/column header.
        Parameters:
        spreadsheet - Target spreadsheet
        headerRange - Target header range
      • isSheetProtected

        protected boolean isSheetProtected​(Spreadsheet spreadsheet)
        Returns the protection status of the given spreadsheet.
        Parameters:
        spreadsheet - Target spreadsheet
        Returns:
        true if the given spreadsheet is protected
      • isSheetProtected

        protected boolean isSheetProtected​(org.apache.poi.ss.usermodel.Sheet sheet)
        Returns the protection status of the given sheet.
        Parameters:
        sheet - Target sheet
        Returns:
        true if the given sheet is protected
      • isCellLocked

        protected boolean isCellLocked​(org.apache.poi.ss.usermodel.Cell cell)
        Returns the locking status of the given cell.
        Parameters:
        cell - Target cell
        Returns:
        true if the given cell is locked
      • getColumnHeader

        protected String getColumnHeader​(int col)
        Returns the column header for the column at the given index.
        Parameters:
        col - Column index
        Returns:
        Column header