Class OperationMenuItem
- java.lang.Object
-
- org.opennms.features.topology.app.internal.menu.OperationMenuItem
-
- All Implemented Interfaces:
Comparable<MenuItem>,MenuItem
public class OperationMenuItem extends Object implements MenuItem
-
-
Constructor Summary
Constructors Constructor Description OperationMenuItem(OperationServiceWrapper operationServiceWrapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChildren(MenuItem menuItem)Adds a children to the currentMenuItemList<MenuItem>getChildren()TheMenuItems can be cascaded (allowing a tree).MenuCommandgetCommand()Returns the command to execute if theMenuItemis selected.StringgetLabel()The Label of the menu item.intgetOrder()booleanisCheckable()Defines if the currentMenuItemis a checkable item.booleanisChecked(List<VertexRef> targets, OperationContext operationContext)Defines if the currentMenuItemis checked.booleanisEnabled(List<VertexRef> targets, OperationContext operationContext)Defines if the currentMenuItemis enabled.booleanisVisible(List<VertexRef> targets, OperationContext operationContext)Defines if the currentMenuItemis visible.voidsetOrder(int order)
-
-
-
Constructor Detail
-
OperationMenuItem
public OperationMenuItem(OperationServiceWrapper operationServiceWrapper)
-
-
Method Detail
-
getLabel
public String getLabel()
Description copied from interface:MenuItemThe Label of the menu item.
-
isVisible
public boolean isVisible(List<VertexRef> targets, OperationContext operationContext)
Description copied from interface:MenuItemDefines if the currentMenuItemis visible.- Specified by:
isVisiblein interfaceMenuItem- Parameters:
targets- The current targets (e.g. the selection)operationContext- The currentOperationContext.- Returns:
- True if visible, false otherwise.
-
isEnabled
public boolean isEnabled(List<VertexRef> targets, OperationContext operationContext)
Description copied from interface:MenuItemDefines if the currentMenuItemis enabled. IfMenuItem.isVisible(List, OperationContext)returns false, this is never called.- Specified by:
isEnabledin interfaceMenuItem- Parameters:
targets- The current targets (e.g. the selection)operationContext- The currentOperationContext.- Returns:
- True if enabled, false otherwise.
-
getChildren
public List<MenuItem> getChildren()
Description copied from interface:MenuItemTheMenuItems can be cascaded (allowing a tree).- Specified by:
getChildrenin interfaceMenuItem- Returns:
- the children, or an empty list if no children exits. Must not be null.
-
addChildren
public void addChildren(MenuItem menuItem)
Description copied from interface:MenuItemAdds a children to the currentMenuItem- Specified by:
addChildrenin interfaceMenuItem- Parameters:
menuItem- the child to add.
-
getCommand
public MenuCommand getCommand()
Description copied from interface:MenuItemReturns the command to execute if theMenuItemis selected. Please Note, that it MUST return null ifMenuItem.getChildren()is NOT empty.- Specified by:
getCommandin interfaceMenuItem- Returns:
- the command to execute if the
MenuItemis selected, or null ifMenuItem.getChildren()is NOT empty.
-
isCheckable
public boolean isCheckable()
Description copied from interface:MenuItemDefines if the currentMenuItemis a checkable item.- Specified by:
isCheckablein interfaceMenuItem- Returns:
- true if checkable, false otherwise
- See Also:
MenuBar.MenuItem.isCheckable()
-
isChecked
public boolean isChecked(List<VertexRef> targets, OperationContext operationContext)
Description copied from interface:MenuItemDefines if the currentMenuItemis checked. IfMenuItem.isCheckable()returns false, this is never called.- Specified by:
isCheckedin interfaceMenuItem- Parameters:
targets- The current targets (e.g. the selection)operationContext- The currentOperationContext.- Returns:
- True if it is checked, false otherwise.
-
-