com.vaadin.flow.component.spreadsheet.action.
Class SpreadsheetAction
- java.lang.Object
-
- com.vaadin.flow.component.spreadsheet.framework.Action
-
- com.vaadin.flow.component.spreadsheet.action.SpreadsheetAction
-
All Implemented Interfaces:
Direct Known Subclasses:
DeleteRowAction
,DeleteTableAction
,EditCellCommentAction
,HideHeaderAction
,InsertDeleteCellCommentAction
,InsertNewRowAction
,InsertTableAction
,MergeCellsAction
,ShowHideCellCommentAction
,UnHideHeadersAction
,UnMergeCellsAction
public abstract class SpreadsheetAction extends Action
Abstract base class for Spreadsheet actions.
Since:
1.0
Author:
Vaadin Ltd.
See Also:
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.flow.component.spreadsheet.framework.Action
Action.Container, Action.Handler, Action.Listener, Action.Notifier, Action.ShortcutNotifier
-
-
Constructor Summary
Constructors Constructor Description SpreadsheetAction(String caption)
-
Method Summary
All Methods Modifier and Type Method Description abstract void
executeActionOnHeader(Spreadsheet spreadsheet, org.apache.poi.ss.util.CellRangeAddress headerRange)
Execute this action on the given spreadsheet and row/column header.
abstract void
executeActionOnSelection(Spreadsheet spreadsheet, Spreadsheet.SelectionChangeEvent event)
Execute this action on the given spreadsheet and selection.
protected String
getColumnHeader(int col)
Returns the column header for the column at the given index.
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.
abstract boolean
isApplicableForSelection(Spreadsheet spreadsheet, Spreadsheet.SelectionChangeEvent event)
Returns true if this action is possible in the given spreadsheet for the given selection.
protected boolean
isCellLocked(org.apache.poi.ss.usermodel.Cell cell)
Returns the locking status of the given cell.
protected boolean
isSheetProtected(Spreadsheet spreadsheet)
Returns the protection status of the given spreadsheet.
protected boolean
isSheetProtected(org.apache.poi.ss.usermodel.Sheet sheet)
Returns the protection status of the given sheet.
-
Methods inherited from class com.vaadin.flow.component.spreadsheet.framework.Action
getCaption, getIcon, setCaption, setIcon
-
-
-
-
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 spreadsheetevent
- Selection eventReturns:
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 spreadsheetheaderRange
- Target column/row header rangeReturns:
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 spreadsheetevent
- 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 spreadsheetheaderRange
- Target header range
-
isSheetProtected
protected boolean isSheetProtected(Spreadsheet spreadsheet)
Returns the protection status of the given spreadsheet.
Parameters:
spreadsheet
- Target spreadsheetReturns:
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 sheetReturns:
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 cellReturns:
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 indexReturns:
Column header
-
-