Package adams.gui.core.spreadsheettable
Class SpreadSheetTablePopupMenuItemHelper
- java.lang.Object
-
- adams.gui.core.spreadsheettable.SpreadSheetTablePopupMenuItemHelper
-
public class SpreadSheetTablePopupMenuItemHelper extends Object
Helper class for constructing popup menus for the SpreadSheetTable.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSpreadSheetTablePopupMenuItemHelper.TableStateContainer object for the table state used by the popup menu items.
-
Constructor Summary
Constructors Constructor Description SpreadSheetTablePopupMenuItemHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static voidaddAction(SpreadSheetTablePopupMenuItemHelper.TableState state, boolean isRow, JMenuItem menuitem, SpreadSheetTablePopupMenuItem item)Adds the appropriate action to the menuitem.static voidaddProcessSelectedRowsAction(SpreadSheetTablePopupMenuItemHelper.TableState state, JPopupMenu menu, SpreadSheetTablePopupMenuItem item)Adds the available menu items to the menu for processing selected rows.static voidaddProcessSelectedRowsToPopupMenu(SpreadSheetTablePopupMenuItemHelper.TableState state, JPopupMenu menu, List<SpreadSheetTablePopupMenuItem> items)Adds the available menu items to the menu for processing selected rows.protected static voidaddToPopupMenu(SpreadSheetTablePopupMenuItemHelper.TableState state, boolean isRow, JPopupMenu menu, List<SpreadSheetTablePopupMenuItem> items)Adds the available menu items to the menu.static voidaddToPopupMenu(SpreadSheetTablePopupMenuItemHelper.TableState state, JPopupMenu menu, boolean isRow)Adds the available menu items to the menu.protected static List<SpreadSheetTablePopupMenuItem>getItems(Class cls)Returns a sorted list of popup menu items for the specified superclass.static SpreadSheetTablePopupMenuItemHelper.TableStategetState(SpreadSheetTable table)Determines the state of the table.static SpreadSheetTablePopupMenuItemHelper.TableStategetState(SpreadSheetTable table, MouseEvent e, TableRowRange range)Determines the state of the table.
-
-
-
Method Detail
-
getState
public static SpreadSheetTablePopupMenuItemHelper.TableState getState(SpreadSheetTable table)
Determines the state of the table.- Parameters:
table- the table to get the state for- Returns:
- the state
-
getState
public static SpreadSheetTablePopupMenuItemHelper.TableState getState(SpreadSheetTable table, MouseEvent e, TableRowRange range)
Determines the state of the table.- Parameters:
table- the table to get the state forrange- the range to use- Returns:
- the state
-
getItems
protected static List<SpreadSheetTablePopupMenuItem> getItems(Class cls)
Returns a sorted list of popup menu items for the specified superclass.- Parameters:
cls- the superclass- Returns:
- the list
-
addAction
protected static void addAction(SpreadSheetTablePopupMenuItemHelper.TableState state, boolean isRow, JMenuItem menuitem, SpreadSheetTablePopupMenuItem item)
Adds the appropriate action to the menuitem.- Parameters:
state- the table stateisRow- whether this is for a row or a columnmenuitem- the menuitem to add the action toitem- the menu item scheme
-
addToPopupMenu
protected static void addToPopupMenu(SpreadSheetTablePopupMenuItemHelper.TableState state, boolean isRow, JPopupMenu menu, List<SpreadSheetTablePopupMenuItem> items)
Adds the available menu items to the menu.- Parameters:
state- the table stateisRow- whether this is for a row or a columnmenu- the menu to add the items toitems- the available schemes
-
addToPopupMenu
public static void addToPopupMenu(SpreadSheetTablePopupMenuItemHelper.TableState state, JPopupMenu menu, boolean isRow)
Adds the available menu items to the menu.- Parameters:
state- the table statemenu- the menu to add the items toisRow- whether this is for a row or a column
-
addProcessSelectedRowsAction
public static void addProcessSelectedRowsAction(SpreadSheetTablePopupMenuItemHelper.TableState state, JPopupMenu menu, SpreadSheetTablePopupMenuItem item)
Adds the available menu items to the menu for processing selected rows.- Parameters:
state- the table statemenu- the menu to add the items to- See Also:
ProcessSelectedRows
-
addProcessSelectedRowsToPopupMenu
public static void addProcessSelectedRowsToPopupMenu(SpreadSheetTablePopupMenuItemHelper.TableState state, JPopupMenu menu, List<SpreadSheetTablePopupMenuItem> items)
Adds the available menu items to the menu for processing selected rows.- Parameters:
state- the table statemenu- the menu to add the items to- See Also:
ProcessSelectedRows
-
-