Package adams.gui.flow.menu
Class GitSubMenu
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.gui.flow.menu.AbstractFlowEditorMenuItem
-
- adams.gui.flow.menu.GitSubMenu
-
- All Implemented Interfaces:
adams.core.logging.LoggingSupporter
,adams.core.SizeOfHandler
,Serializable
,Comparable<adams.gui.flow.menu.AbstractFlowEditorMenuItem>
public class GitSubMenu extends adams.gui.flow.menu.AbstractFlowEditorMenuItem
Sub-menu for git actions.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<AbstractFlowEditorGitMenuItem>
m_MenuItems
the sub-menu items.
-
Constructor Summary
Constructors Constructor Description GitSubMenu()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addMenuItem(AbstractFlowEditorGitMenuItem menuitem)
Adds the menuitem to the sub-menu and the list of managed menuitems.String
getMenu()
Returns the name of the menu to list this item under.boolean
hasAction()
Returns whether the menu item is based on an action.boolean
hasSubMenu()
Returns whether the menu item is based on a submenu.protected adams.gui.action.AbstractBaseAction
newAction()
Creates the action to use.protected JMenu
newSubMenu()
Creates the submenu to use.void
update()
Updating the action/menuitem/submenu, based on the current status of the owner.-
Methods inherited from class adams.gui.flow.menu.AbstractFlowEditorMenuItem
compareTo, determineCaption, equals, getAction, getMenuItem, getMenuItems, getOwner, getSubMenu, hasMenuItem, initialize, newMenuItem, setOwner
-
-
-
-
Field Detail
-
m_MenuItems
protected List<AbstractFlowEditorGitMenuItem> m_MenuItems
the sub-menu items.
-
-
Method Detail
-
hasAction
public boolean hasAction()
Returns whether the menu item is based on an action.- Overrides:
hasAction
in classadams.gui.flow.menu.AbstractFlowEditorMenuItem
- Returns:
- true if action-based
-
newAction
protected adams.gui.action.AbstractBaseAction newAction()
Creates the action to use.- Specified by:
newAction
in classadams.gui.flow.menu.AbstractFlowEditorMenuItem
- Returns:
- the action
-
hasSubMenu
public boolean hasSubMenu()
Returns whether the menu item is based on a submenu.- Overrides:
hasSubMenu
in classadams.gui.flow.menu.AbstractFlowEditorMenuItem
- Returns:
- true if submenu-based
-
addMenuItem
protected void addMenuItem(AbstractFlowEditorGitMenuItem menuitem)
Adds the menuitem to the sub-menu and the list of managed menuitems.- Parameters:
menuitem
- the menuitem to add
-
newSubMenu
protected JMenu newSubMenu()
Creates the submenu to use.- Overrides:
newSubMenu
in classadams.gui.flow.menu.AbstractFlowEditorMenuItem
- Returns:
- the submenu
-
getMenu
public String getMenu()
Returns the name of the menu to list this item under.- Specified by:
getMenu
in classadams.gui.flow.menu.AbstractFlowEditorMenuItem
- Returns:
- the name of the menu
-
update
public void update()
Updating the action/menuitem/submenu, based on the current status of the owner.- Specified by:
update
in classadams.gui.flow.menu.AbstractFlowEditorMenuItem
-
-