Class InstancesTablePopupMenuItemHelper
- java.lang.Object
-
- adams.gui.visualization.instances.instancestable.InstancesTablePopupMenuItemHelper
-
public class InstancesTablePopupMenuItemHelper extends Object
Helper class for constructing popup menus for the InstancesTable.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInstancesTablePopupMenuItemHelper.TableStateContainer object for the table state used by the popup menu items.
-
Constructor Summary
Constructors Constructor Description InstancesTablePopupMenuItemHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static voidaddAction(InstancesTablePopupMenuItemHelper.TableState state, boolean isRow, JMenuItem menuitem, InstancesTablePopupMenuItem item)Adds the appropriate action to the menuitem.protected static voidaddToPopupMenu(InstancesTablePopupMenuItemHelper.TableState state, boolean isRow, JPopupMenu menu, List<InstancesTablePopupMenuItem> items, Set<Class> added)Adds the available menu items to the menu.static voidaddToPopupMenu(InstancesTablePopupMenuItemHelper.TableState state, JPopupMenu menu, boolean isRow)Adds the available menu items to the menu.protected static List<InstancesTablePopupMenuItem>getItems(Class cls)Returns a sorted list of popup menu items for the specified superclass.static InstancesTablePopupMenuItemHelper.TableStategetState(InstancesTable table, MouseEvent e, adams.gui.core.TableRowRange range)Determines the state of the table.
-
-
-
Method Detail
-
getState
public static InstancesTablePopupMenuItemHelper.TableState getState(InstancesTable table, MouseEvent e, adams.gui.core.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<InstancesTablePopupMenuItem> 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(InstancesTablePopupMenuItemHelper.TableState state, boolean isRow, JMenuItem menuitem, InstancesTablePopupMenuItem 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(InstancesTablePopupMenuItemHelper.TableState state, boolean isRow, JPopupMenu menu, List<InstancesTablePopupMenuItem> items, Set<Class> added)
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 schemesadded- the set of items already added
-
addToPopupMenu
public static void addToPopupMenu(InstancesTablePopupMenuItemHelper.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
-
-