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 aMenuItem
which 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 MenuCommand
getCommand()
Returns the command to execute if theMenuItem
is selected.boolean
isChecked(List<VertexRef> targets, OperationContext operationContext)
Defines if the currentMenuItem
is checked.boolean
isEnabled(List<VertexRef> targets, OperationContext operationContext)
Defines if the currentMenuItem
is enabled.boolean
isVisible(List<VertexRef> targets, OperationContext operationContext)
Defines if the currentMenuItem
is visible.void
setCommand(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:MenuItem
Defines if the currentMenuItem
is 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:MenuItem
Defines if the currentMenuItem
is 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:MenuItem
Defines if the currentMenuItem
is 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:MenuItem
Returns the command to execute if theMenuItem
is selected. Please Note, that it MUST return null ifMenuItem.getChildren()
is NOT empty.- Returns:
- the command to execute if the
MenuItem
is selected, or null ifMenuItem.getChildren()
is NOT empty.
-
setCommand
public void setCommand(MenuCommand command)
-
-