You're viewing an older version of Vaadin JavaDoc. Please see version 24.7.0 for the latest.
com.vaadin.flow.component.spreadsheet.

Class ContextMenuManager

  • All Implemented Interfaces:

    Serializable

    public class ContextMenuManager
    extends Object
    implements Serializable

    ContextMenuManager is an utility class for the Spreadsheet component. This class handles all context menu -related tasks within the Spreadsheet it is tied to.

    Author:

    Vaadin Ltd.

    See Also:

    Serialized Form

    • Constructor Detail

      • ContextMenuManager

        public ContextMenuManager​(Spreadsheet spreadsheet)

        Constructs a new ContextMenuManager and ties it to the given Spreadsheet.

        Parameters:

        spreadsheet - Target Spreadsheet

    • Method Detail

      • addActionHandler

        public void addActionHandler​(Action.Handler actionHandler)

        Adds the given context menu action handler to the target spreadsheet.

        Parameters:

        actionHandler - Handler to add

      • removeActionHandler

        public void removeActionHandler​(Action.Handler actionHandler)

        Removes the given context menu action handler from the target spreadsheet.

        Parameters:

        actionHandler - Handler to remove

      • hasActionHandlers

        public boolean hasActionHandlers()

        Determines if there are currently any action handlers attached to the target Spreadsheet.

        Returns:

        true if action handlers exist, false otherwise

      • onContextMenuOpenOnSelection

        public void onContextMenuOpenOnSelection​(int row,
                                                 int column)

        This method is called when a context menu event has happened on any cell of the target Spreadsheet.

        Parameters:

        row - Row index at context menu target, 1-based

        column - Column index at context menu target, 1-based

      • onRowHeaderContextMenuOpen

        public void onRowHeaderContextMenuOpen​(int rowIndex)

        This method is called when a context menu event has happened on top of a row header.

        Parameters:

        rowIndex - Index of the target row, 1-based

      • onColumnHeaderContextMenuOpen

        public void onColumnHeaderContextMenuOpen​(int columnIndex)

        This method is called when a context menu event has happened on top of a column header.

        Parameters:

        columnIndex - Index of the target column, 1-based

      • onActionOnCurrentSelection

        public void onActionOnCurrentSelection​(String actionKey)

        This method is called when an action has been selected on top of the currently selected cell(s).

        Parameters:

        actionKey - Key of the selected action

      • onActionOnRowHeader

        public void onActionOnRowHeader​(String actionKey)

        This method is called when an action has been selected on top of a row header.

        Parameters:

        actionKey - Key of the selected action

      • onActionOnColumnHeader

        public void onActionOnColumnHeader​(String actionKey)

        This method is called when an action has been selected on top of a column header.

        Parameters:

        actionKey - Key of the selected action

      • createActionsListForSelection

        protected ArrayList<SpreadsheetActionDetails> createActionsListForSelection()

        Gets a list of available actions for the current selection.

        Returns:

        List of actions

      • createActionsListForColumn

        protected ArrayList<SpreadsheetActionDetails> createActionsListForColumn​(int columnIndex)

        Gets a list of available actions for the column at the given index.

        Parameters:

        columnIndex - Index of the target column, 1-based

        Returns:

        List of actions

      • createActionsListForRow

        protected ArrayList<SpreadsheetActionDetails> createActionsListForRow​(int rowIndex)

        Gets a list of available actions for the row at the given index.

        Parameters:

        rowIndex - Index of the target row, 1-based

        Returns:

        List of actions