Class SimpleMenuItem
- java.lang.Object
-
- org.opennms.features.topology.app.internal.menu.AbstractMenuItem
-
- org.opennms.features.topology.app.internal.menu.SimpleMenuItem
-
- All Implemented Interfaces:
Comparable<MenuItem>,MenuItem
public class SimpleMenuItem extends AbstractMenuItem
A simple implementation for aMenuItemwhich always returns true forisVisible(List, OperationContext)andisEnabled(List, OperationContext), but false forAbstractMenuItem.isCheckable()andisChecked(List, OperationContext)- Author:
- mvrueden
-
-
Constructor Summary
Constructors Constructor Description SimpleMenuItem(String label)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MenuCommandgetCommand()Returns the command to execute if theMenuItemis selected.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.voidsetCommand(MenuCommand command)-
Methods inherited from class org.opennms.features.topology.app.internal.menu.AbstractMenuItem
addChildren, getChildren, getLabel, getOrder, isCheckable, setCheckable, setLabel, setOrder
-
-
-
-
Constructor Detail
-
SimpleMenuItem
public SimpleMenuItem(String label)
-
-
Method Detail
-
isVisible
public boolean isVisible(List<VertexRef> targets, OperationContext operationContext)
Description copied from interface:MenuItemDefines if the currentMenuItemis visible.- 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.- Parameters:
targets- The current targets (e.g. the selection)operationContext- The currentOperationContext.- Returns:
- True if enabled, false otherwise.
-
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.- Parameters:
targets- The current targets (e.g. the selection)operationContext- The currentOperationContext.- Returns:
- True if it is checked, false otherwise.
-
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.- Returns:
- the command to execute if the
MenuItemis selected, or null ifMenuItem.getChildren()is NOT empty.
-
setCommand
public void setCommand(MenuCommand command)
-
-