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 void
addChildren(MenuItem menuItem)
Adds a children to the currentMenuItem
List<MenuItem>
getChildren()
TheMenuItem
s can be cascaded (allowing a tree).MenuCommand
getCommand()
Returns the command to execute if theMenuItem
is selected.String
getLabel()
The Label of the menu item.int
getOrder()
boolean
isCheckable()
Defines if the currentMenuItem
is a checkable item.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
setOrder(int order)
-
-
-
Constructor Detail
-
OperationMenuItem
public OperationMenuItem(OperationServiceWrapper operationServiceWrapper)
-
-
Method Detail
-
getLabel
public String getLabel()
Description copied from interface:MenuItem
The Label of the menu item.
-
isVisible
public boolean isVisible(List<VertexRef> targets, OperationContext operationContext)
Description copied from interface:MenuItem
Defines if the currentMenuItem
is visible.- Specified by:
isVisible
in 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:MenuItem
Defines if the currentMenuItem
is enabled. IfMenuItem.isVisible(List, OperationContext)
returns false, this is never called.- Specified by:
isEnabled
in 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:MenuItem
TheMenuItem
s can be cascaded (allowing a tree).- Specified by:
getChildren
in 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:MenuItem
Adds a children to the currentMenuItem
- Specified by:
addChildren
in interfaceMenuItem
- Parameters:
menuItem
- the child to add.
-
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.- Specified by:
getCommand
in interfaceMenuItem
- Returns:
- the command to execute if the
MenuItem
is selected, or null ifMenuItem.getChildren()
is NOT empty.
-
isCheckable
public boolean isCheckable()
Description copied from interface:MenuItem
Defines if the currentMenuItem
is a checkable item.- Specified by:
isCheckable
in 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:MenuItem
Defines if the currentMenuItem
is checked. IfMenuItem.isCheckable()
returns false, this is never called.- Specified by:
isChecked
in interfaceMenuItem
- Parameters:
targets
- The current targets (e.g. the selection)operationContext
- The currentOperationContext
.- Returns:
- True if it is checked, false otherwise.
-
-